{"id":28908407,"url":"https://github.com/smartcraze/surajenterprises.work","last_synced_at":"2025-06-30T19:32:37.076Z","repository":{"id":295439767,"uuid":"986467015","full_name":"smartcraze/surajenterprises.work","owner":"smartcraze","description":"Suraj Enterprises","archived":false,"fork":false,"pushed_at":"2025-06-18T13:19:40.000Z","size":34852,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-06-18T14:24:57.129Z","etag":null,"topics":["cms","construction-company","contractor","cotractor","enterprises","management","suraj","system"],"latest_commit_sha":null,"homepage":"https://surajenterprises.work","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/smartcraze.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2025-05-19T16:47:13.000Z","updated_at":"2025-06-18T13:19:44.000Z","dependencies_parsed_at":"2025-05-25T15:46:43.030Z","dependency_job_id":"01a397a5-0109-42da-ba28-633ba20a7c0b","html_url":"https://github.com/smartcraze/surajenterprises.work","commit_stats":null,"previous_names":["smartcraze/cms-surajconstructions","smartcraze/surajenterprises.work"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/smartcraze/surajenterprises.work","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/smartcraze%2Fsurajenterprises.work","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/smartcraze%2Fsurajenterprises.work/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/smartcraze%2Fsurajenterprises.work/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/smartcraze%2Fsurajenterprises.work/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/smartcraze","download_url":"https://codeload.github.com/smartcraze/surajenterprises.work/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/smartcraze%2Fsurajenterprises.work/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":261153727,"owners_count":23116921,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["cms","construction-company","contractor","cotractor","enterprises","management","suraj","system"],"created_at":"2025-06-21T16:09:20.822Z","updated_at":"2025-06-30T19:32:37.063Z","avatar_url":"https://github.com/smartcraze.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"Absolutely Suraj bhai 💪 — let’s plan all the **main routes** (API endpoints) you'll need for your **Contractor Management System**.\n\nWe're keeping things clean, modular, and ready for scale 🔥\nThis will be organized into **Auth**, **Users**, **Projects**, **Transactions**, and **Reports**.\n\n\ndocker volume create postgres_data \u0026\u0026 docker run -d --name postgres -v postgres_data:/var/lib/postgresql/data -e POSTGRES_PASSWORD=postgres -p 5432:5432 postgres:latest\n\n---\n\n## 🛡️ AUTH ROUTES\n\n| METHOD | PATH           | DESCRIPTION                        |\n| ------ | -------------- | ---------------------------------- |\n| POST   | `/auth/signup` | Admin/Foreman registration         |\n| POST   | `/auth/login`  | Admin/Foreman login (phone + pass) |\n| POST   | `/auth/logout` | Logout (if using sessions/cookies) |\n| GET    | `/auth/me`     | Get logged-in user info            |\n\n---\n\n## 👤 USER ROUTES (Labors, Foremen, Admins, etc.)\n\n| METHOD | PATH         | DESCRIPTION                          |\n| ------ | ------------ | ------------------------------------ |\n| GET    | `/users`     | List all users (with roles)          |\n| POST   | `/users`     | Create a user (LABOR, FOREMAN, etc.) |\n| GET    | `/users/:id` | Get single user detail               |\n| PUT    | `/users/:id` | Update user (rate, phone, etc.)      |\n| DELETE | `/users/:id` | Remove user                          |\n\n✅ You can filter `?role=LABOR` etc., if needed\n✅ Only Admin/Foreman should access these\n\n---\n\n## 🏗️ PROJECT ROUTES\n\n| METHOD | PATH            | DESCRIPTION                       |\n| ------ | --------------- | --------------------------------- |\n| GET    | `/projects`     | List all projects                 |\n| POST   | `/projects`     | Create a new project              |\n| GET    | `/projects/:id` | Project detail + associated users |\n| PUT    | `/projects/:id` | Update project info               |\n| DELETE | `/projects/:id` | Delete a project                  |\n\n---\n\n## 💸 TRANSACTION ROUTES\n\n| METHOD | PATH                | DESCRIPTION                                    |\n| ------ | ------------------- | ---------------------------------------------- |\n| GET    | `/transactions`     | All transactions (filter by type/user/project) |\n| POST   | `/transactions`     | Create transaction (advance, payment, etc.)    |\n| GET    | `/transactions/:id` | Get specific transaction                       |\n| PUT    | `/transactions/:id` | Edit transaction                               |\n| DELETE | `/transactions/:id` | Delete transaction                             |\n\n\u003e 💡 Filter with query params like `?userId=xyz\u0026type=PAYMENT\u0026projectId=abc`\n\n---\n\n## 📊 REPORT / EXPORT ROUTES\n\n| METHOD | PATH                           | DESCRIPTION                                |\n| ------ | ------------------------------ | ------------------------------------------ |\n| GET    | `/reports/user/:id/monthly`    | Get a user's monthly earning report        |\n| GET    | `/reports/project/:id/summary` | All payments/advances by project           |\n| GET    | `/reports/export/:id/excel`    | Export single user's transactions as Excel |\n| GET    | `/reports/export/:id/pdf`      | Export payment proof as PDF                |\n\n---\n\n## 🧠 BONUS: Optional Routes\n\n| METHOD | PATH                        | DESCRIPTION               |\n| ------ | --------------------------- | ------------------------- |\n| POST   | `/users/:id/picture`        | Upload profile picture    |\n| POST   | `/projects/:id/assign-user` | Assign labor to a project |\n| GET    | `/dashboard`                | Admin dashboard summary   |\n\n---\n\n## 🔐 Access Control Rules (Summary)\n\n| Role    | Access Rights                                  |\n| ------- | ---------------------------------------------- |\n| ADMIN   | Everything                                     |\n| FOREMAN | Create/edit labors, payments, view own project |\n| LABOR   | No access (data-only user)                     |\n\n---\n\nLet 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 💻🔥\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsmartcraze%2Fsurajenterprises.work","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsmartcraze%2Fsurajenterprises.work","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsmartcraze%2Fsurajenterprises.work/lists"}