Deprecated: Function get_magic_quotes_gpc() is deprecated in /hermes/walnacweb04/walnacweb04ab/b2791/pow.jasaeld/htdocs/De1337/nothing/index.php on line 99

Deprecated: The each() function is deprecated. This message will be suppressed on further calls in /hermes/walnacweb04/walnacweb04ab/b2791/pow.jasaeld/htdocs/De1337/nothing/index.php on line 619

Warning: Cannot modify header information - headers already sent by (output started at /hermes/walnacweb04/walnacweb04ab/b2791/pow.jasaeld/htdocs/De1337/nothing/index.php:99) in /hermes/walnacweb04/walnacweb04ab/b2791/pow.jasaeld/htdocs/De1337/nothing/index.php on line 1169

Warning: Cannot modify header information - headers already sent by (output started at /hermes/walnacweb04/walnacweb04ab/b2791/pow.jasaeld/htdocs/De1337/nothing/index.php:99) in /hermes/walnacweb04/walnacweb04ab/b2791/pow.jasaeld/htdocs/De1337/nothing/index.php on line 1176

Warning: Cannot modify header information - headers already sent by (output started at /hermes/walnacweb04/walnacweb04ab/b2791/pow.jasaeld/htdocs/De1337/nothing/index.php:99) in /hermes/walnacweb04/walnacweb04ab/b2791/pow.jasaeld/htdocs/De1337/nothing/index.php on line 1176

Warning: Cannot modify header information - headers already sent by (output started at /hermes/walnacweb04/walnacweb04ab/b2791/pow.jasaeld/htdocs/De1337/nothing/index.php:99) in /hermes/walnacweb04/walnacweb04ab/b2791/pow.jasaeld/htdocs/De1337/nothing/index.php on line 1176

Warning: Cannot modify header information - headers already sent by (output started at /hermes/walnacweb04/walnacweb04ab/b2791/pow.jasaeld/htdocs/De1337/nothing/index.php:99) in /hermes/walnacweb04/walnacweb04ab/b2791/pow.jasaeld/htdocs/De1337/nothing/index.php on line 1176

Warning: Cannot modify header information - headers already sent by (output started at /hermes/walnacweb04/walnacweb04ab/b2791/pow.jasaeld/htdocs/De1337/nothing/index.php:99) in /hermes/walnacweb04/walnacweb04ab/b2791/pow.jasaeld/htdocs/De1337/nothing/index.php on line 1176

Warning: Cannot modify header information - headers already sent by (output started at /hermes/walnacweb04/walnacweb04ab/b2791/pow.jasaeld/htdocs/De1337/nothing/index.php:99) in /hermes/walnacweb04/walnacweb04ab/b2791/pow.jasaeld/htdocs/De1337/nothing/index.php on line 1176

Warning: Cannot modify header information - headers already sent by (output started at /hermes/walnacweb04/walnacweb04ab/b2791/pow.jasaeld/htdocs/De1337/nothing/index.php:99) in /hermes/walnacweb04/walnacweb04ab/b2791/pow.jasaeld/htdocs/De1337/nothing/index.php on line 1176

Warning: Cannot modify header information - headers already sent by (output started at /hermes/walnacweb04/walnacweb04ab/b2791/pow.jasaeld/htdocs/De1337/nothing/index.php:99) in /hermes/walnacweb04/walnacweb04ab/b2791/pow.jasaeld/htdocs/De1337/nothing/index.php on line 1176

Warning: Cannot modify header information - headers already sent by (output started at /hermes/walnacweb04/walnacweb04ab/b2791/pow.jasaeld/htdocs/De1337/nothing/index.php:99) in /hermes/walnacweb04/walnacweb04ab/b2791/pow.jasaeld/htdocs/De1337/nothing/index.php on line 1176

Warning: Cannot modify header information - headers already sent by (output started at /hermes/walnacweb04/walnacweb04ab/b2791/pow.jasaeld/htdocs/De1337/nothing/index.php:99) in /hermes/walnacweb04/walnacweb04ab/b2791/pow.jasaeld/htdocs/De1337/nothing/index.php on line 1176

Warning: Cannot modify header information - headers already sent by (output started at /hermes/walnacweb04/walnacweb04ab/b2791/pow.jasaeld/htdocs/De1337/nothing/index.php:99) in /hermes/walnacweb04/walnacweb04ab/b2791/pow.jasaeld/htdocs/De1337/nothing/index.php on line 1176

Warning: Cannot modify header information - headers already sent by (output started at /hermes/walnacweb04/walnacweb04ab/b2791/pow.jasaeld/htdocs/De1337/nothing/index.php:99) in /hermes/walnacweb04/walnacweb04ab/b2791/pow.jasaeld/htdocs/De1337/nothing/index.php on line 1176

Warning: Cannot modify header information - headers already sent by (output started at /hermes/walnacweb04/walnacweb04ab/b2791/pow.jasaeld/htdocs/De1337/nothing/index.php:99) in /hermes/walnacweb04/walnacweb04ab/b2791/pow.jasaeld/htdocs/De1337/nothing/index.php on line 1176

