Consult is a web application that combines AI with human oversight to process public consultation responses at scale to inform public policy. Once consultation responses are uploaded to the app, the AI identifies themes across the responses using the themefinder package. Users review and finalise these themes — selecting, editing, or creating new ones — before AI assigns the finalised themes to individual responses. The results are presented in a dashboard for users to analyse and draw insights from.
The repository is split into a Django REST backend (backend/), an Astro and Svelte frontend (frontend/), AI processing pipelines that run on AWS Batch (pipeline-sign-off/, pipeline-mapping/), Lambda functions that sync pipeline results to the database (lambda/), and Terraform infrastructure (terraform/).
Important
Incubation Project: This project is an incubation project; as such, we don't recommend using this for critical use cases yet. We are currently in a research stage, trialling the tool for case studies across the Civil Service. If you are a civil servant and wish to take part in our research stage, please contact us at i-dot-ai-enquiries@cabinetoffice.gov.uk.
- pre-commit (
brew install pre-commit)
Installation instructions assume using a Mac with Homebrew.
git clone git@github.com:i-dot-ai/consult.git
In the new repo install pre-commit:
cd consult
pre-commit install
Pre-commit identifies some potential secrets on commit (but will not catch all potential sensitive information).
- Docker Desktop
- GraphViz (
brew install graphviz), used for generating database diagrams - pyenv (instructions)
- uv (instructions)
- Install the correct Python version by running
pyenv install - Install dependencies with
cd backend && uv sync - Populate
.envby copying.env.test
- Start PostgreSQL locally with
docker compose up -d postgres - Run
make dev_environmentto set up dev and test databases with dummy data. This will reset the database, apply migrations, generate dummy data, and create an admin user with the usernameemail@example.com. - Confirm everything is working with
make check_db
(You can see all the available make commands by running bare make or make help).
- Install nvm (instructions)
- Use the correct Node version by running
nvm installandnvm use - Install dependencies with
npm install - Create
frontend/.envand copy contents offrontend/.env.example
Start the backend:
make backend
This starts the API server and RQ workers via honcho. The backend will be available at http://localhost:8000.
Start the frontend:
make frontend
This starts the Astro dev server. The frontend will be available at http://localhost:3000.
To generate new migrations after changing models:
make migrations
To apply migrations:
make migrate
Running make migrate also regenerates the entity-relationship diagram at docs/erd.png (requires graphviz). The current schema:
Run backend tests:
make test-backend
Run frontend tests:
make test-frontend
Run end-to-end tests:
make test-end-to-end
This project includes VSCode configuration files to ensure consistent development experience:
.vscode/settings.json- Workspace settings for formatting, linting, and language support.vscode/extensions.json- Recommended extensions for the project
When you open the project in VSCode, you'll be prompted to install recommended extensions. These include:
- Python - Python language support with uv integration
- Ruff - Python linter and formatter
- ESLint - JavaScript/TypeScript linter
- Prettier - JavaScript/TypeScript code formatter
- Astro - Astro framework support
- Svelte - Svelte framework support
- Tailwind CSS IntelliSense - Tailwind CSS tooling
The workspace settings are configured to:
- Format code on save (using appropriate formatter per language)
- Auto-fix ESLint issues on save
- Enable TypeScript support in Svelte files
You can override these settings in your User Settings if you prefer different personal configurations. See the VSCode settings documentation for more information on the settings hierarchy.
