πŸ“ Point of Interest

Linguagem mais utilizada Último commit
Preview

πŸš€ Introduction

Solution for the challenge at backend called point of interest. The requirements for the challenge can be found here

πŸ‘¨β€πŸ’» Technologies

  • Javascript/Typescript: Main programming language.
  • BunJs: Platform to run Javascript
  • SQlite: Relational database to store persistent data.
  • Fastify: Web framework for building APIs in NodeJS.
  • DrizzleORM: ORM (Object-Relational Mapping) for communication with the database.

πŸ—οΈ Design Patterns

The application follows the following design patterns:

  1. Clean Architecture: The project structure is organized in layers (entities, use cases, interfaces) to separate concerns and facilitate maintenance.

  2. Domain Driven Design (DDD): The software design is domain-oriented, focusing on business rules and main entities.

  3. Dependency Injection: Inversion of control and dependency injection are used to ensure code flexibility and testability.

  4. Automated Testing: Unit, integration and end-2-end tests are written to ensure code quality.

🎯 Main Features

  • Search registered points of interest
  • Registration of points of interest
  • Search for points of interest using filters such as coordinates and distance

πŸ”§ Running the project

To run this application, you need to have BunJs installed on your machine.

  • Run the command touch .env && cp .env.example .env to create environment variable files.
  • Run the command bun i to download the dependencies. You can use the package manager you prefer
  • Run the command bun db:migrate to apply the migrations to the database.
  • Run the command bun db:seed to populate the database with some initial data
  • Run the command bun dev to start the application.
  • Open the client.http file at the root of the project to call the http route that performs the operation. It is important to have the Rest Client extension installed in VsCode

πŸ§ͺ Tests

  • Run the command bun test to run the unit tests

✍🏽 Important learnings

  • How to Calculate Distances Between Points Using Mathematics
  • Build adapters for http layer decoupling with Fastify and controllers

πŸ§‘β€πŸ’» Possible improvements

  • Use another database to store the data like a Postgres
  • Add pipes for request data validation
  • Add dependency injection system to auto create the objects and inject them in the controllers

πŸ“„ License

This project is under the MIT license. Access the link LICENSE for more details.

🌐 GitHub

The source code of the application can be found on GitHub: Project Link

πŸ“§ Contact

In case of doubts or suggestions, contact us through the email: nito.ba.dev@gmail.com.