A Next.js 14 application for tracking firearms legislation using server actions, Prisma, and SQLite.
- Track and monitor firearms legislation at both federal and state levels
- Filter bills by jurisdiction (federal/state), state, status, and keywords
- Integration with Congress.gov API for federal bills
- Integration with OpenStates API for state bills
- RSS feed integration for legislative updates
- Basic authentication system
- Responsive dashboard interface
- Framework: Next.js 14 with App Router
- Language: TypeScript
- Database: Prisma with SQLite
- Authentication: NextAuth.js v5 (beta)
- State Management: Zustand
- Styling: Tailwind CSS + shadcn/ui
- Form Handling: React Hook Form + Zod
- Node.js 18+ and npm
-
Clone the repository:
git clone https://github.com/yourusername/firetrack.git cd firetrack
-
Install dependencies:
npm install
-
Set up your environment variables:
cp .env.example .env
-
Update the
.env
file with your values:DATABASE_URL="file:./prisma/dev.db" NEXTAUTH_SECRET="your-secret-key-at-least-32-chars-long" NEXTAUTH_URL="http://localhost:3000"
-
Initialize the database:
npx prisma generate npx prisma db push
Run the development server:
npm run dev
Visit http://localhost:3000 to see the application.
For the MVP, use these credentials:
- Username: admin
- Password: password
firetrack/
├── app/ # Next.js app directory
│ ├── api/ # API routes
│ ├── auth/ # Auth-related pages
│ ├── components/ # React components
│ └── lib/ # Utility functions, hooks, etc.
├── prisma/ # Prisma schema and migrations
└── public/ # Static files
DATABASE_URL
: SQLite database URLNEXTAUTH_SECRET
: Secret key for NextAuth.js session encryptionNEXTAUTH_URL
: Base URL of your applicationCONGRESS_API_KEY
: API key from api.data.gov for Congress.gov API accessOPENSTATES_API_KEY
: API key for OpenStates API accessOPENSTATES_API_URL
: OpenStates API base URLMOCK_LLM_ANALYSIS
: Set to "true" for developmentRSS_FEED_URL
: URL for RSS feed (optional for MVP)
- Visit api.data.gov to sign up for an API key
- Add your API key to the
.env
file asCONGRESS_API_KEY
- Visit OpenStates.org to register for an API key
- Add your API key to the
.env
file asOPENSTATES_API_KEY
- The application uses SQLite for development but can be easily switched to PostgreSQL for production
- Authentication is implemented with basic credentials for MVP
- Both Congress.gov and OpenStates APIs are integrated for comprehensive bill tracking
- LLM analysis features use mock responses for MVP
- Rate limiting is implemented for both APIs to stay within usage limits
Test the Congress.gov API integration:
node scripts/test-congress-api.js
This will verify your API key and test the bill search and detail endpoints.