A robust and extensible RESTful API built with Node.js, Express, and MongoDB Atlas. Supports full CRUD operations with JWT-based authentication.
π This project is part of my return-to-tech portfolio, demonstrating hands-on expertise in API development and performance testing. I welcome feedback and collaboration opportunities!
- About the Project
- Designed for Performance Testing
- Why this Project?
- Technologies Used
- API Overview
- API Endpoints
- Environment Variables
- Postman Collection
- How to Run Locally
- Swagger
- Performance Test Plan
- Contributing or Feedback
- Usage and Credit Notice
- Application Deployment on AWS using Docker, Terraform, and EKS
- Injection Machine - EC2 Creation
- Accessing EC2 via FileZilla (SFTP)
- Configuring MobaXterm to access EC2 as terminal
- Configure JMeter on injection machine
- Configure InfluxDB on injection machine
- Configure Grafana on injection machine
- Configure Prometheus on injection machine
- Configure Node Exporter on injection machine
- Using NGINX Reverse Proxy to Secure Prometheus, Node Exporter, InfluxDB and Grafana
- Grafana Dashboards
- Create JMeter scripts
- Create a GitHub Actions and/or Jenkins pipeline to JMeter scripts and to start/shutdown injection machine at EC2
- Configure and install Dynatrace
- Execute JMeter scripts
- Collect results and screenshots
- Write test report summarizing results and insights
- Create shell scripts to: EC2 creation, install: Java, JMeter, Influx, Prometheus and Grafana
This API was created specifically to practice performance testing using tools like Apache JMeter, K6, and Gatling
Features include:
- Dynamic data handling
- Realistic user scenarios
- JWT-based authentication
- Complete CRUD functionality
This project was developed as a hands-on exercise to practice and validate performance testing techniques using tools like JMeter. It simulates real-world operations like authentication, CRUD operations β providing a rich environment for designing, executing, and analyzing load and stress test scenarios.
- Node.js + Express
- MongoDB Atlas (cloud-hosted database)
- JSON Web Tokens (JWT)
- bcryptjs (password hashing)
- dotenv (environment config)
- Postman for testing
All protected routes require a JWT sent in the Authorization
header as Bearer <token>
.
Create a user with a username and password.
{
"username": "admin",
"password": "password"
}
Authenticate with username and password.
Returns a JWT token.
Request Body:
{
"username": "admin",
"password": "password"
}
Description: Creates a new item. Authentication: Requires JWT.
Request Body:
{
"name": "New Item",
"description": "Optional description"
}
Response:
{
"_id": "generated_id",
"name": "New Item",
"description": "Optional description"
}
Description: Retrieves all items.
Authentication: Requires JWT.
Response:
{
"_id": "item_id",
"name": "Item Name",
"description": "Item description"
}
Description: Retrieves a specific item by ID.
Authentication: Requires JWT.
Response:
{
"_id": "item_id",
"name": "Item Name",
"description": "Item description"
}
Description: Updates the item's name and/or description. Authentication: Requires JWT.
Request Body:
{
"name": "Updated Name",
"description": "Updated description"
}
Description: Deletes an item by ID. Authentication: Requires JWT.
Response: 204 No Content on success.
Create a .env file in the root of the project with the following content:
PORT=3000
MONGO_URI=mongodb+srv://<username>:<password>@cluster0.mongodb.net/robust-api?retryWrites=true&w=majority
JWT_SECRET=your_jwt_secret
JWT_EXPIRES_IN=1h
Use the collection below to quickly test the API endpoints with JWT authentication and pre-configured examples:
π¦ π₯ Download robust-api-postman-collection.json
Inside the project's folder, run in command line
node server.js
The result will be
- Run the application locally with the command: node server.js
- Add a new browser tab and access: http://localhost:3001/api-docs
This project is part of my personal learning journey in performance engineering. Feedback, suggestions, or connections are always welcome!
π§ Contact me via LinkedIn or GitHub Discussions.
To help strengthen our community, I would appreciate it if you could mention my GitHub and LinkedIn when using this material.