Skip to content

Latest commit

 

History

History
146 lines (114 loc) · 5.56 KB

readme-en.md

File metadata and controls

146 lines (114 loc) · 5.56 KB
🇺🇸 English
🇧🇷 Português

luk4x-repo-status luk4x-repo-license

⚽ Copa Project API


ERD   |    Technologies   |    About   |    Routes   |    Plugins   |    Cloning   |    Contact


🌳 ERD

prisma erd image

🚀 Technologies Used

📝 About

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.

📃 Routes and Examples

  • 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 with zod. Your schema is:

    {
        id: z.string(),
        email: z.string().email(),
        name: z.string(),
        picture: z.string().url()
    }
  • GET /pools/:id/games: Based on the id 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 the id parameters in the firstTeamPoints and secondTeamPoints 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 the title sent by body, this route creates a pool with the given title, and generates its code automatically with the help of short-unique-id.

  • POST /pools/join: Based on the code sent by body, 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 the id sent, this route returns information about a given pool.

  • GET /users/count: Returns the total number of registered users.

🔑 Plugins

  • authenticate: Its function is to perform user verification/validation with JWT.

📖 Cloning the Project

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/)

🤝 Contributor Contact

Vitrine.Dev 🪟
Luk4x Github Photo
Lucas Maciel
🪧 Vitrine.Dev Lucas Maciel
✨ Name ⚽ Copa API
🏷️ Technologies nodejs, prisma, typescript, prisma erd generator, short unique id, fastify, mermaid-js, jwt, zod, npm
📷 Img vitrine.dev thumb

Back to Top