A .NET Core 8 backend API for Live Employee Retention Dashboard (LERD) with Supabase PostgreSQL integration.
- .NET 8.0 SDK
- Supabase account
- Git
- test
-
Clone the repository
git clone <repository-url> cd livedashboard-stage1-backend
-
Configure environment variables
cp .env.example .env # Edit .env with your Supabase credentials -
Install dependencies
dotnet restore
-
Run the application
cd LERD_Backend dotnet run -
Test the API
- Open
LERD_Backend/organizations-test.httpin VS Code - Or visit: http://localhost:5153/api/health
- Open
├── LERD_Backend/ # 🎯 API Layer (Controllers, Startup)
├── LERD.Application/ # 🔧 Business Logic (Services, Interfaces)
├── LERD.Domain/ # 📦 Core Entities (Models, Domain Logic)
├── LERD.Infrastructure/ # 🗄️ Data Access (DbContext, Repositories)
├── LERD.Shared/ # 🔗 Shared Models (DTOs, Constants)
├── .env.example # 📝 Environment Configuration Template
└── organizations-test.http # 🧪 API Testing File
GET /api/health- Basic health checkGET /api/health/database-simple- Database connectivity testGET /api/health/debug- Connection configuration info
GET /api/organizations- List all organizations (paginated)GET /api/organizations/{id}- Get organization by IDPOST /api/organizations- Create new organizationPATCH /api/organizations/{id}- Update organizationDELETE /api/organizations/{id}- Soft delete organization
SUPABASE_DB_HOST=aws-1-ap-southeast-2.pooler.supabase.com
SUPABASE_DB_PORT=5432SUPABASE_DB_HOST=aws-1-ap-southeast-2.pooler.supabase.com
SUPABASE_DB_PORT=6543{
"success": true,
"message": "",
"data": {
// Response payload
}
}Use the provided HTTP test file:
# Open in VS Code with REST Client extension
code LERD_Backend/organizations-test.httpOr test with curl:
# Health check
curl http://localhost:5153/api/health
# Get organizations
curl http://localhost:5153/api/organizations- Environment variables for sensitive data
- UUID-based entity identifiers
- Soft delete for data preservation
- Input validation on all endpoints
- Make changes to the code
- Test locally using the HTTP test file
- Run health checks to ensure database connectivity
- Commit and push changes
- Smart Pagination: Avoids expensive COUNT queries
- Connection Pooling: Optimized for Supabase
- Efficient Queries: Minimal database round trips
- Error Handling: Comprehensive exception management
- Create a feature branch
- Make your changes
- Test all endpoints
- Submit a pull request
See .env.example for required configuration:
SUPABASE_URL- Your Supabase project URLSUPABASE_ANON_KEY- Supabase anonymous keySUPABASE_DB_HOST- Database host (pooler)SUPABASE_DB_PORT- Database port (5432 or 6543)SUPABASE_PASSWORD- Database password
- .NET 8.0 - Backend framework
- Entity Framework Core - ORM
- Npgsql - PostgreSQL driver
- Supabase - Backend-as-a-Service
- DotNetEnv - Environment variable management
For detailed implementation notes, see RELEASE_NOTES.md