This project is a web application for playing backgammon online, allowing two players or a player against an intelligent agent (bot) to compete. The platform also enables tournament organization among players and features a leaderboard updated with personal scores.
- Introduction
- Project Features
- Team Roles
- Working Methodology
- Architecture and Technologies
- Pipeline Explaination
- Installation Instructions
- Contributions and Conventions
Sprint Zero was essential for planning the project, outlining the main features, establishing communication foundations, and structuring the backlog of user stories necessary for the development sprints.
The tests are covering over 90% of the code, which is long over 10k lines!
- Online Play: Compete in backgammon online against other users or an intelligent agent.
- Tournaments: Organize and participate in tournaments with up to four players.
- Leaderboard: Updated ranking based on personal ratings.
- User Interface: Simple and intuitive UI designed for an optimal gaming experience.
- Communication: Notifications and messaging for tournaments and challenges.
- Scrum Master: Cristian Orsi
- Product Owner: Enis Brajevic
- Developer 1: Matteo Fornaini
- Developer 2: Mattia Ferrarini
- Developer 3: Enrico Mazzotti
- Developer 4: Lorenzo Giarrusso
The team works five days a week, with flexible hours for each member. Communication occurs via Mattermost for messaging and Microsoft Teams for video calls, while English is the primary language for code and technical documentation.
The project is divided into three main components:
- Frontend: Developed in Vue.js.
- Backend: Developed in Python using FastAPI.
- Database: Manages data for users, tournaments, and rankings.
The project utilizes a multi-stage Dockerfile for container management:
- Frontend Stage: Builds the Vue app to generate static files.
- Backend Stage: Configures and runs the Python application, serving the static frontend files and managing APIs.
We setup two Gitlab runners on private servers to handle the CI/CD.
The GitLab CI/CD pipeline automates the build, test, and security analysis process using Docker and SonarQube:
-
Build Stage:
- Builds backend (
server) and frontend (client) Docker services. - Starts MongoDB as a database service.
- Builds backend (
-
Test Stage:
- Runs backend tests with
pytestand frontend tests withnpm run test.
- Runs backend tests with
-
SonarQube Check:
- Performs static code analysis using SonarQube.
- Runs on key branches and allows failures gracefully.
-
SonarQube Vulnerability Report:
- Exports a security report from SonarQube.
- Saves it as a GitLab artifact for review.
-
Clone the repository:
git clone https://aminsep.disi.unibo.it/gitlab/swe-team-3/backgammon-social-site.git cd backgammon-social-site -
If you want to test you can proceed on this branch, else switch to deploy/main
git checkout deploy/main
-
Copy the
.env.examplefiles to.envand edit their content to contain the right variables, such as your hostname, google password and secret and so oncp server/.env.example server/.env cp client/.env.example client/.env vim server/.env # or use any ide to edit the file vim client/.env # or use any ide to edit the file
-
Create and start environment:
- if you are in the deploy/main you can start the docker container with
use
docker compose up --build deploy
-dto start it as a daemon and keep it running - if you are in the main branch you have to start the mongodb daemon, open two terminals and start server and client one with
and inside the server one with
# inside the client terminal cd client npm install npm run dev
# inside the server terminal cd server python -m venv venv source venv/bin/activate pip install -r requirements.txt python main.py
- if you are in the deploy/main you can start the docker container with
-
Access the app: The application will be available at either the specified url if you are deploying or a server or at localhost:5173 for the client and localhost:8000 for the server api.
- Language: English for code and documentation.
- Versioning:
- Branching workflow: Use prefixes (
feature/,bugfix/,docs/). - Branch naming: Lowercase, separated by hyphens (e.g.,
feature/game-board). - Commit messages: In imperative form (e.g.,
Add login endpoint). - Merging to main: Requires positive review from another team member.
- Branching workflow: Use prefixes (