https://github.com/smartcraze/surajenterprises.work
Suraj Enterprises
https://github.com/smartcraze/surajenterprises.work
cms construction-company contractor cotractor enterprises management suraj system
Last synced: about 1 year ago
JSON representation
Suraj Enterprises
- Host: GitHub
- URL: https://github.com/smartcraze/surajenterprises.work
- Owner: smartcraze
- Created: 2025-05-19T16:47:13.000Z (about 1 year ago)
- Default Branch: main
- Last Pushed: 2025-06-18T13:19:40.000Z (about 1 year ago)
- Last Synced: 2025-06-18T14:24:57.129Z (about 1 year ago)
- Topics: cms, construction-company, contractor, cotractor, enterprises, management, suraj, system
- Language: TypeScript
- Homepage: https://surajenterprises.work
- Size: 33.2 MB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
Absolutely Suraj bhai πͺ β letβs plan all the **main routes** (API endpoints) you'll need for your **Contractor Management System**.
We're keeping things clean, modular, and ready for scale π₯
This will be organized into **Auth**, **Users**, **Projects**, **Transactions**, and **Reports**.
docker volume create postgres_data && docker run -d --name postgres -v postgres_data:/var/lib/postgresql/data -e POSTGRES_PASSWORD=postgres -p 5432:5432 postgres:latest
---
## π‘οΈ AUTH ROUTES
| METHOD | PATH | DESCRIPTION |
| ------ | -------------- | ---------------------------------- |
| POST | `/auth/signup` | Admin/Foreman registration |
| POST | `/auth/login` | Admin/Foreman login (phone + pass) |
| POST | `/auth/logout` | Logout (if using sessions/cookies) |
| GET | `/auth/me` | Get logged-in user info |
---
## π€ USER ROUTES (Labors, Foremen, Admins, etc.)
| METHOD | PATH | DESCRIPTION |
| ------ | ------------ | ------------------------------------ |
| GET | `/users` | List all users (with roles) |
| POST | `/users` | Create a user (LABOR, FOREMAN, etc.) |
| GET | `/users/:id` | Get single user detail |
| PUT | `/users/:id` | Update user (rate, phone, etc.) |
| DELETE | `/users/:id` | Remove user |
β
You can filter `?role=LABOR` etc., if needed
β
Only Admin/Foreman should access these
---
## ποΈ PROJECT ROUTES
| METHOD | PATH | DESCRIPTION |
| ------ | --------------- | --------------------------------- |
| GET | `/projects` | List all projects |
| POST | `/projects` | Create a new project |
| GET | `/projects/:id` | Project detail + associated users |
| PUT | `/projects/:id` | Update project info |
| DELETE | `/projects/:id` | Delete a project |
---
## πΈ TRANSACTION ROUTES
| METHOD | PATH | DESCRIPTION |
| ------ | ------------------- | ---------------------------------------------- |
| GET | `/transactions` | All transactions (filter by type/user/project) |
| POST | `/transactions` | Create transaction (advance, payment, etc.) |
| GET | `/transactions/:id` | Get specific transaction |
| PUT | `/transactions/:id` | Edit transaction |
| DELETE | `/transactions/:id` | Delete transaction |
> π‘ Filter with query params like `?userId=xyz&type=PAYMENT&projectId=abc`
---
## π REPORT / EXPORT ROUTES
| METHOD | PATH | DESCRIPTION |
| ------ | ------------------------------ | ------------------------------------------ |
| GET | `/reports/user/:id/monthly` | Get a user's monthly earning report |
| GET | `/reports/project/:id/summary` | All payments/advances by project |
| GET | `/reports/export/:id/excel` | Export single user's transactions as Excel |
| GET | `/reports/export/:id/pdf` | Export payment proof as PDF |
---
## π§ BONUS: Optional Routes
| METHOD | PATH | DESCRIPTION |
| ------ | --------------------------- | ------------------------- |
| POST | `/users/:id/picture` | Upload profile picture |
| POST | `/projects/:id/assign-user` | Assign labor to a project |
| GET | `/dashboard` | Admin dashboard summary |
---
## π Access Control Rules (Summary)
| Role | Access Rights |
| ------- | ---------------------------------------------- |
| ADMIN | Everything |
| FOREMAN | Create/edit labors, payments, view own project |
| LABOR | No access (data-only user) |
---
Let me know if you want me to scaffold this in Express.js (with middleware, controllers, etc.), or if you're using Bun, I can tailor it to Bun/Next.js API routes too. Ready when you are π»π₯