Initialized Project with default middlewares and helpers, connected to Atlas Instance and created Swagger Setup. Created necessary DB models and authentication-authorization logic

This commit is contained in:
Shibi Chakkaravarthy
2026-04-15 02:28:35 +05:30
commit 864e5fae65
71 changed files with 8184 additions and 0 deletions
+43
View File
@@ -0,0 +1,43 @@
import { Router } from "express";
import { authorize } from "../middlewares/jwt.middleware";
import {
createAccessController,
getAllBranchesController,
getAllDesignationsController,
getAllDepartmentsController,
getAllRolesController,
createBranchController,
createDepartmentController,
createDesignationController,
createRoleController,
} from "../controllers/admin.controller";
const router = new Router();
router.post("/access", authorize("access", "write"), createAccessController);
router.get("/branches", authorize("branch", "read"), getAllBranchesController);
router.get(
"/designations",
authorize("designation", "read"),
getAllDesignationsController,
);
router.get(
"/departments",
authorize("department", "read"),
getAllDepartmentsController,
);
router.get("/roles", authorize("role", "read"), getAllRolesController);
router.post("/branch", authorize("branch", "write"), createBranchController);
router.post(
"/department",
authorize("department", "write"),
createDepartmentController,
);
router.post(
"/designation",
authorize("designation", "write"),
createDesignationController,
);
router.post("/role", authorize("role", "write"), createRoleController);
export default router;
+3
View File
@@ -0,0 +1,3 @@
export { default as UserRoutes } from "./user.route";
export { default as ProfileRoutes } from "./profile.route";
export { default as AdminRoutes } from "./admin.route";
+17
View File
@@ -0,0 +1,17 @@
import { Router } from "express";
import {
createOrEditProfileController,
getProfileController,
} from "../controllers/profile.controller";
import { authorize } from "../middlewares/jwt.middleware";
const router = new Router();
router.post(
"/",
authorize("generic", "generic"),
createOrEditProfileController,
);
router.get("/", authorize("generic", "generic"), getProfileController);
export default router;
+14
View File
@@ -0,0 +1,14 @@
import { Router } from "express";
import {
createUserController,
loginController,
renewAccessTokenController,
} from "../controllers/user.controller";
const router = new Router();
router.post("/create", createUserController);
router.post("/login", loginController);
router.post("/token/renew", renewAccessTokenController);
export default router;