A modern web application for discovering, analyzing, and tracking government contracts and grants with powerful analytics and real-time market intelligence.
- Federal Contracts Browser: Search and filter through government contracts from SAM.gov
- Advanced Analytics:
- Spend Analysis by Geography, Agency, and NAICS codes
- Contractor Performance Analysis
- Dark Mode Support: Toggle between light and dark themes
- Real-time Search: Fast, responsive search with multiple filter options
- Responsive Design: Works seamlessly on desktop and mobile devices
- Frontend: Next.js 15, TypeScript, Tailwind CSS
- Backend: Next.js API Routes
- Database: PostgreSQL 15
- Container: Docker
- Node.js 18+
- Yarn package manager
- Docker Desktop
- PostgreSQL client (optional)
git clone <repository-url>
cd GovchimeCM
yarn install
Start PostgreSQL using Docker:
cd scripts
docker-compose up -d
Run the initialization script:
docker exec -i govchime_db psql -U govchime -d govchime < init.sql
docker exec -i govchime_db psql -U govchime -d govchime < update_schema.sql
To import contract data and NAICS codes:
pip install pandas openpyxl psycopg2-binary
python import_data.py ../data/FY2020_archived_opportunities.csv
Create a .env.local
file in the root directory:
DB_HOST=localhost
DB_PORT=5432
DB_NAME=govchime
DB_USER=govchime
DB_PASSWORD=govchime_secure_password
NEXT_PUBLIC_APP_NAME=GovChime
NEXT_PUBLIC_APP_DESCRIPTION=Government Contract Intelligence Platform
yarn dev
Open http://localhost:3000 to view the application.
├── src/
│ ├── app/ # Next.js app directory
│ │ ├── api/ # API routes
│ │ ├── contracts/ # Contract pages
│ │ ├── analytics/ # Analytics pages
│ │ └── ...
│ ├── components/ # React components
│ ├── lib/ # Utility functions
│ └── types/ # TypeScript types
├── scripts/ # Database and maintenance scripts
├── data/ # Data files
└── public/ # Static assets
GET /api/contracts
- Fetch contracts with filtersGET /api/contracts/filters
- Get available filter optionsGET /api/analytics/spend
- Spend analysis dataGET /api/analytics/contractors
- Contractor analysis dataGET /api/lookup
- Lookup state names and NAICS descriptions
The main contracts
table contains all government contract data with indexes for performance. Additional tables include:
naics_codes
- NAICS code descriptionsstates
- State code to name mappings- Materialized views for analytics performance
For production deployment:
-
Build the application:
yarn build
-
Start the production server:
yarn start
- Fork the repository
- Create your feature branch (
git checkout -b feature/amazing-feature
) - Commit your changes (
git commit -m 'Add some amazing feature'
) - Push to the branch (
git push origin feature/amazing-feature
) - Open a Pull Request
This project is licensed under the MIT License.