How zeeshan-khan-2003/acc-mgmt works
Project Type & Purpose
• This is a full-stack Accounting/ERP system (“Odoo – Accounting/ERP System”)
• Backend: Python + Flask + SQLAlchemy
• Frontend: Next.js 13 (app directory) + React components
• Core features: user/auth management, contacts/products, purchase & sales orders, vendor bills, customer invoices, payments, general ledger, financial reports
Key Architectural Components
a. Frontend (Next.js)
• UI Layer: pages in fronted/src/app/* (admin pages, forms, login, dashboards)
• Presentation Components: fronted/src/components/* and fronted/src/components/ui/*
• Client-side libs: fronted/src/lib/database.js, health-check.js, utils.js
• Build & Config: package.json, next.config.mjs, ESLint/JSConfig
b. Backend (Flask API)
• Application Entrypoint: backend/app.py (Flask app + route definitions)
• Data Models & ORM: backend/schema.py & SQLAlchemy models
• Database Connection: backend/database.py
• Seed & Migrations: backend/seed.py, backend/insert_products.py, backend/dataset.sql
• Tests: backend/test_app.py
• Dependencies: backend/req.txt
c. Database
• Core tables: Contacts_Master, Product_Master, Taxes_Master, chart_of_accounts_Master, users, purchase_orders, purchase_order_items, vendor_bills, sales_orders, sales_order_items, customer_invoices, payments, general_ledger
d. External/Supporting Services
• (Optional) File storage for static assets served by Next.js under public/
• CI/CD pipeline (inferred)—build & test commands for frontend and backend
Relationships & Data Flows
• User → Browser UI (Next.js SSR/CSR)
• User actions on forms and dashboards trigger client-side code in src/app and src/components.
• API calls via fetch/Axios to Flask REST endpoints.
• Frontend → Flask API
• Authentication endpoints (login/logout)
• CRUD endpoints for contacts, products, orders, invoices, payments, ledger entries
• Flask API → Database
• SQLAlchemy session to read/write tables per request
• Seed scripts populate master data on startup or CI runs
Architectural Patterns & Principles
• Separation of Concerns:
• Next.js handles presentation and routing (app folder structure).
• Flask implements business logic, validation, authentication, ORM abstraction.
• Layered Architecture:
• Presentation Layer (React)
• API Layer (Flask controllers)
• Service/Repository Layer (SQLAlchemy models)
• Persistence Layer (RDBMS)
• Modular Directory Structure:
• Frontend features co-located under src/app/<feature>
• Reusable UI primitives under src/components/ui
• Backend scripts organized by function (app, schema, seed, tests)