How harsh-porwal424/expensetracker works
Main Components
• Frontend: Built with React 18, Vite, and TailwindCSS. The file tree shows a detailed directory structure for components, services, tests, and configuration (e.g., vite.config.js, tailwind.config.js). This component provides user interfaces for expense management, user authentication, and dashboards.
• Backend: Built with Node.js and Express, integrated with MongoDB (deduced from model files). This component handles API routing, controllers for categories, transactions, and user services, and JWT authentication middleware.
• Database: Although not directly visible in the file tree, the README indicates usage of MongoDB. Represent this external component as the persistent data store.
• Monitoring Tools: Prometheus and Grafana are used to capture metrics (request count, gauges, and histograms) as shown in the backend/monitering directory and prometheus.yml. This component monitors API metrics and system behavior.
• CI/CD Pipeline: Defined in the README (GitHub Actions workflows in .github/workflows and Dockerfiles in both frontend and backend). This pipeline automates building, testing, and container deployment. For deployment, Docker Compose orchestration is used (backend/docker-compose.yml) to stand up backend, Prometheus, and Grafana containers.
• Cloud Infrastructure: In production, the frontend is hosted on Vercel, and backend services are deployed on AWS EC2 as per the README.
Relationships & Interactions
• The Frontend connects to the Backend via RESTful API endpoints (e.g., /api/v1/users, /api/v1/transactions) for user authentication, transaction management, and category services.
• The Backend communicates with the MongoDB database for data persistence.
• The Backend publishes key metrics (HTTP request counters, active users gauge, etc.) to Prometheus.
• Prometheus aggregates metrics and provides them to Grafana, which then displays monitoring dashboards.
• The CI/CD pipeline automates building and deployment. Include components such as GitHub Actions for continuous integration and Docker Compose for orchestration.
• Containerization interlinks all services with clearly defined ports (backend: 8000, Prometheus: 9090, Grafana: 3001).
Important Architectural Patterns & Design Principles
• Layered Architecture: Separation between frontend and backend, with clear API contracts.
• Containerization: Use of Docker and Docker Compose facilitates deployment consistency across environments.
• Microservice/Modular Approach: Even though it’s a monolith by structure, the separation of concerns into controllers, middleware, models, and services signifies modular design.
• CI/CD Integration: GitHub Actions pipelines show an automated delivery system that builds, tests, and deploys code.
• Observability: Integrated Prometheus and Grafana monitoring ensures proactive performance tracking.
Relevant Technologies & Frameworks
• Frontend: React 18, Vite, TailwindCSS.
• Backend: Node.js, Express, MongoDB, JWT, Bcrypt.
• Monitoring: Prometheus and Grafana.
• Containerization & DevOps: Docker, Docker Compose, GitHub Actions.
• Testing: Jest, React Testing Library (from test directories).