Streamline web interactions with WPP-Assistant AI!
Developed with the software and tools below.
WPP-Assistant streamlines WhatsApp interactions by integrating AI capabilities to send messages, contact owners, and manage conversations. It orchestrates webhooks, user data, and AI processing to enhance communication efficiency and user engagement. By connecting to MongoDB, OpenAI, and WhatsApp API, it enables automated message handling and AI-driven responses for seamless conversation management and user experience improvement.
Feature | Description | |
---|---|---|
โ๏ธ | Architecture | Node.js based architecture with Express for API, MongoDB for data storage, and integration with OpenAI for AI functionality. Modular design with clear separation of concerns. Centralized webhook controller for external service interactions. |
๐ฉ | Code Quality | Consistent coding style, adheres to best practices. Good code readability and maintainability. Proper comments and documentation throughout the codebase. |
๐ | Documentation | Extensive documentation with code snippets, explanations, and summaries in key files like webhook.controller.js , userModel.js , and main.js . Readme file provides setup instructions and usage guidelines. |
๐ | Integrations | Integrates with MongoDB for data storage, Express for API handling, and OpenAI for AI features. External dependencies include Mongoose and OpenAI API for seamless integration. |
๐งฉ | Modularity | Codebase is modular with separate files for different functionalities like handling incoming messages, user data management, and AI interactions. Encourages code reuse and easy maintenance. |
๐งช | Testing | Testing frameworks not explicitly mentioned in the repository contents. May benefit from the addition of unit tests or integration tests for improved reliability. |
โก๏ธ | Performance | Efficient architecture and code design. Utilizes asynchronous operations for improved responsiveness. Resource usage optimized through proper database interactions and AI processing. |
๐ก๏ธ | Security | Secure handling of data with MongoDB integration. Authentication mechanisms in place for webhook interactions. Potential for further enhancements in data encryption and access control. |
๐ฆ | Dependencies | Key dependencies include Mongoose for MongoDB interactions, Express for API handling, and OpenAI API for AI functionalities. Development dependencies include package-lock.json. |
๐ | Scalability | Designed to handle increased traffic through the use of asynchronous processing, scalability potential with MongoDB for data storage, and Express for API routing. May require load testing for optimal scalability planning. |
โโโ WPP-Assistant/
โโโ config.env.example
โโโ package-lock.json
โโโ package.json
โโโ src
โโโ api
โ โโโ app.js
โ โโโ controller
โ โ โโโ webhook.controller.js
โ โโโ routes
โ โ โโโ index.routes.js
โ โ โโโ webhook.routes.js
โ โโโ service
โ โโโ findThread.service.js
โโโ config
โ โโโ mongoose.js
โ โโโ openAI.js
โโโ database
โ โโโ model
โ โโโ userModel.js
โโโ ia
โ โโโ createMessage.js
โ โโโ createNewThread.js
โ โโโ retrieveAssistant.js
โ โโโ retrieveMessage.js
โโโ main.js
โโโ skills
โโโ contactOwner.js
โโโ mainAI.js
โโโ sendMessage.js
.
File | Summary |
---|---|
package.json | Code Snippet Summary:**webhook.controller.js processes incoming data in the WPP-Assistant repository, managing interactions with external services for handling webhook requests. |
package-lock.json | Code snippet-Webhook controller: Manages incoming requests for webhooks, verifying authentication and parsing data before passing to the main application. |
config.env.example | Code in webhook.controller.js manages incoming requests from webhooks, coordinating data retrieval with findThread.service.js for streamlined communication flow in the WPP-Assistant repository. This code plays a vital role in handling external interactions within the application architecture. |
src
File | Summary |
---|---|
main.js | main.js` orchestrates configuration setup and API initialization for the WPP-Assistant repository, connecting to MongoDB and OpenAI before starting the application. |
src.skills
File | Summary |
---|---|
sendMessage.js | Summary:**The sendMessage function in sendMessage.js sends a text message via HTTP POST request to a specified phone number using the provided message content. It interacts with an external endpoint for message delivery. |
contactOwner.js | Code Summary:**contactOwner.js in WPP-Assistant/src/skills sends a message to the owner via WhatsApp API. Involves constructing JSON payload and handling API request. |
mainAI.js | Summary:mainAI.js orchestrates AI interactions in the WPP-Assistant project. It processes AI responses, triggers actions, and directs interactions based on predefined criteria. |
src.database.model
File | Summary |
---|---|
userModel.js | File Summary: userModel.js**Defines User model schema for MongoDB using Mongoose. Stores user details like name, contactPhone, and threadId. Essential for user data management in the WPP-Assistant app. |
src.api
File | Summary |
---|---|
app.js | Code snippet in src/api/app.js sets up Express server, imports routes, and listens on port 3331. This file plays a critical role in the repository's architecture by defining the server's configuration and routing structure. |
src.api.controller
File | Summary |
---|---|
webhook.controller.js | Code Summary:**webhook.controller.js handles incoming webhooks to find threads and process AI tasks. Key functions are to locate threads and run AI actions for conversations in the WPP-Assistant repository architecture. |
src.api.routes
File | Summary |
---|---|
webhook.routes.js | Summary:** webhook.routes.js in WPP-Assistant routes requests to webhookController via Express Router, handling webhook interactions in the API layer. |
index.routes.js | Index routes connect to webhook routes using Express Router, managing API endpoint paths efficiently in the WPP-Assistant repository architecture. |
src.api.service
File | Summary |
---|---|
findThread.service.js | Code in findThread.service.js locates thread ID by phone, creates new thread if needed, and saves user details. Essential for user engagement and data management in the WPP-Assistant repository. |
src.config
File | Summary |
---|---|
mongoose.js | Code Summary**:In the mongoose.js file within WPP-Assistant/src/config, this code snippet establishes a connection to the MongoDB database using Mongoose, logging success or errors. This critical feature ensures seamless database connectivity in the repository architecture. |
openAI.js | Code Summary:**Enables OpenAI integration in the WPP-Assistant system by initializing OpenAI with API key and retrieving assistant details. Facilitates AI-powered features. |
src.ia
File | Summary |
---|---|
createNewThread.js | Code Summary:**In createNewThread.js , it imports openAI config to create a new thread using OpenAI's API, returning the thread's ID. This supports AI-driven conversation functionality in the repository's architecture. |
createMessage.js | Role**: createMessage.js manages AI-assisted response creation within the WPP-Assistant repository. It leverages OpenAI to generate messages for specified conversation threads. |
retrieveMessage.js | Role:** retrieveMessage.js fetches message data from OpenAI for a chat thread in the WPP-Assistant repository.Features: Utilizes OpenAI API to retrieve messages with a delay for efficiency. |
retrieveAssistant.js | Summary:**retrieveAssistant.js retrieves assistant details using OpenAI API. It plays a key role in fetching assistant information for AI functionalities in the WPP-Assistant repository. |
Requirements
Ensure you have the following dependencies installed on your system:
- JavaScript:
version x.y.z
- Clone the WPP-Assistant repository:
git clone https://github.com/thadeucbr/WPP-Assistant
- Change to the project directory:
cd WPP-Assistant
- Install the dependencies:
npm install
Use the following command to run WPP-Assistant:
node app.js
Use the following command to run tests:
npm test
-
โบ INSERT-TASK-1
-
โบ INSERT-TASK-2
-
โบ ...
Contributions are welcome! Here are several ways you can contribute:
- Submit Pull Requests: Review open PRs, and submit your own PRs.
- Join the Discussions: Share your insights, provide feedback, or ask questions.
- Report Issues: Submit bugs found or log feature requests for the
WPP-Assistant
project.
Contributing Guidelines
- Fork the Repository: Start by forking the project repository to your github account.
- Clone Locally: Clone the forked repository to your local machine using a git client.
git clone https://github.com/thadeucbr/WPP-Assistant
- Create a New Branch: Always work on a new branch, giving it a descriptive name.
git checkout -b new-feature-x
- Make Your Changes: Develop and test your changes locally.
- Commit Your Changes: Commit with a clear message describing your updates.
git commit -m 'Implemented new feature x.'
- Push to GitHub: Push the changes to your forked repository.
git push origin new-feature-x
- Submit a Pull Request: Create a PR against the original project repository. Clearly describe the changes and their motivations.
Once your PR is reviewed and approved, it will be merged into the main branch.
This project is protected under the SELECT-A-LICENSE License. For more details, refer to the LICENSE file.
- List any resources, contributors, inspiration, etc. here.