FLIES is a full-stack web application built with React (Material UI) for the frontend and Go (Gin) for the backend. It provides authentication, role-based access control, and user management capabilities.
- React.js with Material UI
- React Router for navigation
- Axios for API requests
- JWT Authentication for secure access
- Go (Golang) for the backend API
- Gin Framework for routing and middleware
- GORM for database management
- PostgreSQL as the database
- JWT Authentication for secure user sessions
| Role | Permissions |
|---|---|
| User | View Profile |
| Admin | Manage Users, Change Roles, Delete Users (except Admins) |
git clone https://github.com/your-repo/user-management.git
cd user-management/backendgo mod tidyDATABASE_URL=your_postgres_connection_string
JWT_SECRET=your_secret_keygo run main.gocd ../frontendnpm installnpm startPOST /login- User login (returns JWT token)POST /register- Register a new user
GET /users- Get all usersPATCH /users/:id/role- Update user role (Admin cannot change their own role)DELETE /users/:id- Delete a user (Admins cannot be deleted)
GET /profile- Get current user profilePATCH /profile- Update user details
- JWT Storage: Stored in
localStoragefor persistence. - Token Expiry: Tokens expire after X hours (define if necessary).
- Role Protection: Admin roles cannot be modified or removed.
Contributions are welcome! Feel free to submit issues and pull requests.
- Fork the repository.
- Create a new branch (
git checkout -b feature-name). - Make your changes and commit (
git commit -m "Added new feature"). - Push to your branch (
git push origin feature-name). - Open a pull request.
📜 This project is licensed under the MIT License.