This project implements a simple User Management API using Node.js, Express.js, and MongoDB. It provides endpoints for creating, retrieving, and deleting users.
Before you begin, ensure you have the following installed on your machine:
-
Clone the repository:
git clone https://github.com/richardokonicha/soultrain.git
-
Navigate to the project directory:
cd user-management-api
-
Install dependencies:
npm install
-
Set up your MongoDB connection:
- Create a MongoDB database.
- Update the MongoDB connection URL in
db/conn.mjs
with your database information.
-
Run the application:
npm start
The API will be available at
http://localhost:5050
.
-
Clone the repository:
git clone https://github.com/richardokonicha/soultrain.git
-
Navigate to the project directory:
cd user-management-api
-
Set up your MongoDB connection:
- Create a MongoDB database.
- Update the MongoDB connection URL in
docker-compose.yml
with your database information.
-
Build and run the Docker containers:
docker-compose up --build
The API will be available at
http://localhost:5050
.
GET /users
: Get a list of all users.POST /users
: Create a new user.GET /users/:username
: Get user by username.DELETE /users/:username
: Delete user by username.GET /users/artist/:artistname
: Get user by artistname.DELETE /users/artist/:artistname
: Delete user by artistname.
To run tests, use the following command:
npm test
Follow the deployment instructions for your chosen method.
For detailed API documentation, refer to the Swagger documentation provided in the swagger.json
file.
http://localhost:5050/docs