A demo for a lobby register application built with SvelteKit, tracking meetings between lobbyists and government officials.
- SvelteKit: Full-stack web framework with file-based routing
- Drizzle ORM: Type-safe SQL query builder for PostgreSQL
- TailwindCSS: Utility-first CSS framework
- Zod: Runtime type validation
- TypeScript: Static typing
- Prettier: Code formatting
-
Copy
.env.example
to.env
and changemysecretpassword
-
Install dependencies:
npm install
- Start database:
npm run db:dev
- Push schema and seed data:
npm run db:push
npm run db:seed
If you need to start over use the following to drop all tables (after which you can run push
and seed
again):
npm run db:drop_tables
- Run development server:
npm run dev
- Create docker-compose.yml from example:
cp docker-compose.example.yml docker-compose.yml
- Build application:
docker compose build
- Start application:
docker compose up -d
- Initialize and seed the database:
docker compose exec app npm run db:push
docker compose exec app npm run db:seed
src/
├── app.css # Global styles and TailwindCSS imports
├── app.html # HTML template
├── lib/ # Shared utilities
├── ├── components/ # Reusable Svelte components
│ └── server/ # Server-only utilities
│ └── db/ # Database schema, connection and seeding
└── routes/ # SvelteKit file-based routing
The application tracks three main entities:
- Lobbyist organizations (in-house, consultant, association)
- Fields: name, type, sector, commercial status, address
- Government officials who can attend meetings
- Fields: name, type (minister, secretary, etc.), department
- Lobby meetings between organizations and officials
- Fields: date, type, location, description
lobbyists
: Individual lobbyists within organizationsorganization_representatives
: Client relationships for consultant firmsmeeting_officials
: Many-to-many between meetings and officialsmeeting_lobbyists
: Many-to-many between meetings and lobbyistsmeeting_representatives
: Tracks which clients are represented in meetings