8000 GitHub - nestauk/discovery_policy_atlas: Prototyping an AI tool for exploring policy data
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

nestauk/discovery_policy_atlas

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

50 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

🌐 Policy Atlas

We're harnessing AI to improve policy design, helping users search, synthesise, and simulate policy interventions.

Find more information on the website.

⚠️ Heavily work-in-progress ⚠️

📋 Overview

Policy Atlas is a web application designed to streamline policy evidence exploration. Currently in prototype phase, it provides:

  • Search: Query academic and policy papers (coming soon)
  • Synthesis: AI-powered research synthesis across multiple sources (coming soon)
  • Simulation: Policy outcome modeling based on evidence (coming soon)

🛠️ Tech Stack

Frontend

  • Next.js 14 (App Router) - React framework
  • TypeScript - Type safety
  • Tailwind CSS - Styling
  • shadcn/ui - UI component library
  • NextAuth.js v5 - Authentication

Backend

  • FastAPI - Python web framework
  • uv - Python package manager
  • httpx - Async HTTP client
  • OpenAlex API - Academic paper database

📦 Prerequisites

Before you begin, ensure you have the following installed:

  • Node.js (v18 or higher)
  • Python (v3.10 or higher)
  • uv - Python package manager (install instructions)

🚀 Setup Instructions

1. Clone the Repository

git clone https://github.com/yo
8000
urusername/discovery_policy_atlas.git
cd discovery_policy_atlas

2. Frontend Setup

# Navigate to frontend directory
cd frontend

# Install dependencies
npm install --legacy-peer-deps

# Create environment file
cp .env.example .env.local

# Generate auth secret
openssl rand -base64 32
# Copy the output and add it to .env.local as AUTH_SECRET

# Your .env.local should look like:
# AUTH_SECRET=your-generated-secret-here
# NEXTAUTH_URL=http://localhost:3000

3. Backend Setup

# Open a new terminal and navigate to backend directory
cd backend

# Install dependencies using uv
uv sync

# Create environment file
cp .env.example .env

# Your .env should contain:
# OPENALEX_EMAIL=your-email@example.com  # Optional but recommended by OpenAlex

4. Running the Application

You'll need two terminal windows:

Terminal 1 - Backend:

cd backend
uv run python main.py
# Backend will run on http://localhost:8000
# API docs available at http://localhost:8000/docs

Terminal 2 - Frontend:

cd frontend
npm run dev
# Frontend will run on http://localhost:3000

5. Test the Application

  1. Open http://localhost:3000 in your browser
  2. Log in with test credentials:
    • Email: test@example.com
    • Password: password123
  3. Navigate to the Search tab
  4. Try searching for "heat pumps" or any academic topic

6. Pre-commit Hooks

The project uses pre-commit hooks to ensure code quality. The hooks are configured in backend/.pre-commit-config.yaml and handle both frontend and backend linting:

  • Backend: Uses Ruff for Python linting and formatting
  • Frontend: Uses ESLint for TypeScript/JavaScript linting

To set up pre-commit hooks:

# Navigate to backend directory
cd backend

# Install dev dependencies (includes pre-commit)
uv sync --dev

# Install the git hooks
uv run pre-commit install

# Check all files
uv run pre-commit run --all-files

�� Project Structure

discovery_policy_atlas/
│
├── backend/
│   ├── app/
│   │   ├── api/           # FastAPI routes (e.g., routes.py)
│   │   ├── core/          # Core models and config (models.py, config.py)
│   │   ├── services/      # Main backend services
│   │   ├── utils/         # Utility modules
│   │   └── ...
│   ├── main.py            
│   └── .venv/             # Python virtual environment
│
├── frontend/
│   ├── app/               # Next.js app directory
│   ├── components/
│   │   ├── search/        # Search-related React components
│   │   ├── ui/            # UI primitives/components
│   │   └── ...
│   ├── types/             # TypeScript types
│   ├── public/            # Static assets
│   ├── lib/               # Frontend utility libraries
│
├── docs/

📝 Environment Variables

Frontend (.env.local)

AUTH_SECRET=            # Generate with: openssl rand -base64 32
NEXTAUTH_URL=http://localhost:3000

Backend (.env)

OPENALEX_EMAIL=         # Your email (optional, for OpenAlex politeness)

🚧 Roadmap (tentative)

  • Search result screening and synthesis with LLMs
  • Database integration (PostgreSQL) and "project management" implementation
  • Real user authentication
  • PDF processing
  • Deployment to cloud

🤝 Contributing

This is currently a prototype. For major changes, please open an issue first to discuss what you would like to change.

📄 License

MIT License

About

Prototyping an AI tool for exploring policy data

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 2

  •  
  •  
0