How leifermendez/api-whatsapp-ts works
Project type and purpose
• This is a Node.js/TypeScript microservice that exposes a REST API for creating “leads” and dispatching them to WhatsApp via various providers (Baileys, Meta, Twilio, Venom, or a mock).
• The README shows simple install/build/dev instructions and a Docker entrypoint, confirming it’s a containerized backend service (no frontend).
File structure
• Top-level files: Dockerfile, .env.example, package.json, tsconfig.json, README.MD.
• src/app.ts: the entrypoint (bootstraps the server, loads IoC container, starts Express).
• src/application: application services (use-case layer), e.g. lead.create.ts.
• src/domain: domain model and repository interfaces (lead.ts, lead.repository.ts, lead-external.repository.ts).
• src/infrastructure:
• controller: Express controllers (e.g. lead.ctrl.ts)
• router: Express router definitions (lead.route.ts, combined in index.ts)
• repositories: concrete adapters implementing repository interfaces (Baileys, Meta, Twilio, Venom, WS external, mock)
• ioc.ts: wires interfaces to concrete implementations via dependency injection
• No database directory—persistence is represented by external-API adapters.
README for additional insights
• The service name (“apiwhatsappts”) and build commands confirm a server-only, DDD-style project.