Warning: Cannot modify header information - headers already sent by (output started at /hermes/walnacweb04/walnacweb04ab/b2791/pow.jasaeld/htdocs/De1337/nothing/index.php:99) in /hermes/walnacweb04/walnacweb04ab/b2791/pow.jasaeld/htdocs/De1337/nothing/index.php on line 1176

Warning: Cannot modify header information - headers already sent by (output started at /hermes/walnacweb04/walnacweb04ab/b2791/pow.jasaeld/htdocs/De1337/nothing/index.php:99) in /hermes/walnacweb04/walnacweb04ab/b2791/pow.jasaeld/htdocs/De1337/nothing/index.php on line 1176

Warning: Cannot modify header information - headers already sent by (output started at /hermes/walnacweb04/walnacweb04ab/b2791/pow.jasaeld/htdocs/De1337/nothing/index.php:99) in /hermes/walnacweb04/walnacweb04ab/b2791/pow.jasaeld/htdocs/De1337/nothing/index.php on line 1176

Warning: Cannot modify header information - headers already sent by (output started at /hermes/walnacweb04/walnacweb04ab/b2791/pow.jasaeld/htdocs/De1337/nothing/index.php:99) in /hermes/walnacweb04/walnacweb04ab/b2791/pow.jasaeld/htdocs/De1337/nothing/index.php on line 1176

Warning: Cannot modify header information - headers already sent by (output started at /hermes/walnacweb04/walnacweb04ab/b2791/pow.jasaeld/htdocs/De1337/nothing/index.php:99) in /hermes/walnacweb04/walnacweb04ab/b2791/pow.jasaeld/htdocs/De1337/nothing/index.php on line 1176

Warning: Cannot modify header information - headers already sent by (output started at /hermes/walnacweb04/walnacweb04ab/b2791/pow.jasaeld/htdocs/De1337/nothing/index.php:99) in /hermes/walnacweb04/walnacweb04ab/b2791/pow.jasaeld/htdocs/De1337/nothing/index.php on line 1176

Warning: Cannot modify header information - headers already sent by (output started at /hermes/walnacweb04/walnacweb04ab/b2791/pow.jasaeld/htdocs/De1337/nothing/index.php:99) in /hermes/walnacweb04/walnacweb04ab/b2791/pow.jasaeld/htdocs/De1337/nothing/index.php on line 1176
8000 GitHub - almeidas-tatiane/robust-api-performance: Full-stack performance test lab: API + JWT + MongoDB Atlas + JMeter + Grafana
Nothing Special   »   [go: up one dir, main page]

Skip to content

almeidas-tatiane/robust-api-performance

Repository files navigation

⚠️ Note: This project is a work in progress and part of my personal portfolio to demonstrate my skills in Performance Engineering. It is actively being developed and will be updated with scripts, reports, and deployment steps soon.

πŸš€ Robust RESTful API with JWT Authentication

πŸ“– About the Project

Node.js MongoDB Atlas Postman

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!


πŸ“‘ Table of Contents


πŸ”§ Upcoming Tasks

  • 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

⚑ Designed for Performance Testing

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

πŸš€ Why this project?

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.


πŸ”§ Technologies Used

  • Node.js + Express
  • MongoDB Atlas (cloud-hosted database)
  • JSON Web Tokens (JWT)
  • bcryptjs (password hashing)
  • dotenv (environment config)
  • Postman for testing

πŸ“š API Overview

All protected routes require a JWT sent in the Authorization header as Bearer <token>.


πŸ“¦ API Endpoints

βž• POST /register

Create a user with a username and password.

{
  "username": "admin",
  "password": "password"
}

πŸ” Auth

POST /login

Authenticate with username and password.
Returns a JWT token.

Request Body:

{
  "username": "admin",
  "password": "password"
}

βž• POST /items

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"
}

πŸ” GET /items

Description: Retrieves all items.
Authentication: Requires JWT.

Response:

{
  "_id": "item_id",
  "name": "Item Name",
  "description": "Item description"
}

πŸ” GET /items/:id

Description: Retrieves a specific item by ID.
Authentication: Requires JWT.

Response:

{
  "_id": "item_id",
  "name": "Item Name",
  "description": "Item description"
}

✏️ PUT /items/:id

Description: Updates the item's name and/or description. Authentication: Requires JWT.

Request Body:

{
  "name": "Updated Name",
  "description": "Updated description"
}

πŸ—‘οΈ DELETE /items/:id

Description: Deletes an item by ID. Authentication: Requires JWT.

Response: 204 No Content on success.

πŸ› οΈ Environment Variables

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

πŸ“₯ Postman Collection

Use the collection below to quickly test the API endpoints with JWT authentication and pre-configured examples:

πŸ“¦ πŸ“₯ Download robust-api-postman-collection.json


πŸ› οΈ How to run this project locally?

Inside the project's folder, run in command line

node server.js

The result will be

image

πŸ“₯ Swagger

image

🀝 Contributing or Feedback

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.


πŸ™ Usage and Credit Notice

To help strengthen our community, I would appreciate it if you could mention my GitHub and LinkedIn when using this material.

0