How siddharthjiyani/budget_management_system_odoo works
Project Type and Purpose
• This is a full-stack web application (“client” + “server” directories).
• Purpose: Manage master data (products, budgets, contacts, tags, categories), handle purchase orders, sales orders, invoices, payments (via Razorpay), file uploads (to Cloudinary), email notifications, and a customer portal. It also includes AI-driven recommendations.
File Structure
• Top level:
• client/ – React + Vite + Tailwind front end
• server/ – Node.js + Express REST API + MongoDB (implied by Mongoose models)
• client/src:
• components, pages, services, context → UI layer, state management, API calls
• server/:
• config/ – database, passport (authentication), Cloudinary, API settings
• controllers/ – request handling (MVC controller layer)
• routes/ – Express routing (REST endpoints)
• models/ – Mongoose schemas (data layer)
• services/ – business logic (AI recommendations, historical data, auto-analytical computations)
• middleware/ – authentication guard
• utils/ – file uploading, email sending
• scripts/ – seeding and testing
• External integrations:
• Razorpay (payment gateway)
• Cloudinary (file storage)
• Email service (SMTP or transactional via mailSender)
Extract Insights from README
• (Not provided; inferred from file tree.)
Main Components & Interactions
a. Components:
1. Browser / Client UI (React SPA)
2. API Gateway (Express server)
3. Authentication Service (Passport + JWT)
4. Business Services (AI Recommendation, AutoAnalytical, Historical Data)
5. Data Persistence (MongoDB collections via Mongoose)
6. External Services:
– Razorpay (Payment)
– Cloudinary (File Uploads)
– Email SMTP service (Verification, Password Reset)
b. Relationships & Data Flows:
– User interacts with React UI → calls REST endpoints in Express.
– Express middleware authenticates → controllers invoke service layer → models read/write MongoDB.
– File uploads → forwarded to Cloudinary via server/utils/imageUploader → returns URL.
– Payments → React triggers Razorpay widget → server/payment route confirms transaction.
– Emails → server/utils/mailSender dispatches via SMTP (emailVerificationTemplate, forgotPasswordTemplate).
– AI service → controller invokes AIRecommendationService → may read historical data, seed data, respond to front end.
c. Architectural Patterns & Principles:
– Layered (Presentation, Controller, Service, Data)
– MVC-inspired with clear separation of concerns
– RESTful APIs
– Context/Hook pattern in React for global auth/theme state
– Seed scripts for test data and AI training
d. Key Technologies & Frameworks:
– Front-end: React, Vite, Tailwind, React Router, Context API, Razorpay SDK
– Back-end: Node.js, Express, Mongoose, Passport.js, Cloudinary SDK, Nodemailer (or similar)
Capturing Essential Architectural Elements
• Authentication flow: Login/Signup → Passport → JWT issuance → Protected routes
• Customer Portal as a sub-module of the Frontend, calling restricted “/portal” endpoints
• Master Data management flows separately from Purchase/Sales/Invoice flows for clarity