Skip to content

This project is intended as an exercise for using SCRUM and AGILE methods by creating 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 scores. Originally on GITLAB.

License

Notifications You must be signed in to change notification settings

maforn/BackgammonSocialSiteSWE

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

370 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Backgammon Social Site

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.

Quality gate

General Ratings

Maintainability Rating Reliability Rating Security Rating

Code Review

Coverage Duplicated Lines (%) Lines of Code

Other Factors

Bugs Code Smells Security Hotspots Technical Debt Vulnerabilities

Table of Contents

Introduction

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!

Project Features

  • 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.

Team Roles

Working Methodology

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.

Architecture and Technologies

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.

Docker

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.

Pipeline Explaination

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:

  1. Build Stage:

    • Builds backend (server) and frontend (client) Docker services.
    • Starts MongoDB as a database service.
  2. Test Stage:

    • Runs backend tests with pytest and frontend tests with npm run test.
  3. SonarQube Check:

    • Performs static code analysis using SonarQube.
    • Runs on key branches and allows failures gracefully.
  4. SonarQube Vulnerability Report:

    • Exports a security report from SonarQube.
    • Saves it as a GitLab artifact for review.

Installation Instructions

  1. Clone the repository:

    git clone https://aminsep.disi.unibo.it/gitlab/swe-team-3/backgammon-social-site.git
    cd backgammon-social-site
  2. If you want to test you can proceed on this branch, else switch to deploy/main

    git checkout deploy/main
  3. Copy the .env.example files to .env and edit their content to contain the right variables, such as your hostname, google password and secret and so on

    cp 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
  4. Create and start environment:

    • if you are in the deploy/main you can start the docker container with
      docker compose up --build deploy
      use -d to 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
      # inside the client terminal
      cd client
      npm install
      npm run dev
      and inside the server one with
      # inside the server terminal
      cd server
      python -m venv venv
      source venv/bin/activate
      pip install -r requirements.txt
      python main.py
  5. 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.

Contributions and Conventions

  • 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.

About

This project is intended as an exercise for using SCRUM and AGILE methods by creating 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 scores. Originally on GITLAB.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Contributors 7