This is the backend of the CFT, accompanying the frontend in this repository. Written in Java with the help of Spring Boot, the backend performs CRUD operations on request of the frontend, interacting with a PostgreSQL database to store data. It also interacts with another server that provides AI predictions, uses Google's Drive and Sheets APIs to create and edit spreadsheets to save snapshots of the fighter position chart, and generates images on the fly that show further statistics.
This application uses the configuration files application.properties and cft.properties to initialize values for configurations and secrets. Both of these files should be created and placed in the src/main/resources directory.
The application.properties file contains the core configuration settings and secrets used by the project, including database credentials, Hibernate configuration settings, and the port to run the server on. It should have the following structure:
spring.jpa.hibernate.ddl-auto=update
spring.datasource.url=jdbc:postgresql://<url>:<port>/<database name>
spring.datasource.username=<username>
spring.datasource.password=<password>
spring.datasource.driver-class-name=org.postgresql.Driver
spring.jpa.properties.hibernate.dialect=org.hibernate.dialect.PostgreSQLDialect
spring.servlet.multipart.max-file-size=10MB
spring.servlet.multipart.max-request-size=10MB
error.whitelabel.enabled=false
server.port=<server port>
The cft.properties file contains configuration settings that are specific to this application, such as the Google API related variables. It should have this structure:
cft.files.folder-name=<folder name on disk to store image files>
cft.google.credential-path=<path to the Google Service Account credential JSON file>
cft.google.snapshot-folder-id=<ID of the Google Drive folder containing the event snapshots>