How vaibhav9600/ordermanagementsystem works
Main Components
• Frontend (React Native Mobile App)
• Files: App.js, FrontPage.tsx, and the entire src folder with components, screens, data, navigation, and state management (Redux slices).
• Responsibilities: Provides user interfaces for product browsing, ordering, cart management, shipping/billing addresses, and checkout.
• Backend (Golang Service)
• Files: Everything under the server directory including main.go, multiple models (for products, cart items, invoices, etc.), and API configurations.
• Responsibilities: Handles business logic, API endpoints for product, shipping/billing, payment, invoice, and cart management.
• Database (Backend Storage)
• While the README mentions SQLite (or a configured database), note the file server/storage/postgres.go which might indicate alternative or additional DB configurations.
• Containerization and Orchestration
• Docker components: Dockerfile, docker-compose.yml for both the backend and (possibly) frontend (as indicated by the Dockerfile.nginx and NGINX config files).
• Kubernetes files: deployment.yaml, ingress.yaml, and service.yaml which orchestrate container deployment and scaling.
• Web Server (NGINX)
• Files: nginx.yaml in the server directory along with Dockerfile.nginx. Responsible for reverse proxying requests to the frontend and backend services.
Relationships and Interactions Between Components
• The Frontend interacts with the Backend via a set of REST API endpoints.
• The Backend handles requests, interacts with the database as needed, and communicates back to the frontend.
• NGINX acts as the reverse proxy directing external traffic:
• It routes /api/ calls to the backend service.
• It routes other requests (such as those for the React Native bundle, if served from a web server, or static assets) to the frontend service.
• Containerization (Docker) packages both frontend and backend services, while Kubernetes manages deployment, scaling, and service discovery within the network.
Architectural Patterns and Design Principles
• Separation of Concerns: Clear split between frontend (UI) and backend (API/business logic).
• Containerization: Use of Docker for ensuring consistent deployment environments.
• Microservice-like approach (although integrated in one repository): Different facets of the order management (i.e., product, shipping, invoicing) are kept modular.
• API-Driven Architecture: The backend provides RESTful endpoints for direct interaction with the mobile app.
• Orchestration & Routing: Kubernetes and NGINX manage container orchestration and API gateway patterns.