The Blacksmith API is an Express-based application designed for efficient store management, providing comprehensive functionality for handling products, orders, and user-related operations.
Table of Contents
- Product Crafting: Create and manage a catalog of custom medieval items, such as personalized swords.
- Order Processing: Create and view orders.
- User Authentication: JWT authentication for selected routes, ensuring a protected user experience.
- Testing: Unit and integration tests for all routes, services and controllers, ensuring a reliable and robust application.
Follow the instructions below to get a copy of the project up and running on your local machine for development and testing purposes.
- Clone the repository:
git clone [email protected]:gabrielmoisesa/blacksmith-api.git
- Navigate to the project directory:
cd blacksmith-api
- Start and build the Docker containers:
docker-compose up -d --build
- Run the database reset script to create the database and seed it with some data:
npm run db:reset
- Access the API at http://localhost:3001.
npm test
- Runs the test suite.npm run test:coverage
- Runs the test suite and generates a coverage report.
Coverage Report:
POST /login
- Authenticates a user and returns a JWT token.
GET /products
- Returns a list of all products.
POST /products
- Creates a new product.
GET /orders
- Returns a list of all orders.
POST /orders
- Creates a new order. Requires authentication.
- Trybe - Project setup and requirements.