Prerequisites
Before setting up CCDigital, ensure you have the following installed:Java 17
Required runtime for Spring Boot 3.5.11
MySQL 8
Primary relational database
Docker
For blockchain networks (Fabric, Indy)
Verify Prerequisites
The project uses Maven Wrapper (
./mvnw), so you don’t need Maven installed separately.Installation Steps
Configure Environment Variables
CCDigital is configured entirely through environment variables. Create a configuration script based on the template below:Save this as
env-local.sh and source it:Set Up MySQL Database
Create the database and user:If you have a database backup (SQL dump), import it:
The database schema includes 22+ tables, views (
v_documents, v_person_full_documents), stored procedures (sp_add_person_document, sp_create_user_with_person), and triggers for automatic versioning.Create File Storage Directory
Create the base directory for document storage:This directory will contain subdirectories for each citizen, created automatically when persons are registered.
Run the Application
Start the Spring Boot application using Maven Wrapper:The application will start on the configured port (default:
8080).On first run with
JPA_DDL_AUTO=none, ensure your database schema is already initialized. Use validate to verify the schema matches your entities, or update for development (not recommended for production).Alternative: Build and Run JAR
For production-like deployments:Access the Application
Open your browser and navigate to:
Admin Portal
http://localhost:8080/login/adminFor government operatorsIssuer Portal
http://localhost:8080/login/issuerFor authorized institutionsUser Portal
http://localhost:8080/login/userFor end-user citizensEach module has its own authentication flow. Admin and Issuer use traditional username/password authentication, while Users authenticate with Indy verifiable credentials + MFA.
Configuration Reference
Core Application Settings
The application reads configuration fromapplication.properties, which maps environment variables:
- Session timeout defaults to 5 minutes of inactivity
- Forward headers strategy enables proper URL construction behind reverse proxies (Caddy, nginx, Cloudflare)
Database Configuration
none- No schema management (production)validate- Validate schema matches entitiesupdate- Update schema to match entities (dev only)create- Drop and recreate schema on startup (testing only)
File Storage Configuration
Blockchain Network Configuration
ACA-Py / Indy Settings
- Set to
autoto automatically find the connection byholder-label - Or provide a specific connection ID
Fabric Script Configuration
workdir for blockchain synchronization.
Blockchain Network Setup (Optional)
Hyperledger Fabric Setup
Hyperledger Fabric Setup
Fabric integration is optional for basic testing. The application will work without it, but blockchain traceability features will be unavailable.
- Docker & Docker Compose
- Node.js LTS
- Fabric binaries (
peer,orderer,configtxlator)
- Clone
fabric-samplesrepository - Run bootstrap script to download binaries and images
- Start test network with
./network.sh up createChannel - Deploy chaincode for document management
- Configure Node.js client scripts with connection profiles
- Set
FABRIC_WORKDIRto the client script directory
Hyperledger Indy / ACA-Py Setup
Hyperledger Indy / ACA-Py Setup
Indy integration is required for end-user authentication. Without it, the user login flow will not function.
- Docker & Docker Compose
- Python 3.10+ with venv
- Indy ledger (local pool for testing)
- Start a local Indy ledger (von-network or similar)
- Launch issuer ACA-Py agent with wallet and admin API
- Launch holder ACA-Py agent with wallet and admin API
- Register issuer DID on the ledger with transaction privileges
- Create schema and credential definition
- Establish connection between issuer and holder
- Set
ACAPY_CRED_DEF_IDto your credential definition ID
Default Roles and Access
Security Configuration
CCDigital implements strict role-based access control via Spring Security (SecurityConfig):
| Role | Prefix | Access Pattern | Login Path |
|---|---|---|---|
| Government Admin | ROLE_GOBIERNO | /admin/**, /api/** | /login/admin |
| Issuer | ROLE_ISSUER | /issuer/** | /login/issuer |
| End User | ROLE_USER | /user/** | /login/user |
Public Endpoints
/- Home page/login/*- All login pages/register/user/**- User registration flow/static/**,/css/**,/js/**- Static resources
Security Features
Rate Limiting
Sensitive endpoints are protected bySensitiveEndpointRateLimitFilter:
Signed URLs for Documents
Document access uses time-limited signed URLs viaSignedUrlService:
HTTPS Enforcement (Production)
TOTP Configuration
Customize Time-based One-Time Password settings:Verification
After starting the application, verify it’s working:Common Issues
Database Connection Failed
Database Connection Failed
Symptoms: Application fails to start with connection errorsSolutions:
- Verify MySQL is running:
systemctl status mysql - Check credentials in
DB_URL,DB_USERNAME,DB_PASSWORD - Ensure database exists:
mysql -u root -p -e "SHOW DATABASES LIKE 'ccdigital';" - Check firewall rules if MySQL is remote
Port Already in Use
Port Already in Use
Symptoms:
Address already in use: bindSolutions:- Change
SERVER_PORTto an available port - Kill the process using port 8080:
lsof -ti:8080 | xargs kill -9
File Upload Fails
File Upload Fails
Symptoms: 403 Forbidden or “Ruta no permitida” errorSolutions:
- Verify
CCDIGITAL_FS_BASE_PATHdirectory exists and has write permissions - Ensure
app.user-files-base-dirmatchesccdigital.fs.base-path - Check SELinux/AppArmor policies if on Linux
Email OTP Not Sending
Email OTP Not Sending
Symptoms: Login/registration fails at OTP verification stepSolutions:
- Verify SMTP credentials in
MAIL_USERNAMEandMAIL_PASSWORD - For Gmail, use an App Password
- Check
MAIL_HOSTandMAIL_PORTare correct for your provider - Set
MAIL_TEST_CONNECTION=trueto verify SMTP on startup
Next Steps
Architecture Deep Dive
Understand the system architecture, data flows, and blockchain integration
Admin Module
Learn how to manage persons, documents, and access governance
Issuer Module
Discover how institutions upload and manage official documents
User Module
Explore the citizen-facing authentication and document access flows
