How nguyennhuty/yfood-react-nodejs-mongoose-graphql-microservice-firebase-blockchain works
Major Components
• Mobile Apps: There are two main mobile applications – one for admin (mobile/admin) and one for client users (mobile/client). They share a similar folder structure with assets, components, hooks, etc. (likely built using a React Native/Web framework).
• Web Applications:
– Web Admin: Under web/admin1, you have an administrative interface with its own React/Vite-based application.
– Web Client: There is also a web/client directory, likely representing the customer-facing web interface.
• Backend API: Located under web/backend, this is the central Node.js/TypeScript service, implementing REST (or similar) endpoints. It is composed of controllers, models, routes, services, and a modular structure with many business domains such as account, food, order, cart, reviews, and even integrations like RabbitMQ and blockchain.
• External & Supporting Services:
– Database: There are several DB-config and migration files (for example, ormconfig.json and migrations) indicating a relational database.
– Caching: Note the RedisCache module under “cache”.
– Messaging & Integration: RabbitMQ scripts for sending/receiving messages are present, and there are blockchain service integrations.
– Docker & Environment Tools: Dockerfiles in several modules and a docker-compose.yml indicate containerization and deployment configuration.
Relationships and Interactions
• The mobile and web front-ends (admin and client) are consumers of the backend API. They exchange data via RESTful endpoints.
• The backend itself is separated into multiple modules (using a modular design pattern) such as account, food, cart, etc., each comprised of controllers, models, routes, services, and utilities.
• The backend communicates with a database for persistence. It may also interact with external services like a Redis cache for performance, RabbitMQ for asynchronous processing, and blockchain interfaces.
Architectural Patterns
• Separation of Concerns: There is a clear separation between presentation layers (mobile/web apps) and business logic (backend).
• Modular Architecture: The “backend” is split into many modules, each handling specific business domains.
• API Gateway/Service Communication: The front-end applications (mobile and web) communicate via APIs hosted in the backend.
• Containerization and CI/CD: The use of Dockerfiles and docker-compose indicates an infrastructure managed with containers.