User API v5 is a Node.js RESTful API designed to manage user data. It allows clients to perform CRUD operations and authentication.
- User Registration: Create a new user account.
- User Authentication: Authenticate users and receive a JWT token.
- User Retrieval: Fetch individual or all user details.
- User Update: Update existing user information.
- User Deletion: Remove user accounts from the system.
To get the API up and running:
-
Clone the repository:
git clone https://github.com/Gords/user-api-v5 cd user-api-v5
-
Install dependencies:
npm i
-
Start the dockerized Postgres Database
docker compose up -d
-
Start the application:
npm start
The API will now be accessible at http://localhost:3000
.
Register a new user.
Authenticate a user and receive a JWT.
Retrieve a list of all users (needs the JWT token to be send as a Bearer Token).
Fetch details of a specific user (needs the JWT token to be send as a Bearer Token).
Update a user's information (needs the JWT token to be send as a Bearer Token).
Remove a user from the system (needs the JWT token to be send as a Bearer Token).
- TypeScript: For type-safe JavaScript development.
- Node.js & Express: For backend development.
- TypeORM: As an ORM tool for database interaction.
- PostgreSQL: As the database.
- JWT: For user authentication.
- Jest: For testing.
- Morgan: For HTTP request logging.
- Nodemon: For automatic server restarts during development.
- Docker: For containerization and deployment of the database.
- Bcrypt: For secure password hashing and storage.
- Dotenv: For managing environment variables.
Run automated tests with:
npm test
Licensed under the MIT License.