Integrate PostgreSQL and Bootstrap Initial Roles/Admin User (SZ-3)
rk@tigase.net opened 2 hours ago

🐘 Integrate PostgreSQL and Bootstrap Initial Roles/Admin User

Goal:
Integrate PostgreSQL as the primary database for Sztab and initialize system roles and a default admin user at application startup.

Estimated Time: 4–5 hours


🧩 Task Breakdown

1. PostgreSQL Integration
  •  Add PostgreSQL JDBC driver to pom.xml
  •  Configure application.yml with:
    • spring.datasource.url
    • spring.datasource.username/password
    • spring.jpa.hibernate.ddl-auto
  •  Enable support for uuid primary keys if needed
2. Schema Generation & Validation
  •  Run schema auto-generation against PostgreSQL
  •  Confirm entity mappings behave as expected
  •  Verify enum handling (EnumType.STRING) and timestamps
3. Bootstrap Roles and Default Admin
  •  Create data.sql or use @PostConstruct or ApplicationRunner
  •  Insert system roles (ADMIN, DEVELOPER, etc.)
  •  Create default admin user assigned to ADMIN role
  •  Validate password hashing via PasswordEncoder
4. Secure Default Admin Password
  •  Make admin password configurable via application.yml or env variable
  •  Add fallback default (admin123) only in dev
  •  Mask password value in logs
5. Test Against Local PostgreSQL
  •  Run the app against local or Dockerized PostgreSQL
  •  Verify login flow and role-based access to REST endpoints

📦 Output Artifacts

  • PostgreSQL running as primary DB for Sztab
  • Admin user and roles initialized on startup
  • Secure config-based password management

Notes:
If we need Docker Compose for dev, I will include PostgreSQL container setup in docker-compose.yml.

issue 1 of 1
Type
New Feature
Priority
Normal
Assignee
Version
none
Sprints
n/a
Customer
n/a
Issue Votes (0)
Watchers (3)
Reference
SZ-3
Please wait...
Page is in error, reload to recover