An authentication and authorization system with role-based access control.
This project provides User and Admin functionalities with a clean UI and secure backend integration.
Register & Login with PostgreSQL
- Role-based access control:
- User: view own account (read-only)
- Admin: view, create, edit, and delete accounts
- Postman for API testing
- Figma for design
- Built with React Vite (frontend) and Express TypeScript (backend)
- Frontend: React Vite, TailwindCSS, Toaster
- Backend: Express (TypeScript), PostgreSQL, JWT
- Tools: Postman, Figma
-
- Backend (Express + PostgreSQL)
- Integration with frontend
-
- Full Figma design
- Majority of frontend implementation
.
βββ backend/ # Express + TypeScript + PostgreSQL
βββ frontend/ # React Vite + Tailwind
βββ README.md- Node.js (v18+)
- PostgreSQL installed and running
cd backend
npm install
npm run devcd frontend
npm install
npm run dev- Create a PostgreSQL database
- Update DB credentials in backend config
- Register as user or admin
- Login with your credentials
- Access is based on role:
- User β view personal account only
- Admin β manage all accounts (CRUD)
- Design Figma
| Method | Endpoint | Description |
|---|---|---|
| POST | /auth/register |
Register new user |
| POST | /auth/login |
Login (user/admin) |
| GET | /admin/users |
Admin: view all users |
| POST | /admin/users |
Admin: create user |
| POST | /admin/create-admin |
Admin: create admin |
| PUT | /admin/users/{id} |
Admin: edit user |
| DELETE | /admin/users/{id} |
Admin: delete user |