Files
whatshooked/PLAN.md
2025-12-28 21:34:45 +02:00

37 lines
2.4 KiB
Markdown

Lets create a new project. I've already created the go.mod file.
Be pricise and summaritive.
The project is written in modern go.mod
The project must do the following:
A service that connects to whatsapp via the whatsmeow api. When new message are received, it will send the message to all registered hooks.
The service must have a list of registered web hooks.
Whet a hook is called, it must send a message to whatsapp.
Name the hooks and enpoints correctly.
Two way communication is needed.
First Phase:
Instance / Config level hooks and whatsapp accounts.
Text/HTML messages only for a start.
- config package: That contains all configuration data for the application, including database connection information, API keys, etc.
- logging package: This package should handle logging in a structured way. It should be able to log errors, warnings, and other messages with different levels of severity.
- whatsapp package: This package must use https://github.com/tulir/whatsmeow to connect to multiple whatsapp accounts.
- whatsapp api package: This package must use the official whatsapp business api for sending messages to whatsapp accounts.
- whatshook server command: The server should start and connect to a given whatsapp accounts via config. New message must be pushed to all created hooks.
- whatshook cli command: Do connection via server, and push new message to hooks via server. Check server health. Add accounts. Add hooks.
events system: Whatsapp api events must be sent / received via the event system. The events system must publish to the hooks and whatsapp apis.
For example, whatsapp notifies of connect,disconnect message received events etc.
Web handlers for hooks to send whatsapp messages. Events must then be publish on successfull or failes sends.
Document/Images message and other types of messages.
Second Phase:
User level hooks and whatsapp accounts.
- webserver package: Must provide a web server that can serve the application's frontend and API endpoints. based on https://github.com/bitechdev/ResolveSpec
- webserver template subpackage: Must contain all templates for the application.
- api subpackage: Must contain all API endpoints and implement https://github.com/bitechdev/ResolveSpec
- auth package: This package should handle authentication in a secure way. It should be able to authenticate users, generate tokens, and verify user credentials.