Initial commit: LMS microservices scaffold
- Gradle multi-module: libs/{common-http,security-jwt,markdown,test-support},
services/{identity,academic,progress,gateway}, web (Thymeleaf+htmx)
- identity-service: JWT auth (RSA), accounts, students, groups, enrollment,
import from XLSX/CSV, credentials export, password reset
- academic-service: lab import from JSON/zip (markdown + YAML + variants),
levels, API
- progress-service: schema for student levels and variant assignments
- gateway: Spring Cloud Gateway, JWT validation, route propagation
- web: Server-side UI with flex/footer layout, light/dark theme toggle,
admin dashboard, groups CRUD, student portal placeholder
- docker-compose: PostgreSQL 18
- Tests: identity smoke test with Testcontainers
This commit is contained in:
37
services/identity-service/src/main/resources/application.yml
Normal file
37
services/identity-service/src/main/resources/application.yml
Normal file
@@ -0,0 +1,37 @@
|
||||
server:
|
||||
port: ${SERVER_PORT:8081}
|
||||
|
||||
spring:
|
||||
application:
|
||||
name: identity-service
|
||||
datasource:
|
||||
url: ${LMS_DB_URL:jdbc:postgresql://localhost:5432/lms?currentSchema=identity}
|
||||
username: ${LMS_DB_USER:lms}
|
||||
password: ${LMS_DB_PASSWORD:lms}
|
||||
jpa:
|
||||
open-in-view: false
|
||||
hibernate:
|
||||
ddl-auto: validate
|
||||
properties:
|
||||
hibernate:
|
||||
default_schema: identity
|
||||
flyway:
|
||||
enabled: true
|
||||
locations: classpath:db/migration
|
||||
schemas: identity
|
||||
default-schema: identity
|
||||
create-schemas: true
|
||||
|
||||
management:
|
||||
endpoints:
|
||||
web:
|
||||
exposure:
|
||||
include: health,info
|
||||
endpoint:
|
||||
health:
|
||||
probes:
|
||||
enabled: true
|
||||
|
||||
springdoc:
|
||||
api-docs:
|
||||
path: /v3/api-docs
|
||||
@@ -0,0 +1,2 @@
|
||||
-- Baseline for the identity schema (accounts, students, groups, enrollments).
|
||||
CREATE SCHEMA IF NOT EXISTS identity;
|
||||
@@ -0,0 +1,45 @@
|
||||
-- Accounts, students, groups and enrollments for the identity service.
|
||||
|
||||
CREATE TABLE accounts (
|
||||
id uuid PRIMARY KEY DEFAULT uuidv7(),
|
||||
login varchar(64) NOT NULL UNIQUE,
|
||||
password_hash varchar(255) NOT NULL,
|
||||
role varchar(16) NOT NULL,
|
||||
must_change_password boolean NOT NULL DEFAULT true,
|
||||
temp_password varchar(64),
|
||||
created_at timestamptz NOT NULL DEFAULT now(),
|
||||
updated_at timestamptz NOT NULL DEFAULT now(),
|
||||
CONSTRAINT accounts_role_check CHECK (role IN ('ADMIN', 'STUDENT'))
|
||||
);
|
||||
|
||||
CREATE TABLE students (
|
||||
account_id uuid PRIMARY KEY REFERENCES accounts (id) ON DELETE CASCADE,
|
||||
student_no varchar(32) NOT NULL UNIQUE,
|
||||
last_name varchar(100) NOT NULL DEFAULT '',
|
||||
first_name varchar(100) NOT NULL DEFAULT '',
|
||||
middle_name varchar(100) NOT NULL DEFAULT '',
|
||||
basis varchar(100) NOT NULL DEFAULT '',
|
||||
note text NOT NULL DEFAULT ''
|
||||
);
|
||||
|
||||
CREATE TABLE groups (
|
||||
id uuid PRIMARY KEY DEFAULT uuidv7(),
|
||||
name varchar(100) NOT NULL UNIQUE,
|
||||
task_duration_min integer NOT NULL DEFAULT 30,
|
||||
created_at timestamptz NOT NULL DEFAULT now()
|
||||
);
|
||||
|
||||
CREATE TABLE enrollments (
|
||||
id uuid PRIMARY KEY DEFAULT uuidv7(),
|
||||
group_id uuid NOT NULL REFERENCES groups (id) ON DELETE CASCADE,
|
||||
student_id uuid NOT NULL REFERENCES students (account_id) ON DELETE CASCADE,
|
||||
enrolled_at timestamptz NOT NULL DEFAULT now(),
|
||||
CONSTRAINT enrollments_student_unique UNIQUE (student_id)
|
||||
);
|
||||
|
||||
CREATE INDEX enrollments_group_idx ON enrollments (group_id);
|
||||
|
||||
CREATE TABLE settings (
|
||||
key varchar(100) PRIMARY KEY,
|
||||
value text NOT NULL
|
||||
);
|
||||
Reference in New Issue
Block a user