A full-stack web application that allows users to check the compliance status of nonprofit organizations using the Nonprofit Check Plus API.
Frontend: http://localhost:4200
Backend API: http://localhost:3001
Health Check: http://localhost:3001/health
- Authentication System: JWT-based login with role-based access
- Nonprofit Search: Search by EIN (Employer Identification Number)
- Compliance Status: Display BMF (Business Master File) and PUB78 verification status
- Detailed Information: Organization details, address, compliance flags, and additional metadata
- Search History: Track and export search queries
- Responsive Design: Modern UI built with Angular Material
- Docker Support: Containerized deployment with Docker Compose
- Angular 17 - Modern frontend framework
- Angular Material - UI component library
- RxJS - Reactive programming
- TypeScript - Type-safe JavaScript
- Node.js - JavaScript runtime
- Express.js - Web framework
- JWT - Authentication
- Axios - HTTP client
- Helmet - Security middleware
- CORS - Cross-origin resource sharing
- Docker - Containerization
- Docker Compose - Multi-container orchestration
- Nginx - Web server (production)
# 1) Backend
cd backend
cp env.example .env # add your NONPROFIT_API_KEY
npm install
node src/server.js # http://localhost:3001/health
# 2) Frontend (new terminal)
cd frontend
npm install
npm start # http://localhost:4200
- Node.js 18+
- npm or yarn
- Docker & Docker Compose (optional)
Windows:
setup.bat
Linux/Mac:
chmod +x setup.sh
./setup.sh
-
Clone the repository
git clone <repository-url> cd nonprofit-compliance-checker
-
Install dependencies
# Install all dependencies (frontend + backend) npm run install:all
-
Set up environment variables
# Copy backend environment file cp backend/env.example backend/.env # Edit backend/.env with your API key NONPROFIT_API_KEY=your-actual-api-key-here
-
Start the application
# Start both frontend and backend npm run dev
-
Access the application
- Frontend: http://localhost:4200
- Backend API: http://localhost:3001
-
Build and run with Docker Compose
# Build and start all services docker-compose up --build # Or run in background docker-compose up -d --build
-
Access the application
- Frontend: http://localhost:4200
- Backend API: http://localhost:3001
-
Admin User:
- Username:
admin
- Password:
admin123
- Role:
admin
- Username:
-
Regular User:
- Username:
user
- Password:
user123
- Role:
user
- Username:
POST /api/auth/login
- User loginPOST /api/auth/validate
- Validate JWT tokenGET /api/auth/profile
- Get user profilePOST /api/auth/refresh
- Refresh JWT token
POST /api/nonprofit/search
- Search by EIN or organization nameGET /api/nonprofit/:ein
- Get nonprofit by EIN
GET /api/history
- Get search historyGET /api/history/stats
- Get search statisticsDELETE /api/history
- Clear search historyGET /api/history/export
- Export history as CSV
GET /health
- Application health status
# Run all tests
npm test
# Run frontend tests
cd frontend && npm test
# Run backend tests
cd backend && npm test
nonprofit-compliance-checker/
βββ frontend/ # Angular application
β βββ src/
β β βββ app/
β β β βββ components/ # Angular components
β β β βββ services/ # Angular services
β β β βββ models/ # TypeScript interfaces
β β βββ assets/ # Static assets
β βββ package.json
βββ backend/ # Express.js API
β βββ src/
β β βββ routes/ # API routes
β β βββ middleware/ # Express middleware
β β βββ services/ # Business logic
β β βββ server.js # Main server file
β βββ package.json
βββ docker-compose.yml # Docker orchestration
βββ package.json # Root package.json
βββ README.md # This file
Backend (.env)
NODE_ENV=development
PORT=3001
JWT_SECRET=your-super-secret-jwt-key-change-in-production
NONPROFIT_API_BASE_URL=https://entities.pactman.org/api/entities/nonprofitcheck/v1
NONPROFIT_API_KEY=your-actual-api-key-here
RATE_LIMIT_WINDOW_MS=900000
RATE_LIMIT_MAX_REQUESTS=100
The application integrates with the Nonprofit Check Plus API:
- Base URL:
https://entities.pactman.org/api/entities/nonprofitcheck/v1
- Authentication: Bearer token
- Endpoint:
/us/ein/{ein}
{
"success": true,
"data": {
"organization": {
"name": "Sample Nonprofit",
"ein": "123456789",
"status": "Active",
"bmfStatus": "Active",
"pub78Status": "Active",
"address": "123 Main St",
"city": "Anytown",
"state": "CA",
"zipCode": "12345"
},
"compliance": {
"isCompliant": true,
"bmfCompliant": true,
"pub78Compliant": true,
"lastUpdated": "2024-01-01T00:00:00Z"
}
},
"timestamp": "2024-01-01T00:00:00Z"
}
-
API Integration:
- Using demo API key for development
- API supports EIN-based searches only
- Response structure matches provided sample
-
Authentication:
- JWT tokens with 24-hour expiration
- In-memory user storage (mock data)
- Role-based access control (admin/user)
-
Data Storage:
- In-memory storage for search history
- No persistent database (can be easily added)
-
Security:
- CORS enabled for localhost development
- Rate limiting implemented
- Helmet security headers
-
Deployment:
- Local development environment
- Docker containers for production readiness
- Nginx reverse proxy for frontend
-
Port already in use
# Kill processes on ports 3001 and 4200 npx kill-port 3001 4200
-
Frontend compilation errors
cd frontend npm install npm run build
-
Backend connection issues
cd backend npm install npm run dev
-
Docker issues
# Clean up Docker containers docker-compose down docker system prune -f docker-compose up --build
The login page features a clean, modern design with demo credentials provided for easy testing.
The main dashboard provides a tabbed interface for searching nonprofits and viewing search history.
Comprehensive results display showing organization information, compliance status, and source matches.
Detailed search history with statistics, export functionality, and pagination.
Note: Screenshots would be added here in a real deployment
# Install all dependencies
npm run install:all
# Start development servers
npm run dev
# Start only backend
npm run dev:backend
# Start only frontend
npm run dev:frontend
# Build for production
npm run build
# Run tests
npm test
# Docker commands
npm run docker:build
npm run docker:up
npm run docker:down
This project is for demonstration purposes. Please ensure you have proper API access and licensing for production use.
- Fork the repository
- Create a feature branch
- Make your changes
- Add tests
- Submit a pull request
For questions or issues, please contact the development team or create an issue in the repository.
Note: This application is designed for demonstration purposes. For production use, please implement proper security measures, database persistence, and error handling.