Implemented complete database initialization and seed data system for Docker development environment. Changes: - Enhanced init-db.sql with PostgreSQL extensions (uuid-ossp, pg_trgm, btree_gin) - Created seed-data.sql with demo tenant, users, project, epics, stories, and tasks - Updated docker-compose.yml to mount both initialization scripts - Added DEMO-ACCOUNTS.md documentation with credentials and testing guide - Added test-db-init.ps1 PowerShell script for testing initialization Features: - Automatic demo data creation on first startup - 2 demo users (Owner and Developer with Demo@123456 password) - 1 demo project with realistic Epic/Story/Task hierarchy - Idempotent seed data (checks if data exists before inserting) - Multi-tenant structure with proper TenantId isolation - Detailed logging and error handling Demo Accounts: - owner@demo.com / Demo@123456 (Owner role) - developer@demo.com / Demo@123456 (Member role) Demo Project Data: - Tenant: Demo Company - Project: DEMO - Demo Project - Epic: User Authentication System - 2 Stories (Login Page, Registration Feature) - 7 Tasks (various statuses: Done, InProgress, Todo) Testing: - Run: .\scripts\test-db-init.ps1 - Or: docker-compose down -v && docker-compose up -d Documentation: See scripts/DEMO-ACCOUNTS.md for full details 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
6.8 KiB
ColaFlow Demo Accounts
Overview
When you start the ColaFlow development environment using Docker Compose, demo accounts and sample data are automatically created for testing and development purposes.
Demo Tenant
Tenant Name: Demo Company Tenant Slug: demo-company Plan: Professional Status: Active
Tenant Limits
- Max Users: 50
- Max Projects: 100
- Max Storage: 100 GB
User Accounts
Owner Account
Purpose: Full administrative access to the tenant
| Field | Value |
|---|---|
| owner@demo.com | |
| Password | Demo@123456 |
| Full Name | John Owner |
| Role | Owner |
| Status | Active |
| Email Verified | Yes |
Permissions:
- Full tenant administration
- Create/delete projects
- Manage users and roles
- View audit logs
- Configure tenant settings
Developer Account
Purpose: Standard member account for testing member-level features
| Field | Value |
|---|---|
| developer@demo.com | |
| Password | Demo@123456 |
| Full Name | Jane Developer |
| Role | Member |
| Status | Active |
| Email Verified | Yes |
Permissions:
- Create and edit projects (where assigned)
- Create/edit/delete stories and tasks
- View projects and reports
- Update profile settings
Demo Project Data
Project: Demo Project
Project Key: DEMO Status: Active Owner: John Owner (owner@demo.com)
Epic: User Authentication System
Status: InProgress Priority: High Description: Implement a complete user authentication system with login, registration, password reset, and email verification features.
Stories
Story 1: Login Page Implementation
Status: InProgress Priority: High Assignee: Jane Developer Estimated Hours: 16.0 Description: As a user, I want to log in with my email and password, so that I can access my account securely.
Tasks:
- Design login form UI - Done (3.5h / 4h estimated)
- Implement login API endpoint - InProgress (5h / 8h estimated)
- Add client-side form validation - Todo (2h estimated)
- Write unit tests for auth service - Todo (4h estimated)
Story 2: User Registration Feature
Status: Todo Priority: High Assignee: Jane Developer Estimated Hours: 20.0 Description: As a new user, I want to register an account with email verification, so that I can start using the platform.
Tasks:
- Design registration form - Todo (6h estimated)
- Implement email verification flow - Todo (8h estimated)
- Add password strength indicator - Todo (3h estimated)
Quick Start Guide
1. Start the Development Environment
# Windows
docker-compose up -d
# Linux/Mac
docker-compose up -d
2. Wait for Services to be Ready
The first startup may take 1-2 minutes as it:
- Pulls Docker images
- Runs database migrations
- Creates demo data
Check status:
docker-compose ps
docker-compose logs backend
3. Access the Application
Frontend: http://localhost:3000 Backend API: http://localhost:5000 Swagger Docs: http://localhost:5000/swagger
4. Login with Demo Accounts
- Navigate to http://localhost:3000
- Click "Login"
- Use one of the demo accounts above
- Explore the demo project and data
Testing Scenarios
Scenario 1: Owner Capabilities
Login as owner@demo.com:
- View all projects
- Create a new project
- Assign team members
- View audit logs
- Manage tenant settings
Scenario 2: Member Capabilities
Login as developer@demo.com:
- View assigned projects
- Create/edit stories and tasks
- Update task status
- Track time spent
- Add comments (if implemented)
Scenario 3: Multi-Tenant Isolation
- Login as owner@demo.com
- Create another tenant (if registration is enabled)
- Verify you cannot see Demo Company data in the new tenant
- Test tenant-level data isolation
Resetting Demo Data
Option 1: Full Reset (Recommended)
This deletes all data and recreates demo accounts:
# Stop containers and delete volumes
docker-compose down -v
# Restart (will recreate demo data)
docker-compose up -d
Option 2: Database Only Reset
Keep images but reset database:
# Remove postgres volume
docker volume rm product-master_postgres_data
# Restart postgres
docker-compose up -d postgres
Option 3: Manual Reset via SQL
-- Connect to database
docker exec -it colaflow-postgres psql -U colaflow -d colaflow
-- Drop all data (CAUTION: This deletes everything)
DROP SCHEMA identity CASCADE;
DROP SCHEMA project_management CASCADE;
-- Exit and restart to recreate
\q
docker-compose restart backend
Troubleshooting
Issue: Demo accounts not created
Symptoms: Cannot login with demo accounts
Solution:
- Check database logs:
docker-compose logs postgres - Verify EF Core migrations ran:
docker-compose logs backend | grep -i migration - Manually run seed script:
docker exec -it colaflow-postgres psql -U colaflow -d colaflow -f /docker-entrypoint-initdb.d/02-seed-data.sql
Issue: Seed data script fails
Symptoms: Errors in postgres logs about missing tables
Solution: Seed data script runs AFTER migrations. Ensure migrations completed:
docker-compose exec backend dotnet ef database update
Issue: Password not working
Symptoms: "Invalid credentials" error
Solution:
- Verify you're using the correct password:
Demo@123456(case-sensitive) - Check if password hashing is configured correctly in backend
- Manually update password hash if needed:
UPDATE identity.users SET password_hash = '$2a$11$NEW_HASH_HERE' WHERE email = 'owner@demo.com';
Issue: "Tenant not found" error
Symptoms: 404 or tenant-related errors
Solution:
- Check if tenant was created:
SELECT * FROM identity.tenants; - Verify TenantId matches in users table
- Re-run seed data script after fixing migrations
Production Deployment Notes
WARNING: The demo accounts are for development use only!
Before deploying to production:
- Remove seed-data.sql volume mount from docker-compose.yml
- Change all passwords to strong, unique passwords
- Disable automatic account creation
- Enable email verification for all new accounts
- Configure proper SSL/TLS for HTTPS
- Use environment variables for sensitive data (not hardcoded)
- Enable rate limiting on authentication endpoints
- Set up monitoring and alerting
- Regular backups of production database
- Security audit before going live
Support
Issues or Questions?
- Check project documentation:
docs/ - Review Docker logs:
docker-compose logs - Open an issue on GitHub
- Contact the development team
Last Updated: 2025-11-04 Version: 1.0 Maintainer: ColaFlow Backend Team