Node User Management is a RESTful application built with Node.js and MySQL for user registration, sign-up, login, and token management. It includes Swagger documentation for easy API reference.
- User Registration: Super admin can register new users via API (
/auth/register
). A randomly generated password is sent to the user's email. - User Sign-up: Users can sign up themselves via API (
/auth/sign-up
). - Login: Users can log in to the system via API (
/auth/login
). - Token Management: Refresh tokens are used for secure session management.
- Swagger Documentation: Explore and test APIs easily with Swagger UI.
-
Clone the repository
git clone https://github.com/seremwen/node-user-management.git cd node-user-management
-
Install dependencies
npm install
-
Database Setup
- Ensure MySQL is running.
- Create a new database for the application.
-
Start the server
Start the Node.js server:
node index.js
The server will start at
http://localhost:3000
(or another port as configured).
Explore the API endpoints and test them using Swagger UI. Access Swagger UI at:
http://localhost:3000/api-docs
- On system startup, a super admin is created automatically.
- Use the super admin credentials to access the
/auth/register
API for registering new users.
/middlewares
: Middleware functions./models
: Database models./routes
: Route definitions for different API endpoints.
Contributions are welcome! Fork the repository and submit a pull request.
This project is licensed under the MIT License - see the LICENSE file for details.