Project requirements: requirements.md
The most easiest way to set up the project is Docker Compose:
- Create
.envfile like.env.example - Generate TLS certificates for backend and auth services and frontend:
for svc in backend auth frontend gigachat_proxy; do
mkdir -p "$svc/tls"
openssl req -x509 -newkey rsa:4096 -sha256 -days 365 -nodes \
-subj "/CN=localhost" \
-keyout "$svc/tls/key.crt" \
-out "$svc/tls/cert_${svc}.crt"
done- Go to https://localhost:<AUTH_PORT>/health. You`ll see "Your connection not private". Click Advanced > proceed to localhost. Repeat for backend
- Run project:
- To run all containers in a background (detach process)
docker-compose up -d- To attach all processes to the terminal session
docker compose upPrerequisites: Node.js ≥ 18 LTS and npm (or
pnpm/yarn).
# 1. Go to the frontend folder
cd frontend
# 2. Install dependencies
npm install
# 3. Add env variables in frontend/.env file:
# Example:
VITE_AUTH_API_BASE_URL=https://localhost:8080
VITE_STORAGE_API_BASE_URL=https://localhost:1234
# 4. Start the dev server
npm run devAdmin credentials:
- Username:
admin - Password:
password
- Create JWT_SECRET in .env file
- Generate TLS certificate (see «Run using Docker Compose»)
- Run:
cd backend
go mod tidy
go run . --host=localhost --port=YOUR_PORTPrerequisites: Go ≥ 1.23, PostgreSQL.
- Create JWT_SECRET in .env file
- Generate TLS certificate (see «Run using Docker Compose»)
- Run PostgreSQL instance:
cd auth
sudo apt install posgtresql
sudo -u postgres createdb auth_db # creates database
sudo -u postgres psql -d auth_db -f db/init.sql # creates table 'users'- Run:
export DB_ variables # env variables from .env.example
go mod tidy
go run . --host=localhost --port=YOUR_PORTRequirements:
swagutility Install it using:
$ go install github.com/swaggo/swag/cmd/swag@latest
# swag must be in $GOPATH/binDocs generation:
- To generate documentation run:
cd backend
swag init
cd ../auth
swag init
- To use see http://localhost:YOUR_PORT/swagger/index.html for auth and backend
cd frontend
npm run test- Create
backend/.envfile likebackend/.env.example - Run:
cd backend
go test -vcd auth
go test -v
