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.
Splash | Sign In | New Pool | New Pool Loading |
---|---|---|---|
My Pools | Pool Details | Search Pool | Pool Ranking |
---|---|---|---|
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
}
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
}
]
}
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
}
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
}
GET β "/users/count"
Get count of registered users in the system
response:
{
"count": number
}
Constant Learning ππ