This project is a REST API developed in Node.js using TypeScript and follows the principles of SOLID Clean Architecture. It provides functionalities for a dice game, including player management, dice rolls, and a player ranking based on their success in the game.
- Player Management: Registration, update, and deletion of players.
- Dice Rolls: Recording and deletion of dice rolls for players.
- Player Ranking: Display of players ranked by their success in the game.
- Node.js
- TypeScript
- Express.js
- Prisma (ORM for interacting with the database)
- MySQL (Relational database)
- Docker (For managing the database)
- Node.js and npm installed on your system.
- Docker installed on your system.
- Clone this repository on your local machine:
git clone https://github.com/your-username/dice-game-api.git
- Navigate to the project directory:
cd dice-game-api
- Navigate to back-end directory:
cd back-end
- Install the project dependencies:
npm install
Copy the .env.example file and rename it to .env. Make sure to configure the environment variables according to your preferences.
- Start the MySQL database using Docker:
npm run docker
- Start the application:
npm run dev
The API will be available at http://localhost:3000.
To ensure all works as expected, all functions and routes were tested using Supertest and Jest.
Run this command to every function and route on /players
npm run test:players
Run this command to every function and route on /games
npm run test:games
Run this command to every function and route on /ranking
npm run test:ranking
This project is licensed under the MIT License.