Commit 710ca5b6 authored by Dimitrios Gogos's avatar Dimitrios Gogos
Browse files

feat: update Makefile and environment configurations for improved local development setup

parent 772cab7c
Loading
Loading
Loading
Loading

.env.example

0 → 100644
+12 −0
Changes for .env.example: 12 added lines, 0 removed lines.
Original line number Diff line number Diff line
APP_VERSION=dev
POSTGRESQL_SETTINGS__URL="postgresql+asyncpg://portal:portal@localhost:5432/portal"
POSTGRESQL_SETTINGS__CREATE_SCHEMA_ON_STARTUP=true

# Login through Keycloak. Set AUTH__SECURITY_MODE="none" to skip it.
AUTH__SECURITY_MODE="jwt"
OIDC__ISSUER="http://<keycloak-host>/realms/oop"
OIDC__CLIENT_ID="oop-portal"
OIDC__CLIENT_SECRET="change-me"
# The GUI dev server's address, which proxies /api here, so the login cookies
# belong to the address the browser is on. Keycloak's client must accept it.
OIDC__REDIRECT_URI="http://localhost:3000/api/auth/callback"
+6 −2
Changes for Makefile: 6 added lines, 2 removed lines.
Original line number Diff line number Diff line
.PHONY: install clean lint format precommit architecture type test integration coverage run check \
	gui-install gui-lint gui-format gui-typecheck gui-build gui-run
	gui-install gui-lint gui-format gui-typecheck gui-build gui-run dev

SRC := src/portal_service
TEST := tests
@@ -64,7 +64,7 @@ coverage:
	.venv/bin/pytest --cov=$(SRC) --cov-branch --cov-report=term-missing

run:
	make install
	make install DEV=true
	.venv/bin/uvicorn "portal_service.main:create_app" --factory --reload --port 8000

## Frontend (portal-gui)
@@ -90,6 +90,10 @@ gui-build: $(GUI)/node_modules
gui-run: $(GUI)/node_modules
	npm --prefix $(GUI) run dev

# Backend and GUI together; Ctrl-C stops both.
dev:
	$(MAKE) -j2 run gui-run

check: $(GUI)/node_modules
	make install DEV=true
	.venv/bin/ruff format --check $(SRC) $(TEST)
+7 −4
Changes for README.md: 7 added lines, 4 removed lines.
Original line number Diff line number Diff line
@@ -11,12 +11,15 @@ Developer portal UI and deployment for the OOP platform.
## Run locally

```bash
cd portal-gui
npm install
npm run dev
cp .env.example .env   # then fill in the Keycloak client
make dev               # backend on :8000, GUI on :3000
```

Open [http://localhost:3000](http://localhost:3000).
`make run` and `make gui-run` start either one alone.

Open [http://localhost:3000](http://localhost:3000). The GUI dev server proxies `/api`
to the backend, so both share one address and the login cookies work. That is why
`OIDC__REDIRECT_URI` points at `:3000`, not the backend's own port.

## Checks

+1 −0
Changes for portal-gui/.env.development: 1 added line, 0 removed lines.
Original line number Diff line number Diff line
VITE_API_MODE=mock
VITE_PORTAL_BACKEND_URL=http://127.0.0.1:8000
+1 −0
Changes for portal-gui/.env.example: 1 added line, 0 removed lines.
Original line number Diff line number Diff line
VITE_API_BASE_URL=
VITE_PORTAL_BACKEND_URL=http://127.0.0.1:8000
Loading