This is the backend of the Football Project, A RESTful API for managing football games, real-time scores and standings, built with Spring Boot and MySQL. Users can create games, update the scores of their own games, and view real-time results and league standings for all users across various leagues. It provides RESTful APIs that the frontend interacts with, enabling users to perform various football-related operations and also handles user authentication and authorization, ensuring secure access to the system.
For the frontend Repository of this project, visit the Frontend Repository.
Before setting up and running this backend, ensure that the following software is installed on your system:
-
MySQL 8.0 (or higher):
- Installation: Download MySQL
-
Java 17 (or higher):
- Installation: Download JDK
- Example Setting Enviroment Variable on Windows:
set JAVA_HOME=C:\path\to\your\jdk set PATH=%JAVA_HOME%\bin;%PATH%
- Example Setting Enviroment Variable on macOS/Linux:
export JAVA_HOME=/path/to/your/jdk export PATH=$JAVA_HOME/bin:$PATH
-
Apache Maven 3.9.6 (or higher):
- Installation: Download Maven
- Example for setting Enviroment Variable on Windows:
set MAVEN_HOME=C:\path\to\maven set PATH=%MAVEN_HOME%\bin;%PATH%
- Example for setting Enviroment Variable on macOS/Linux:
export MAVEN_HOME=/path/to/maven export PATH=$MAVEN_HOME/bin:$PATH
-
Create a new Database:
CREATE DATABASE your_db_name;
-
Configure Database Credentials:
- Download the .env.sample file and rename it to .env in the root directory of your project.
- Update the .env file with your database credentials and any other environment variables required by the application (e.g., API keys, secret keys).
-
Flyway Database Migration:
- Flyway is already set up in the project to manage database schema migrations. The migration scripts are located in src/main/resources/db/migration/
- Automatic Migration: When you run the application, Flyway will automatically apply any pending migrations to the database.
- Manual Migration: Alternatively, you can manually run migrations with this Maven command:
mvn flyway:migrate
- Navigate to the project directory:
cd /path/to/your/project
- Run the project using Maven:
mvn clean install mvn spring-boot:run
-
Java & Spring Boot: Core technologies for backend development, providing a robust and scalable foundation.
-
Spring Data JPA: Simplifies database interactions using Java Persistence API (JPA) for efficient data management.
-
Spring MVC: Web framework for building RESTful APIs with a model-view-controller architecture.
-
RESTful APIs: Experience in designing and developing REST APIs within the Spring ecosystem, following best practices for stateless, scalable, and secure endpoints.
-
MySQL: Relational database used for data storage and management.
-
Flyway: Database migration tool for version control of schemas and automated migrations.
-
Hibernate ORM (JPA): Manages database operations and object-relational mapping (ORM) to persist Java objects.
-
Transaction Management: ensures atomic operations, preventing inconsistent database states.
-
HikariCP: High-performance connection pool for efficient database connection management.
-
Maven: A build and dependency management tool for Java projects, automating tasks such as compilation, testing, packaging, and dependency resolution.
-
Git: Version control system for code collaboration and management.
-
Postman: Tool for testing and interacting with REST APIs.
-
JUnit: Framework for unit testing Java code to ensure robustness and correctness.