-
-
Notifications
You must be signed in to change notification settings - Fork 0
Setup.md
This document covers local development environment setup and requirements.
| Software | Version | Purpose |
|---|---|---|
| .NET SDK | 9.0.300+ | Runtime and build tools |
| PostgreSQL | 16+ | Database |
| Docker | Latest | Containerized development |
| Git | 2.x+ | Version control |
| Software | Purpose |
|---|---|
| Visual Studio 2022 | IDE (Windows) |
| VS Code | Cross-platform IDE |
| Rider | JetBrains IDE |
| pgAdmin | PostgreSQL GUI |
| Postman | API testing |
git clone https://github.com/your-org/OpenCashFlow.git
cd OpenCashFlowdotnet --version
# Should output 9.0.300 or higherThe project uses a global.json file to enforce SDK version:
{
"sdk": {
"version": "9.0.300",
"rollForward": "latestFeature"
}
}Copy the example environment file:
cp .env.example .envEdit .env with your local values:
# Database connection
DEFAULT_CONN_STRING=Host=localhost;Database=opencashflow_db;Username=opencashflow;Password=your_password
# JWT Settings (generate a strong key for local development)
JWTSETTINGS__SECRETKEY=your_local_dev_jwt_secret_key_at_least_64_characters_long
# CORS (local development URLs)
CORS__ALLOWEDORIGINS__0=https://localhost:7001
CORS__ALLOWEDORIGINS__1=https://localhost:7002
# Application URLs
APPURL=https://localhost:7001docker compose -f docker-compose.dev.yml up -dThis starts:
- PostgreSQL 16 on port 5432
- pgAdmin on port 5050 (optional)
- Install PostgreSQL 16
- Create a database:
CREATE DATABASE opencashflow_db;
CREATE USER opencashflow WITH PASSWORD 'your_password';
GRANT ALL PRIVILEGES ON DATABASE opencashflow_db TO opencashflow;# From the repository root
dotnet ef database update \
--project src/OpenCashFlow.Shared/OpenCashFlow.Shared.csproj \
--startup-project src/OpenCashFlow.API/OpenCashFlow.API.csproj \
--context ApplicationDbContextOr use the helper script:
./scripts/create-migration.sh InitialCreate --applydotnet restore OpenCashFlow.slndotnet build OpenCashFlow.slnOpen multiple terminals:
Terminal 1 - API:
dotnet run --project src/OpenCashFlow.API/OpenCashFlow.API.csproj
# Runs on https://localhost:7002Terminal 2 - Web App:
dotnet run --project src/OpenCashFlow.App/OpenCashFlow.App.csproj
# Runs on https://localhost:7001Terminal 3 - Admin (optional):
dotnet run --project src/OpenCashFlow.Admin/OpenCashFlow.Admin.csproj
# Runs on https://localhost:7003- Web App: https://localhost:7001
- API: https://localhost:7002
- Swagger UI: https://localhost:7002/swagger
- Admin Panel: https://localhost:7003
# Start all services
docker compose up -d
# View logs
docker compose logs -f
# Stop all services
docker compose downThe docker-compose.yml defines:
services:
db:
image: postgres:16
environment:
POSTGRES_DB: opencashflow_db
POSTGRES_USER: opencashflow
POSTGRES_PASSWORD: ${DB_PASSWORD}
ports:
- "5432:5432"
volumes:
- postgres_data:/var/lib/postgresql/data
api:
build:
context: .
dockerfile: src/OpenCashFlow.API/Dockerfile
ports:
- "7002:443"
depends_on:
- db
app:
build:
context: .
dockerfile: src/OpenCashFlow.App/Dockerfile
ports:
- "7001:443"
depends_on:
- api- Open
OpenCashFlow.sln - Set multiple startup projects:
- Right-click Solution → Properties
- Select "Multiple startup projects"
- Set
OpenCashFlow.APIandOpenCashFlow.Appto "Start"
-
Install extensions:
- C# Dev Kit
- .NET Extension Pack
- PostgreSQL (optional)
-
Use provided launch configurations in
.vscode/launch.json -
Run using the debug panel (F5)
- Open the solution file
- Configure compound run configuration for API + App
ASP.NET Core uses development certificates. Trust them:
dotnet dev-certs https --trustIf you encounter certificate errors:
# Clean existing certificates
dotnet dev-certs https --clean
# Generate new trusted certificate
dotnet dev-certs https --trustFor local domain simulation, add to /etc/hosts (macOS/Linux) or C:\Windows\System32\drivers\etc\hosts (Windows):
127.0.0.1 app.opencashflow.local
127.0.0.1 api.opencashflow.local
127.0.0.1 admin.opencashflow.local
Then update appsettings.Development.json accordingly.
The initial migration includes seed data:
| Role | Purpose |
|---|---|
| Administrator | Full access to company resources |
| Employee | Standard user access |
| GIManagers | System-level admin (hidden) |
- Email: demo@opencashflow.local
- Password: DemoPassword123!
- Role: Administrator
- Cash
- Bank Transfer
- Credit Card
- PayPal
- Invoice
- Receipt
- Credit Note
- Other
Npgsql.NpgsqlException: Failed to connect
Solution:
- Verify PostgreSQL is running:
docker psor check service status - Check connection string in
.env - Ensure the database exists
- Check firewall/network settings
Build failed
Solution:
- Ensure the Shared project builds:
dotnet build src/OpenCashFlow.Shared - Check for missing packages:
dotnet restore - Verify .NET SDK version
System.IO.IOException: Failed to bind to address
Solution:
- Find the process:
lsof -i :7001(macOS/Linux) ornetstat -ano | findstr :7001(Windows) - Kill the process or use different ports in
launchSettings.json
Access-Control-Allow-Origin header is missing
Solution:
- Verify
CORS__ALLOWEDORIGINS__*environment variables - Ensure the App URL matches the allowed origins exactly
- Check that CORS middleware is configured before other middleware
- Read Architecture to understand the system design
- Review Configuration for environment setup
- Check DevelopmentWorkflow for contribution guidelines
Project status
OpenCashFlow is under active development.
APIs, database schema, and UI may change until the first stable release.
Built with
.NET · ASP.NET Core · Entity Framework Core · PostgreSQL · Tabler
© 2026 OpenCashFlow
- Developer Preview
- Not production-ready
- First-run setup included