A full-stack application for managing client financial statements, daily sales, and reports with role-based access control.
DanSaviour Enterprise provides an intuitive dashboard for:
- Client Management: CRUD operations for clients, with custom commissions and contact details.
- Statement Tracking: Automated calculation of net, balances, commissions, receivables/payables based on daily sales, wins, expenses, and payments.
- Daily Sales: Record and aggregate daily sales (Monday–Sunday) to generate weekly statements.
- Reports: Monthly/Yearly performance reports per client.
- Role-Based Access: Secure endpoints for managers and directors via JWT authentication.
-
Backend (Node.js + Express + MongoDB)
- Dynamic statement computations (
computeStatement) with cascading updates. - Persisted
StatementandDailySalescollections. - User roles: Director (full access), Manager (limited).
- Scheduled report generation (monthly/yearly).
- Dynamic statement computations (
-
Frontend (Next.js 13 App Router + React + Tailwind CSS/CSS Modules)
- Responsive dashboard with Sidebar & Navbar.
- Pages for clients, statements, and forms to add/edit entries.
- Secure storage of JWT tokens for API calls.
- Modular CSS with consistent design tokens (colors, spacing, typography).
| Layer | Technology |
|---|---|
| Backend | Node.js, Express, Mongoose |
| Database | MongoDB |
| Authentication | JWT (JSON Web Tokens) |
| Frontend | Next.js 13 (App Router) |
| Styling | Tailwind CSS & CSS Modules |
| HTTP Client | Axios |
- Node.js (v16+)
- Yarn
- MongoDB (local or Atlas)
git git@github.com:manuelhorvey/accountauto.git
cd dansaviour-enterprisecd backend
yarn install- Create a
.envfile:MONGO_URI=mongodb://localhost:27017/dansaviour JWT_SECRET=your_jwt_secret PORT=5000
yarn dev
# Runs with nodemon on http://localhost:5000cd ../frontend
yarn install- Create a
.env.localfile:NEXT_PUBLIC_API_URL=http://localhost:5000/api
yarn dev
# Launches Next.js on http://localhost:3000project-root/
├─ backend/
│ ├─ src/
│ │ ├─ controllers/
│ │ ├─ middleware/
│ │ ├─ models/ # Mongoose schemas
│ │ ├─ routes/ # Express routers
│ │ └─ index.js # Server entry
│ └─ .env
├─ frontend/
│ ├─ app/ # Next.js App Router pages
│ │ ├─ dashboard/
│ │ │ ├─ clients/...
│ │ │ └─ statements/...
│ │ ├─ layout.js
│ │ └─ page.js # Home
│ ├─ components/ # Reusable UI (Navbar, Sidebar, Cards)
│ ├─ lib/api.ts # Axios instance & hooks
│ ├─ styles/
│ └─ .env.local
└─ README.md
POST /api/auth/login— Authenticate user (returns JWT)
GET /api/clients— List all clientsGET /api/clients/:id— Fetch single clientPOST /api/clients— Create client (Director only)PUT /api/clients/:id— Update client (Director only)DELETE /api/clients/:id— Delete client (Director only)
GET /api/statements?client=<id>— List statements for a clientPOST /api/statements— Add statement + daily salesPUT /api/statements/:id— Edit statement & ripple updatesDELETE /api/statements/:id— Remove statement + daily sales
GET /api/dailySales/:statementIdPUT /api/dailySales/:statementId
GET /api/reports/:clientId/:periodPOST /api/reports
- Fork the repo
- Create a feature branch (
git checkout -b feat/your-feature) - Commit changes (
git commit -m "feat: ...") - Push to branch (
git push origin feat/your-feature) - Open a Pull Request
This project is licensed under the MIT License. See the LICENSE file for details.