Local Deployment
After completing Installation and Configuration, you’re ready to run Duit locally.Running the Application
Start the application
Use the Maven wrapper to run Duit:The application will start and you should see output similar to:
Building for Production
To create a production-ready JAR file:target/duit-0.0.1-SNAPSHOT.jar.
The
-DskipTests flag skips running tests during build. Remove it to run tests before packaging.Running the JAR
Once built, run the JAR file directly:Production Deployment
Duit can be deployed to various cloud platforms. The current production deployment uses Koyeb with a Neon PostgreSQL database.Environment Setup
Production Checklist
Deployment on Koyeb (Current Setup)
Duit is currently deployed on Koyeb at: https://duitapp.koyeb.app/Create a Koyeb account
Sign up at koyeb.com if you haven’t already.
Deploy from Git
- Click “Create App” in Koyeb dashboard
- Select “GitHub” as the deployment source
- Choose your Duit repository
- Configure build settings:
- Build command:
./mvnw clean package -DskipTests - Run command:
java -jar target/duit-0.0.1-SNAPSHOT.jar
- Build command:
PostgreSQL Database (Neon)
Duit uses Neon for production PostgreSQL hosting.Create a Neon project
- Sign up at neon.tech
- Create a new project
- Select your preferred region (e.g.,
us-east-2)
Alternative Deployment Options
Heroku
Deploy using Heroku’s Java buildpack with Heroku Postgres add-on.
Railway
Connect your GitHub repo and Railway will auto-deploy with built-in PostgreSQL.
AWS Elastic Beanstalk
Upload JAR file or deploy via CodePipeline with RDS PostgreSQL.
Docker
Containerize your application for deployment on any platform.
Docker Deployment (Optional)
Create aDockerfile in your project root:
Dockerfile
Health Monitoring
Duit includes Spring Boot Actuator for health monitoring.Actuator Endpoints
Access health information at:Configure additional actuator endpoints in
application.properties if needed. See Spring Boot Actuator documentation.Production Considerations
Security
- HTTPS: Always use HTTPS in production. Configure SSL certificates through your hosting provider.
- Secrets Management: Use environment variables or secret management services (AWS Secrets Manager, Vault, etc.).
- Database Backups: Enable automated backups on your PostgreSQL provider.
- Rate Limiting: Consider adding rate limiting for API endpoints.
Performance
- Connection Pooling: HikariCP is already configured with optimal settings.
- Caching: Enable Thymeleaf caching in production (
spring.thymeleaf.cache=true). - Logging: Reduce log levels in production to minimize I/O.
- CDN: Serve static assets through a CDN for better performance.
Monitoring
- Application Logs: Configure centralized logging (ELK stack, Splunk, Datadog).
- Database Monitoring: Monitor query performance and connection pool metrics.
- Uptime Monitoring: Use services like Pingdom, UptimeRobot, or StatusCake.
- Error Tracking: Integrate error tracking tools like Sentry or Rollbar.
Troubleshooting
Application fails to start
Application fails to start
Check:
- Database connection is accessible
- Environment variables are properly set
- Port 8080 is not in use
- Java 21 is being used
Database connection errors in production
Database connection errors in production
Common issues:
- Missing
?sslmode=requirein connection string for cloud databases - Firewall/security group blocking connections
- Incorrect credentials in environment variables
- Database instance is paused (Neon auto-pauses after inactivity)
OutOfMemoryError
OutOfMemoryError
Solution: Increase JVM heap size:Or configure in your deployment platform’s settings.
Slow performance
Slow performance
Check:
- Enable Thymeleaf caching:
spring.thymeleaf.cache=true - Review database query performance
- Verify HikariCP pool settings are appropriate
- Check if database connection limit is reached
Next Steps
With your application deployed, explore:- Features - Learn about Duit’s functionality
- Architecture - Understand the technical design
- Development Reference - Explore API endpoints and controllers
