useraccessmanagement
Val Town is a collaborative website to build and scale JavaScript apps.
Deploy APIs, crons, & store data – all from the browser, and deployed in milliseconds.
A comprehensive system for managing user access to software applications with role-based permissions.
- User registration and authentication with JWT
- Role-based access control (Employee, Manager, Admin)
- Software listing and creation (Admin only)
- Access request submission (Employee)
- Request approval workflow (Manager)
- Backend: Node.js + Express.js
- Frontend: React
- Database: PostgreSQL
- ORM: TypeORM
- Authentication: JWT
- Other tools: bcrypt, dotenv, nodemon
├── backend/ # Node.js + Express backend
│ ├── src/
│ │ ├── controllers/ # Request handlers
│ │ ├── entities/ # TypeORM entities
│ │ ├── middleware/ # Auth and validation middleware
│ │ ├── routes/ # API routes
│ │ ├── services/ # Business logic
│ │ ├── utils/ # Helper functions
│ │ ├── app.ts # Express app setup
│ │ └── index.ts # Entry point
│ ├── .env.example # Environment variables template
│ ├── package.json # Dependencies
│ └── tsconfig.json # TypeScript configuration
├── frontend/ # React frontend
│ ├── public/ # Static assets
│ ├── src/
│ │ ├── components/ # Reusable UI components
│ │ ├── contexts/ # React contexts (Auth)
│ │ ├── pages/ # Page components
│ │ ├── services/ # API service functions
│ │ ├── types/ # TypeScript interfaces
│ │ ├── utils/ # Helper functions
│ │ ├── App.tsx # Main app component
│ │ └── index.tsx # Entry point
│ ├── package.json # Dependencies
│ └── tsconfig.json # TypeScript configuration
└── README.md # Project documentation
POST /api/auth/signup
- Register a new user (default role: Employee)POST /api/auth/login
- Authenticate and receive JWT
GET /api/software
- List all softwarePOST /api/software
- Create new softwareGET /api/software/:id
- Get software detailsPUT /api/software/:id
- Update softwareDELETE /api/software/:id
- Delete software
GET /api/requests
- List requests (filtered by role)POST /api/requests
- Submit new access request (Employee)PATCH /api/requests/:id
- Approve/reject request (Manager)DELETE /api/requests/:id
- Delete request
- Node.js (v14+)
- PostgreSQL
- npm or yarn
- Navigate to the backend directory:
cd backend
- Install dependencies:
npm install
- Copy
.env.example
to.env
and configure your environment variables - Run database migrations:
npm run migration:run
- Start the development server:
npm run dev
- Navigate to the frontend directory:
cd frontend
- Install dependencies:
npm install
- Start the development server:
npm start
- Employee: Can register, login, and request software access
- Manager: Can view and approve/reject access requests
- Admin: Can create and manage software, has full access to the system