A place to centralize your games
Creation a core microservice application analogue to frameworks.
- Premises
- Handle with two server framework implementation
- Choose gRPC and fastify
- Handle with two database implementation
- Choose in memory to testing and prisma
- Use value objects with self validation
- Handle with two server framework implementation
- User
- Provider
- User Register
- User Login
- Add Provider
- Active Provider
-
User Register
-
payload:
{ "email": string, "username": string, "password": string, "passwordConfirmation": string }
-
-
User Login
-
payload:
{ "username": string, "password": string }
-
-
Add Provider
-
payload:
{ "token": string, "provider": string, "nick": string }
-
-
Active Provider
-
payload:
{ "userId": string, "provider": string }
-
-
User Register
-
payload:
{ "email": string, "username": string, "password": string, "passwordConfirmation": string }
-
-
User Login
-
payload:
{ "username": string, "password": string }
-
-
Add Provider
-
payload:
{ "provider": string, "nick": string }
-
headers:
{ "token": string, }
Secure note: Active Provider method don't exist for http, should create one topic with a subscribe for security reasons, for gRPC one BFF api will not implement this method, gRPC should not have internet network access only direct access to BFF.
-
BCRYPT_SALT= salt to bcrypt
JWT_PRIVATE_KEY= jwt private key
JWT_ISSUER= jwt issuer
TOKEN_MAX_AGE= token max age
DATABASE_URL= db url
SERVER_GRPC_PORT=50051
SERVER_HTTP_PORT=3000
SERVER_ADDRESS=0.0.0.0
To run this project, clone it in your machine
-
Go to project folder
cd game-room
-
Instal packages
pnpm install
(if you don't have pnpm in your machine install withnpm i -g pnpm
) -
Copy .env.example to .env and edit values
-
Run project with
pnpm dev