Generated Project README
This document outlines the steps to set up, configure, and deploy the application.
1.Usage¶
1.1.Run with Docker¶
To run the application using Docker, which simplifies the setup through containerization, follow the steps below.
Install Docker if they are not already installed on your machine.
Navigate to the root directory of the project where the docker-compose.yml file is located and run the following command:
docker compose upIf you have made changes to the source code and need to rebuild and restart the application, use the following commands:
docker compose down
docker compose up --builddocker compose down stops the servers and docker compose up --build rebuilds the application to include changes and restarts it.
1.2.Run manually¶
To run the application manually, ensure Maven is installed on your machine, and set up the PostgreSQL database as specified in the docker-compose.yml file.
Then, navigate to the root directory of the project where the pom.xml file is located and execute the following commands:
Start the application using Spring Boot:
mvn spring-boot:run2.Operations¶
The application settings are located in the src/main/resources/application.properties file.
Adjust the settings below to configure the application’s behavior.
2.1.Email configuration¶
Configure the SMTP settings to enable email functionalities. Replace placeholders with your actual email service provider’s details and credentials:
spring.mail.host: SMTP server host (e.g.,smtp.gmail.comfor Gmail).spring.mail.port: SMTP server port (e.g., 587 for Gmail with STARTTLS).spring.mail.username: Your email address (replace<<YOUR-EMAIL-ADDRESS>>).spring.mail.password: Your email password (replace<<YOUR-EMAIL-PASSWORD>>).spring.mail.properties.mail.smtp.auth: Enable SMTP authentication (true).spring.mail.properties.mail.smtp.starttls.enable: Enable STARTTLS (true).mail.from: Email sender’s name or email (replace<<YOUR-EMAIL-SENDER-NAME>>).
2.2.Enabling SQL logging¶
#[[To enable SQL logging for development, remove the comments before the lines under the # SQL Logging for development section.]]#
Uncommenting these lines will activate verbose logging for SQL operations, which is helpful for debugging during development:
# SQL Logging for development
logging.level.ROOT = WARN
logging.level.org.springframework.test.context.transaction = INFO
logging.level.org.hibernate.SQL = DEBUG
spring.jpa.properties.hibernate.format_sql = true
logging.level.org.hibernate.type.descriptor.sql.BasicBinder = TRACE2.3.Experimental features configuration¶
To enable experimental features within the system that are not yet fully stable, modify the following line, default value is false:
mike.experimental.features=false2.4.Configuring environment variables¶
Below are the environment variables which can configure the execution of the application without require any change in the application.properties:
APP_JWT_SECRET: Secret key for JWT encryption.APP_DB_HOST: Hostname of the database server.APP_DB_PORT: Port number of the database server.APP_DB_NAME: Database name.APP_DB_USER: Username for the database login.APP_DB_PASS: Password for the database login.MAX_FILES: Maximum number of files that can be uploaded in a single request.MAX_SIZE: Maximum size per file in bytes.UPLOAD_DIR: Directory path where uploaded files will be stored.TEMPORARY_DIR: Directory path for temporary files.