Skip to content

This repository was developed during the next level week cup, promoted by the Rocketseat team, in order to cover more knowledge related to the Javascript stack with React and Next.JS technologies for the Web, React Native and Expo for the Mobile App, in addition to from Node JS and Fastify to the backend server. All technologies used Typescript.

License

Notifications You must be signed in to change notification settings

AllanDutra/nlw-world-cup

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

9 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

This repository was developed during the next level week cup, promoted by the Rocketseat team, in order to cover more knowledge related to the Javascript stack with React and Next.JS technologies for the Web, React Native and Expo for the Mobile App, in addition to from Node JS and Fastify to the backend server. All technologies used Typescript.

πŸ’» Web

Screens

Home

Image of home screen

Technologies

πŸ“± Mobile

Screens

Splash Sign In New Pool New Pool Loading
My Pools Pool Details Search Pool Pool Ranking

Technologies

πŸ”‹ Server

Routes

Auth

GET β€” "/me"

Get JWT informations

Bearer token required

response:

{
   "user": {
      "name": string,
      "avatarUrl": string,
      "sub": string,
      "iat": number,
      "exp": number
   }
}

POST β€” "/users"

Sign In / Sign Up with access_token that can be obtained by Google OAuth2

request:

{
   "access_token": string
}

response:

{
   "token": string
}

Game

GET β€” "/pools/:id/games"

List games by pool id

Bearer token required

route params:

id: string

response:

{
   "games": [
      {
         "id": string,
         "date": DateTime,
         "firstTeamCountryCode": string,
         "secondTeamCountryCode": string,
         "guess": {
            "id": string,
            "firstTeamPoints": number,
            "secondTeamPoints": number,
            "createdAt": DateTime,
            "gameId": string,
            "participantId": string
         }
      },
      {
         "id": string,
         "date": DateTime,
         "firstTeamCountryCode": string,
         "secondTeamCountryCode": string,
         "guess": null
      }
   ]
}

Guess

GET β€” "/guesses/count"

Get count of created guesses

response:

{
   "count": number
}

POST β€” "/pools/:poolId/games/:gameId/guesses"

Create a guess in the pool and games by yours ids

Bearer token required

route params:

poolId: string gameId: string

request:

{
   "firstTeamPoints": number,
   "secondTeamPoints": number
}

Pool

GET β€” "/pools/count"

Get count of created pools

response:

{
   "count": number
}

GET β€” "/pools"

Get pools that my user is participating in

Bearer token required

response:

{
   "pools": [
      {
         "id": string,
         "title": string,
         "code": string,
         "createdAt": DateTime,
         "ownerId": string,
         "participants": [
            {
               "id": string,
               "user": {
                  "avatarUrl": string
               }
            }
         ],
         "owner": {
            "id": string,
            "name": string
         },
         "_count": {
            "participants": number
         }
      }
   ]
}

GET β€” "/pools/:id"

Get specific pool by your id

Bearer token required

route params:

id: string

response:

{
   "pool": {
      "id": string,
      "title": string,
      "code": string,
      "createdAt": DateTime,
      "ownerId": string,
      "participants": [
         {
            "id": string,
            "user": {
               "avatarUrl": string
            }
         }
      ],
      "owner": {
         "id": string,
         "name": string
      },
      "_count": {
         "participants": number
      }
   }
}

POST β€” "/pools"

Create a new pool

Bearer token optional (?)

{
   "title": string
}

response:

{
   "code": string
}

POST β€” "/pools/join"

Join in a existant pool

Bearer token required

request:

{
   "code": string
}

User

GET β€” "/users/count"

Get count of registered users in the system

response:

{
   "count": number
}

Technologies


Constant Learning πŸš€πŸ’œ

About

This repository was developed during the next level week cup, promoted by the Rocketseat team, in order to cover more knowledge related to the Javascript stack with React and Next.JS technologies for the Web, React Native and Expo for the Mobile App, in addition to from Node JS and Fastify to the backend server. All technologies used Typescript.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published