This is a WhatsApp sales chatbot project developed in Node.js, using the WhatsApp Web Automation library (WA Web.js). The chatbot provides information about courses for sale and directs users to the purchase link. It also includes authentication and token renewal features.
src: Contains the application's source code.config: Application settings.controllers: Controllers for handling chatbot logic.middleware: Middlewares, including authentication.models: Data models, such as the user model.routes: Definition of application routes.utils: Utilities and helper functions.views: Templates or HTML files for rendering.test: Test files to ensure code quality.
public: Stores static files such as CSS and JavaScript.logs: Directory for storing application logs.
- Authentication: Users can register and log in to access protected resources.
- JWT Tokens: Authentication based on JSON Web Tokens (JWT).
- Token Renewal: Implementation of token renewal using refresh tokens.
- Token Cleanup: Expired tokens are removed from the user's token list during verification.
- Configure environment variables in a
.envfile. - Install dependencies with
npm install. - Start the server with
npm start.
- The chatbot responds to WhatsApp messages and provides information about courses for sale.
- To access protected resources, such as admin routes, log in and use the JWT token.
- Tests can be executed with
npm test. - Make sure to set up a separate test environment if needed.
Contributions are welcome! Feel free to open issues and submit pull requests.
This project is licensed under the MIT License.