Loading repository dataβ¦
Loading repository dataβ¦
abdulkashim444-lgtm / repository
π‘οΈ Secure REST API & Developer Dashboard is a production-ready platform featuring JWT authentication, RBAC/ABAC authorization, secure REST APIs, PostgreSQL, real-time monitoring, API sandbox, telemetry analytics, task management, and a modern React dashboard built with Node.js & TypeScript. ππ
A transparent discovery signal based on current public GitHub metadata.
This score does not audit code, security, maintainers, documentation quality, or suitability. Verify the repository and its current documentation before adoption.
An enterprise-grade REST API submission designed for the Backend Developer (Intern) Assignment at Primetrade.ai.
This system demonstrates safe cryptographic password hashing, custom JSON Web Token (JWT) verification, robust Role-Based Access Control (RBAC), fine-grained Attribute-Based Access Control (ABAC), live backend telemetry metrics, and a fully interactive Swagger-style Client Sandbox directly in the UI.
bcryptjs with standard salts (10 iterations) to securely digest credentials prior to database registration.HS256 signatures (jsonwebtoken), configuring expiration timers for enhanced session control.POST /api/v1/auth/register (Public) - Create developer profiles. Supports specifying roles in development sandbox.POST /api/v1/auth/login (Public) - Authenticate credentials and acquire short-lived bearer keys.GET /api/v1/auth/me (Protected) - Decode, verify, and output the active authenticated session context.user and admin.GET /api/v1/auth/users (Protected, Admin Only) - List full registered user profiles.PATCH /api/v1/auth/users/:id/role (Protected, Admin Only) - Real-time role modifications (promote/demote standard users) with lockout protection constraints.TODOIN_PROGRESS403 ForbiddenGET /api/v1/health - Health metrics, Node process runtimes, and exact RAM footprint logs.GET /api/v1/stats - Compiles success rates, error counts, response latencies, and transaction metrics.tsx (for direct TS execution in dev), esbuild (to bundle CJS for server production), Vite v6./data/db.json with safety caches and pre-seeded developer credentials.| Method | Endpoint | Access | Body Parameters | Response |
|---|---|---|---|---|
POST | /api/v1/auth/register | Public | username, password, role (optional) | { success: true, message: string, data: { token: string, user: Object } } |
POST | /api/v1/auth/login | Public | username, password | { success: true, message: string, data: { token: string, user: Object } } |
GET | /api/v1/auth/me | Protected | None (Bearer Token in Header) | { success: true, data: { user: Object } } |
GET | /api/v1/auth/users | Admin Only | None (Bearer Token in Header) | { success: true, data: { users: Array } } |
PATCH | /api/v1/auth/users/:id/role | Admin Only | role ('user' or 'admin') | { success: true, message: string, data: { user: Object } } |
| Method | Endpoint | Access | Body Parameters | Response |
|---|---|---|---|---|
GET | /api/v1/tasks | Protected | None | { success: true, data: { tasks: Array, totalCount: number } } |
GET | /api/v1/tasks/:id | Protected | None | { success: true, data: { task: Object } } |
POST | /api/v1/tasks | Protected | title, description (opt), priority (opt), status (opt), assignedTo (opt) | { success: true, message: string, data: { task: Object } } |
PUT | /api/v1/tasks/:id | Protected | title, description, priority, status, assignedTo | { success: true, message: string, data: { task: Object } } |
DELETE | /api/v1/tasks/:id | Protected | None | { success: true, message: string } |
To run this project locally, ensure you have Node.js (v18+) installed.
Install Dependencies:
npm install
Boot Development Server:
npm run dev
The application dev environment is mounted at http://localhost:3000 with HMR and hot TypeScript compiling.
Build Production Assets:
npm run build
Compiles static HTML/React bundles and packages the Express backend into a standalone file dist/server.cjs via esbuild.
Launch Standalone Production Server:
npm run start
A brief note on how we transition this lightweight sandboxed architecture into a system supporting millions of active connections:
HttpOnly, SameSite=Strict cookies. Maintain a globally distributed Redis cluster to manage token blacklists and active user-session caches.PgBouncer to pool database connections, preventing connection exhaustion under heavy load spikes.