Setup & Usage Guide
This guide explains how to set up the Legislative Analysis system locally and how to use its features for analyzing Sri Lankan laws.
Prerequisites
Ensure you have the following installed on your system:
- Docker Desktop: For running the containerized application.
- Make: For executing build automation commands.
- Python 3.10+: (Optional) For running scripts directly if needed.
Quick Start
The entire system is containerized and orchestrated via docker-compose, abstracted behind simple Makefile commands.
1. Start the Cluster
To spin up both the FastAPI backend and the Next.js frontend, run:
make cluster-up
This command will:
- Build the Docker images for the frontend and backend.
- Start the containers in detached mode.
- Ensure the SQLite database is initialized.
2. Access the Application
Once the cluster is up, open your web browser and navigate to:
You will be greeted by the Legislative Analysis dashboard.
Using the System
Browsing Acts
The home page lists all analyzed acts. You can:
- Search: Filter acts by title or keyword.
- Filter: Select specific domains (e.g., Agriculture, Finance).
- View Details: Click on any act card to view its full analysis.
System Architecture in Action
When you browse the UI:
- Frontend: The Next.js app fetches data from the backend APIs.
- Backend: The FastAPI service queries the
research.dbSQLite database. - Data: The data you see was pre-processed using Google Gemini 2.0 Flash.
Shutting Down
To stop the services and ensure all data is safely dumped to disk:
make cluster-down
Note: This command automatically runs a data dump before stopping the containers, ensuring no analysis data is lost.
Troubleshooting
"Cluster not starting"
- Check if Docker Desktop is running.
- Ensure port
3000(Frontend) and8000(Backend) are free.
"Database cache missing"
- If the UI is empty, you may need to re-run the extraction or ensure the
data/research.dbfile exists.