A modern Next.js application for managing direct credit (Direktkredit) operations, built with TypeScript, Prisma, and Docker.
Before you begin, ensure you have the following installed on your system:
- Docker (version 20.10 or higher)
- Docker Compose (version 2.0 or higher)
- pnpm (version 8.0 or higher) - Installation Guide
- Node.js (version 20 or higher) - Required for local development tools
git clone <repository-url>
cd soliloanCreate your environment file from the example:
cp .env.example .envEdit the .env file and update the following variables with your actual values:
Required Configuration:
POSTGRES_PASSWORD: Set a secure password for your PostgreSQL databaseNEXTAUTH_SECRET: Generate a secure secret key (you can useopenssl rand -base64 32)SOLILOAN_DOMAIN: Your domain nameSOLILOAN_PROJECT_NAME: Your project nameSOLILOAN_ADMIN_EMAIL: Admin user emailSOLILOAN_ADMIN_PASSWORD: Admin user password
SMTP Configuration (for email functionality):
SMTP_HOST: Your SMTP server hostSMTP_PORT: SMTP port (usually 587 for TLS)SMTP_USER: Your email usernameSMTP_PASSWORD: Your email password or app-specific passwordSMTP_FROM: Sender email address
Use the provided Docker Compose command to start all services:
pnpm docker:dev upThis command will:
- Build the Next.js application
- Start PostgreSQL database
- Start Traefik reverse proxy
- Run database migrations
- Seed the database with initial data
- Start the development server
Once all services are running, you can access:
- Application: https://soliloan.localhost
- Traefik Dashboard: http://localhost:8080 (for debugging routing)
Note: Make sure to add
soliloan.localhostto your/etc/hostsfile:127.0.0.1 soliloan.localhost
# Start development environment
pnpm docker:dev up
# Start in background (detached mode)
pnpm docker:dev up -d
# View logs
pnpm docker:dev logs -f
# Stop all services
pnpm docker:dev down
# Rebuild and start (useful after dependency changes)
pnpm docker:dev up --build
# Access application container shell
pnpm docker:dev exec app shThe development setup automatically handles:
- Database schema migrations via Prisma
- Database seeding with initial data
- Hot reloading of database changes
For manual database operations:
# Access database directly
pnpm docker:dev exec postgres psql -U postgres -d soliloan
# Run Prisma commands inside container
pnpm docker:dev exec app pnpm prisma studio
pnpm docker:dev exec app pnpm prisma db push
pnpm docker:dev exec app pnpm prisma db seedThe development environment consists of three main services:
- Base Image: Node.js 20 with pnpm
- Port: 3000 (internal)
- Features:
- Hot reloading with Turbopack
- Volume mounting for live code changes
- Automatic dependency installation
- Database migration and seeding
- Image: Official PostgreSQL
- Port: 5432 (exposed for direct access)
- Features:
- Persistent data storage
- Development-optimized configuration
- Image: Traefik v2.11.2
- Ports: 80, 443, 8080
- Features:
- Automatic HTTPS with self-signed certificates
- Load balancing
- Development dashboard
1. Port Conflicts If you encounter port conflicts, check what's running on ports 80, 443, 5432, or 8080:
sudo lsof -i :80
sudo lsof -i :54322. Database Connection Issues Ensure PostgreSQL is fully started before the application:
pnpm docker:dev logs postgres3. Permission Issues If you encounter permission issues with Docker volumes:
sudo chown -R $USER:$USER .4. SSL Certificate Issues For local development, the application uses self-signed certificates. You may need to:
- Accept the certificate in your browser
- Add
soliloan.localhostto your hosts file
To completely reset your development environment:
# Stop and remove all containers, networks, and volumes
pnpm docker:dev down -v
# Remove any local changes to node_modules
rm -rf node_modules
# Restart fresh
pnpm docker:dev up --buildThis setup is optimized for development. For production deployment, refer to the staging configuration in docker/compose.staging.yml and ensure:
- Use production-grade secrets
- Configure proper SSL certificates
- Set up monitoring and logging
- Use external database services
- Configure proper backup strategies
- Fork the repository
- Create a feature branch
- Make your changes
- Test thoroughly with the development environment
- Submit a pull request
For issues and questions:
- Check the troubleshooting section above
- Review Docker and application logs
- Create an issue in the repository
Happy coding! 🎉