🇺🇸 English |
🇧🇷 Português |
ERD | Technologies | About | Routes | Plugins | Cloning | Contact
- Prisma
- Prisma Erd Generator
- Short Unique Id
- Typescript
- @mermaid-js/mermaid-cli
- Fastify
- @fastify/jwt
- Zod
- NodeJS
- npm
This project is the Copa API, which is, in short, a world cup themed application that performs the registration and management of pools, games and users, developed during the Ignite trail of the NLW Copa of Rocketseat.
This API is the basis for its Web interface developed essentially with NextJS, and Mobile primarily developed with React Native.
-
GET /me
: This route returns information about the user. -
POST /users
: This is responsible for creating/authenticating a user by google, filling it with the following information received from google and validated withzod
. Your schema is:{ id: z.string(), email: z.string().email(), name: z.string(), picture: z.string().url() }
-
GET /pools/:id/games
: Based on theid
sent, this route lists all games related to the given pool. -
GET /guesses/count
: This route returns the total number of guesses made. -
POST /pools/:poolId/games/:gameId/guesses
: Based on theid
parameters in thefirstTeamPoints
andsecondTeamPoints
values sent by the body, this route creates a guess for the given game at the given pool with the values received. -
GET /pools/count
: This route returns the total pools created. -
POST /pools
: Based on thetitle
sent bybody
, this route creates a pool with the given title, and generates itscode
automatically with the help ofshort-unique-id
. -
POST /pools/join
: Based on thecode
sent bybody
, this route allows a given user to become a participant in a given pool. -
GET /pools
: This route returns the first 4 pools it finds. -
GET /pools/:id
: Based on theid
sent, this route returns information about a given pool. -
GET /users/count
: Returns the total number of registered users.
authenticate
: Its function is to perform user verification/validation with JWT.
To clone and run this project on your computer you will need Git, Node.js v18.12.0 or higher, and preferably an API Client such as Insomnia (it can also be accessed through the browser, but with limited functionalities) previously installed.
In the terminal:
# Clone this repository with:
> git clone https://github.com/Luk4x/copa-server.git
# Enter the repository with:
> cd copa-server
# Install dependencies with:
> npm install
# Run the project with:
> npm run dev
# Once this is done, you will be able to access the project through the link that will appear in the terminal! (something like http://localhost:3333/ or http://0.0.0.0:3333/)
Vitrine.Dev 🪟
|
Lucas Maciel
|