Skip to content

clintonbrito/restful-api-ecommerce

Repository files navigation

RESTful API E-Commerce Project

This is a MVP e-commerce-like API developed from scratch. It allows you to manage users, clients, products and sales. The project follows the MVC architecture and includes user authentication with JWT.


🧪 Technologies

This project was developed using:

TypeScript AdonisJS JWT MySQL Docker ESLint


🚀 Getting started locally

Clone this repository to your local machine and access the cloned directory:

git clone git@github.com:clintonbrito/restful-api-ecommerce.git
cd restful-api-ecommerce

Run this command to create all the project's Docker containers and install the dependencies:

docker compose up -d --build

If you need to stop and remove the project's Docker containers, you can use the following command:

docker compose down

Check the docker logs using the command docker logs -f app which address is running the application and open your browser or any prefered API client in order to test the endpoints through the address below, for example:

http://127.0.0.1:3333

📖 API Documentation

Explore the API documentation to understand the available endpoints, request parameters, and responses. The documentation is built using Bruno 🐶, a fast and Git-friendly Opensource API client, which also provides an interactive and user-friendly interface.

Accessing API Documentation

  1. Run the Application: Make sure the application is running locally. Follow the Getting Started section for instructions on starting the application.

  2. Feel free to give a try to Bruno and download it: Check out the Download page and follow the instructions.

  3. Open Bruno Desktop App: Once the application Docker containers are running ok, you can access the Bruno Desktop App.

API Documentation

  1. Explore Endpoints: In the Bruno Desktop App, you just need to import /docs/Ecommerce API collection folder and voilà: you'll find a list of available endpoints along with details about request parameters. Use this interface to understand how to interact with the API. The base URL of the API which you should use as an environment variable on Bruno is the following:

    http://127.0.0.1:3333

API Documentation

Feel free to explore and test the API directly any other API client you prefer. If you encounter any issues or have questions, refer to the Issues section for support.


🔭 Future features

For future features, I intend to include:

  1. Unit testing with a high code coverage;
  2. Date filtering for sales;
  3. Improve user authentication and authorization policy;
  4. Use Auth as a middleware instead of manually checking JWT credentials;
  5. Separate business logic in service layer;
  6. Work on better DTOs;
  7. Deploy the project on a cloud service.

🎨 Development Patterns

Commit Patterns

Conventional Commits Gitmoji

This project adopts Gitmoji and the commit convention known as Conventional Commits. This means that we follow a standardized format for our commit messages, making it easier to generate changelogs and adopt semantic versioning.

Example commit messages format:

feat: add login functionality
fix: resolve issue with user registration
wip: connecting back-end to front-end

Branch Patterns

The branches in this project follow a specific pattern to facilitate organization and understanding of ongoing development. Some of the common prefixes used include feature/, bugfix/, docs/:

Example branch names:

feature/docker-setup
bugfix/eslint-errors
docs/update-readme

📝 License

This project is licensed under the MIT License. See the LICENSE file for details.

About

This repository contains the backend challenge project for a job application. It is a RESTful API built with AdonisJS (Node.js) and MySQL for managing users, clients, products, and sales. The project follows the MVC architecture and includes user authentication with JWT.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors