Aaltogether's incredible backend. Written in Java using Spring Boot.
Stay tuned.
The project can be run in three ways:
- Using
docker composeto run a PostgreSQL instance and the backend - Using a local PostgreSQL instance and running the backend
- Running the backend only (in memory database)
For method 1 and 2, please generate a .env file in the root directory of the project. The .env file should contain the following variables:
DB_URL=jdbc:postgresql://<DB_IP>:5432/postgres # put "postgresql" as the DB_IP if you wanna use docker compose, "localhost" otherwise
DB_USER=postgres
DB_PASSWORD=password
DB_DRIVER=org.postgresql.Driver
HOST_IP=127.0.0.1
HOST_PORT=8080
FRONTEND_IP=127.0.0.1
FRONTEND_PORT=3000
SOCKET_PORT=8085
HIBERNATE_DIALECT=org.hibernate.dialect.PostgreSQLDialect
MAIL_USERNAME=<MAILTRAP_EMAIL>
MAIL_PASSWORD=<MAILTRAP_PASSWORD>Requirements:
dockeranddocker compose
Run the following command to start the backend and a PostgreSQL instance:
sudo docker compose upAdd -d to run in detached mode
Requirements:
- JDK 22
docker
If you don't want to use docker compose, you can run the following command to create a local PostgreSQL instance:
sudo docker run -e POSTGRES_PASSWORD='password' -e POSTGRES_USER='postgres' -e POSTGRES_DB='postgres' -p 5432:5432 postgresThen, run the backend using the following command:
./gradlew bootRunRequirements:
- JDK 22
- Update the
.env.testfile with your MailTrap credentials
Run the backend using the following command:
./gradlew bootRun