A minimal full-stack demo wiring together:
| Layer | Technology |
|---|---|
| API | Java 21 · Spring Boot 3 · Spring Security (OAuth2 resource server) |
| Frontend | React 18 · Vite · oidc-client-ts (Auth Code + PKCE) |
| Auth / Token service | Curity Identity Server |
| Database | PostgreSQL 16 |
| Runtime | Docker Compose |
Browser
│ Login redirect (Authorization Code + PKCE)
▼
Curity :8443 ──── issues JWT access token
│
│ Bearer token
▼
Spring Boot API :8080 ──── validates JWT via JWKS endpoint
│
│ JPA
▼
PostgreSQL :5432
- Docker (with Compose v2)
opensslandpython3(forsetup.sh)- A free Curity developer license — get one at https://developer.curity.io
# 1. Place your Curity license
cp ~/Downloads/license.json curity/license.json
# 2. Generate keys, TLS cert, and Curity config
./setup.sh
# 3. Start everything
docker compose up --buildBecause setup.sh generates a self-signed TLS cert for Curity, your browser
will show a warning when the frontend redirects to
https://localhost:8443 for the first time.
Navigate directly to https://localhost:8443 and accept the cert, then
return to http://localhost:3000 and click Sign in.
| Username | Password |
|---|---|
demo |
Demo1234! |
| Service | URL |
|---|---|
| Frontend | http://localhost:3000 |
| API (health) | http://localhost:8080/actuator/health |
| API (items) | http://localhost:8080/api/items |
| Curity admin UI | https://localhost:6749/admin (admin / Password1) |
| OIDC discovery | https://localhost:8443/oauth/v2/oauth-anonymous/.well-known/openid-configuration |
cd demo-app
git init
git add .
git commit -m "Initial commit"
# Create a repo on GitHub, then:
git remote add origin git@github.com:<your-org>/demo-app.git
git push -u origin mainNote:
curity/license.json, generated keys, andcurity/idsvr-config-backup.xmlare in.gitignore— they will never be committed. Each developer runssetup.shlocally after cloning.
The Docker Compose file is the source of truth. When you're ready to deploy to Railway, each service maps to a Railway service:
db→ Railway PostgreSQL plugincurity→ Railway service from thecurity/idsvrimageapi→ Railway service built from./apifrontend→ Railway service built from./frontend
Environment variables can be copied directly from the environment: blocks in
docker-compose.yml to Railway's variable editor, adjusting service names to
use Railway's internal DNS.
.
├── api/ Spring Boot resource server
│ ├── src/main/java/io/curity/demo/
│ │ ├── DemoApplication.java
│ │ ├── Item.java JPA entity
│ │ ├── ItemRepository.java
│ │ ├── ItemController.java GET /api/items, GET /api/items/{id}
│ │ └── SecurityConfig.java JWT validation + CORS
│ ├── src/main/resources/application.yml
│ ├── pom.xml
│ └── Dockerfile
├── frontend/ React SPA
│ ├── src/
│ │ ├── auth/userManager.js oidc-client-ts setup
│ │ ├── components/ItemList.jsx
│ │ ├── App.jsx
│ │ └── main.jsx
│ ├── .env.example
│ ├── nginx.conf
│ └── Dockerfile
├── curity/
│ ├── idsvr-config-backup.xml.template edit this, not the generated file
│ ├── license.json ← you provide this (gitignored)
│ └── [generated files] ← created by setup.sh (gitignored)
├── db/
│ └── init.sql schema + seed data
├── docker-compose.yml
├── setup.sh run before first `docker compose up`
└── .gitignore