A simple forum made with Spring Boot and React.
- Spring Boot Java framework for the backend
- React JavaScript library for the frontend
- System of accounts with different roles
- Optional anonimous posting
In order to build and run this app you only need Docker.
You have to create .env file with the folowing environment variables:
- REQUIRE_CAPTCHA (true/false) - is captcha required in forms
- HCAPTCHA_SECRET
- HCAPTCHA_SITE_KEY
- SERVER_HOST - the hostname the frontend should use to connect to the backend
- SERVER_PROTOCOL (http/https) - the protocol the frontend should use to connect to the backend
- TOKEN_SIGNING_PASSWORD - the password used for signing and verification of JWT-tokens
- POSTGRES_PASSWORD - the password for the user
postgres
to connect to the database - FRONTEND_PORT - the port to access the frontend
Every line of the .env file must have the format VARIABLE_NAME=variable-value.
By default an account with username admin
and password 1234
is registered with the role owner
. You can use it for configuration via dashboard.
Build the backend separately. You can use my script:
./init-backend.sh
Prepare environment variables for the frontend using my special script that just copies .env
file to the frontend directory and adds the VITE_
prefix to the name of each variable in it. You have to do it every time you change .env
file in the application root folder:
./init-frontend.sh
Build and run the application:
docker compose up -d
After that you can access the app on port specified in .env
as FRONTEND_PORT
.
To stop the application:
docker compose down