Skip to content

openstate/lobbyregister

Repository files navigation

Lobbyregister

A demo for a lobby register application built with SvelteKit, tracking meetings between lobbyists and government officials.

Libraries used

Environment Setup

  1. Copy .env.example to .env and change mysecretpassword

  2. Install dependencies:

npm install
  1. Start database:
npm run db:dev
  1. 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
  1. Run development server:
npm run dev

Production

  1. Create docker-compose.yml from example:
cp docker-compose.example.yml docker-compose.yml
  1. Build application:
docker compose build
  1. Start application:
docker compose up -d
  1. Initialize and seed the database:
docker compose exec app npm run db:push
docker compose exec app npm run db:seed

Project Structure

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

Database Schema

The application tracks three main entities:

Organizations (organizations)

  • Lobbyist organizations (in-house, consultant, association)
  • Fields: name, type, sector, commercial status, address

Officials (officials)

  • Government officials who can attend meetings
  • Fields: name, type (minister, secretary, etc.), department

Meetings (meetings)

  • Lobby meetings between organizations and officials
  • Fields: date, type, location, description

Relationships

  • lobbyists: Individual lobbyists within organizations
  • organization_representatives: Client relationships for consultant firms
  • meeting_officials: Many-to-many between meetings and officials
  • meeting_lobbyists: Many-to-many between meetings and lobbyists
  • meeting_representatives: Tracks which clients are represented in meetings

Releases

No releases published

Sponsor this project

Packages

No packages published

Contributors 2

  •  
  •