Development Setup
This documentation page was initially generated by AI to bootstrap the documentation structure. Content may be incomplete or contain inaccuracies. We welcome contributions to improve it.
This guide will help you set up a local development environment for DELEGATOR.
Prerequisites
Before you begin, ensure you have:
- Node.js 20.x or later
- Bun (recommended) or npm/yarn
- Docker and Docker Compose
- Git
Getting the Code
Clone the repository:
git clone https://github.com/DeutscheModelUnitedNations/munify-delegator.git
cd munify-delegator
Installation
Install dependencies using Bun:
bun install
Or with npm:
npm install
Database Setup
DELEGATOR uses PostgreSQL. Start the database:
docker compose up -d postgres
Run database migrations:
bun run prisma migrate dev
Seed with sample data (optional):
bun run prisma db seed
Authentication Setup
DELEGATOR requires an OIDC provider.
Local Development
Use the included mock provider:
docker compose up -d mock-oidc
Production-like Setup
Configure your .env file:
OIDC_ISSUER=https://your-provider.com
OIDC_CLIENT_ID=your-client-id
OIDC_CLIENT_SECRET=your-client-secret
Recommended providers:
- ZITADEL
- Pocket-ID
- Logto
Environment Configuration
Create your .env file:
cp .env.example .env
Key variables:
| Variable | Description |
|---|---|
DATABASE_URL | PostgreSQL connection string |
OIDC_ISSUER | Authentication provider URL |
OIDC_CLIENT_ID | OAuth client ID |
OIDC_CLIENT_SECRET | OAuth client secret |
SESSION_SECRET | Session encryption key |
Running the Development Server
Start the development server:
bun run dev
The application will be available at http://localhost:5173.
Tech Stack
DELEGATOR is built with:
- Frontend: Svelte 5, SvelteKit
- Backend: Elysia
- Database: PostgreSQL with Prisma ORM
- Auth: OIDC
Running Tests
Run the test suite:
bun test
Common Issues
Database Connection
If you can't connect to the database:
- Ensure Docker is running
- Check
DATABASE_URLformat - Verify PostgreSQL container is healthy
Auth Issues
If authentication fails:
- Check OIDC configuration
- Verify redirect URLs match
- Check provider logs
Next Steps
- Contributing Guide - How to contribute
- GitHub Repository