Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/diego64/api-from-academy

API whose main objective is to serve WEB applications focused on gyms so that owners can register their gyms and users can mark their presence always within a limit of 10 meters
https://github.com/diego64/api-from-academy

docker fastify nodejs postgresql prisma-orm solid vitest zod

Last synced: about 2 months ago
JSON representation

API whose main objective is to serve WEB applications focused on gyms so that owners can register their gyms and users can mark their presence always within a limit of 10 meters

Awesome Lists containing this project

README

        


Node Logo


Developed with the software and tools below.



Node
Fastify
Prisma
Zod
Vitest

## ๐Ÿ“ Overview

The application aims to be an API that allows the user to schedule their day at the gym and a gym to register its unit. Remembering that you need to have `Node.js` and `docker` installed on your machine.

The application has the following rules.

### ๐Ÿ”Œ RFs (Functional Requirements)

- [x] It must be possible to register;
- [x] It must be possible to authenticate;
- [x] It must be possible to obtain the profile of a logged-in user;
- [x] It must be possible to obtain the number of check-ins performed by the logged-in user;
- [x] The user must be able to obtain his/her check-in history;
- [x] The user must be able to search for nearby gyms (up to 10km);
- [x] The user must be able to search for gyms by name;
- [x] The user must be able to check-in at a gym;
- [x] It must be possible to validate a user's check-in;
- [x] It must be possible to register a gym;

### ๐Ÿ“ฆ RNs (Business Rules)

- [x] The user must not be able to register with a duplicate email;
- [x] The user cannot check-in twice on the same day; - [x] The user cannot check in if he/she is not close (100m) to the gym;
- [x] The check-in can only be validated up to 20 minutes after being created;
- [x] The check-in can only be validated by administrators;
- [x] The gym can only be registered by administrators;

### ๐Ÿงฉ NFRs (Non-functional Requirements)

- [x] The user's password must be encrypted;
- [x] The application data must be persisted in a PostgreSQL database;
- [x] All data lists must be paginated with 20 items per page;
- [x] The user must be identified by a JWT (JSON Web Token);

---

## ๐Ÿ—‚๏ธ Repository Structure

```sh
โ””โ”€โ”€ api-from-academy
โ”œโ”€โ”€ .img.shields.io
โ”œโ”€โ”€ prisma
โ”œโ”€โ”€ src
โ”œโ”€โ”€ .env.example
โ”œโ”€โ”€ .eslintignore
โ”œโ”€โ”€ .eslintrc.json
โ”œโ”€โ”€ docker-compose.yml
โ”œโ”€โ”€ LICENSE
```

---

### โš™๏ธ Installation

From source

> 1. Clone the repository:
>
> ```console
> $ git clone https://github.com/diego64/api-from-academy
> ```
>
> 2. Change to the project directory:
> ```console
> $ cd api-from-academy
> ```
>
> 3. Install the dependencies:
> ```console
> $ npm install
> ```
> 4. Install the database:
> ```console
> $ docker compose up -d
> ```
> 5. Generate the migrantios:
> ```console
> $ npx prisma migrate dev
> ```
> 6. Start the application:
> ```console
> $ npm run start:dev
> ```

### ๐Ÿงช Tests

> Run the functional tests using the command below:
> ```console
> $ npm run test
> ```
> Run E2E tests using the command below:
> ```console
> $ npm run test:e2e
> ```

---

## ๐Ÿ“„ License

This project is protected by the MIT License.

---