Local Setup
Now that you have all prerequisites installed, let's get your ACCI EAF development environment up and running locally.
π Repository Setupβ
Clone the Repositoryβ
# Clone the repository (replace with actual repository URL)
git clone <repository-url> acci-eaf
cd acci-eaf
# Verify you're in the right directory
ls -la
# You should see: build.gradle.kts, nx.json, apps/, libs/, docs/, etc.
Install Dependenciesβ
# Install Node.js dependencies for frontend tools and documentation
npm install
# Verify Nx is working
nx --version
# Build all projects to verify setup
nx run-many --target=build --all
π³ Infrastructure Servicesβ
ACCI EAF uses Docker Compose to manage local infrastructure services. Let's start the required services.
Start Infrastructure Servicesβ
# Navigate to infrastructure directory
cd infra/docker-compose
# Start NATS and PostgreSQL services
docker compose up -d
# Verify services are running
docker compose ps
You should see output similar to:
NAME COMMAND SERVICE STATUS
nats "/nats-server --confβ¦" nats Up
postgres "docker-entrypoint.sβ¦" postgres Up
Service Detailsβ
NATS Message Brokerβ
- Port: 4222
- Management UI:
http://localhost:8222
- Connection String:
nats://localhost:4222
PostgreSQL Databaseβ
- Port: 5432
- Database:
eaf_db
- Username:
postgres
- Password:
password
- Connection String:
jdbc:postgresql://localhost:5432/eaf_db
Verify Infrastructureβ
# Test NATS connection
curl -s http://localhost:8222/varz | grep server_name
# Test PostgreSQL connection (requires psql client)
psql -h localhost -p 5432 -U postgres -d eaf_db -c "SELECT version();"
# Enter password: password
π Running Your First Serviceβ
Let's verify everything works by running the existing IAM service.
Start the IAM Serviceβ
# Navigate back to project root
cd ../..
# Start the IAM service
nx run iam-service:run
# Alternative: Use bootRun for Spring Boot specific features
nx run iam-service:bootRun
Verify Service is Runningβ
# In a new terminal, test the health endpoint
curl -s http://localhost:8080/actuator/health
# You should see:
# {"status":"UP"}
The service should start successfully and connect to the local infrastructure services automatically.
π§ IDE Configurationβ
IntelliJ IDEA Setupβ
Import Projectβ
- File β Open β Select the
acci-eaf
directory - Trust the Gradle project when prompted
- Wait for Gradle sync to complete
- Verify you see the project structure in the Project view
Configure Kotlinβ
- File β Settings β Languages & Frameworks β Kotlin
- Ensure Kotlin version matches project version
- Check Coroutines support is enabled
Configure Spring Bootβ
- Install Spring Boot plugin (Ultimate edition)
- File β Settings β Build β Build Tools β Gradle
- Set Build and run using: Gradle
- Set Run tests using: Gradle
Useful Settingsβ
# Enable annotation processing
File β Settings β Build β Compiler β Annotation Processors
β Enable annotation processing
# Configure code style
File β Settings β Editor β Code Style β Kotlin
Import scheme: Use Kotlin official style guide
# Configure ktlint
File β Settings β Tools β Actions on Save
β Reformat code
β Optimize imports
VS Code Setupβ
Open Projectβ
# In the project root
code .
Recommended Workspace Settingsβ
Create .vscode/settings.json
:
{
"typescript.preferences.importModuleSpecifier": "relative",
"editor.formatOnSave": true,
"editor.codeActionsOnSave": {
"source.fixAll.eslint": true
},
"files.exclude": {
"**/node_modules": true,
"**/dist": true,
"**/.nx": true
}
}
Install Extensionsβ
Use the Extension view (Ctrl+Shift+X) to install:
- ES7+ React/Redux/React-Native snippets
- TypeScript Hero
- Prettier - Code formatter
- ESLint
- GitLens
π§ͺ Verification Testsβ
Run these commands to ensure everything is working correctly:
Backend Testsβ
# Run all backend tests
nx run-many --target=test --projects=iam-service,eaf-core,eaf-eventing-sdk,eaf-eventsourcing-sdk
# Run specific service tests
nx test iam-service
# Check code quality
nx run-many --target=ktlintCheck --all
Frontend Testsβ
# Run UI Foundation Kit tests
nx test ui-foundation-kit
# Run Storybook to see components
nx storybook ui-foundation-kit
# Opens http://localhost:6006
Documentationβ
# Start The Launchpad documentation site
nx serve docs
# Opens http://localhost:3000
Full Integration Testβ
# Start infrastructure if not running
cd infra/docker-compose && docker compose up -d && cd ../..
# Start IAM service
nx run iam-service:run &
# Wait for service to start, then test
sleep 10
curl -s http://localhost:8080/actuator/health
# Stop the service
pkill -f iam-service
π Understanding the Project Structureβ
Your workspace should now look like this:
acci-eaf/
βββ apps/ # Application services
β βββ iam-service/ # Identity & Access Management service
βββ libs/ # Shared libraries
β βββ eaf-core/ # Core utilities and interfaces
β βββ eaf-eventing-sdk/ # NATS event publishing/consuming
β βββ eaf-eventsourcing-sdk/ # Event sourcing with PostgreSQL
β βββ eaf-iam-client/ # IAM client SDK
β βββ ui-foundation-kit/ # React component library
βββ tools/ # Development tools
β βββ acci-eaf-cli/ # Code generation CLI
βββ docs/ # Documentation (The Launchpad)
βββ infra/ # Infrastructure as Code
β βββ docker-compose/ # Local development services
βββ build.gradle.kts # Root Gradle build file
βββ nx.json # Nx workspace configuration
βββ package.json # Node.js dependencies
π Port Referenceβ
Keep track of these ports for local development:
Service | Port | URL | Purpose |
---|---|---|---|
IAM Service | 8080 | http://localhost:8080 | Main application |
NATS | 4222 | nats://localhost:4222 | Message broker |
NATS Management | 8222 | http://localhost:8222 | NATS monitoring |
PostgreSQL | 5432 | jdbc:postgresql://localhost:5432/eaf_db | Database |
Docs (Launchpad) | 3000 | http://localhost:3000 | Documentation |
Storybook | 6006 | http://localhost:6006 | UI components |
π§ Troubleshootingβ
Common Issuesβ
Docker Services Won't Startβ
# Check if ports are in use
lsof -i :4222 # NATS
lsof -i :5432 # PostgreSQL
# Stop conflicting services
docker compose down
# Clean Docker system (if needed)
docker system prune -a
Gradle Build Failuresβ
# Clean and rebuild
./gradlew clean build
# Check Java version
java -version
# Should be 17+
# Reset Gradle daemon
./gradlew --stop
Node.js Issuesβ
# Clear npm cache
npm cache clean --force
# Remove node_modules and reinstall
rm -rf node_modules package-lock.json
npm install
IDE Issuesβ
- IntelliJ: File β Invalidate Caches and Restart
- VS Code: Reload window (Ctrl+Shift+P β "Developer: Reload Window")
Getting Helpβ
If you're stuck:
- Check the Troubleshooting guide for detailed solutions
- Verify all prerequisites are correctly installed
- Ensure Docker services are running:
docker compose ps
- Check service logs:
docker compose logs <service-name>
π Successβ
You should now have:
- β Local repository cloned and dependencies installed
- β Infrastructure services running (NATS, PostgreSQL)
- β IAM service starting successfully
- β IDE configured and ready for development
- β All verification tests passing
π Next Stepsβ
Now you're ready to create your first EAF service! Continue to Your First Service to use the ACCI EAF CLI and learn about hexagonal architecture.
Great job! Your development environment is now ready for productive EAF development! π―