A comprehensive Smart Forest Rights Act (FRA) Atlas system with AI-powered document processing, interactive mapping, and decision support capabilities.
FRA/
βββ backend/ # FastAPI backend with AI/ML services
βββ frontend/ # React frontend application
βββ OCR/ # Standalone OCR processing service
βββ ARCHITECTURE.md # System architecture documentation
βββ README.md # This file
Before starting, ensure you have the following installed:
- Python 3.10+ (for backend and OCR services)
- Node.js 18+ (for frontend)
- PostgreSQL 14+ with PostGIS extension
- Git for version control
- Windows PowerShell or Command Prompt
- Install Python 3.10+
- Install Node.js 18+
- Install PostgreSQL with PostGIS
- Clone the repository
- Set up backend environment
- Set up frontend environment
- Configure database
- Start all services
# Download from https://python.org (Python 3.10 or higher)
# Verify installation
python --version
pip --version# Download from https://nodejs.org (LTS version)
# Verify installation
node --version
npm --version# Download from https://postgresql.org
# During installation, include PostGIS extension
# Note down the database credentialsgit clone https://github.com/ponnarasua/FRA.git
cd FRA# Verify all directories exist
ls
# Should show: backend/, frontend/, OCR/, README.md, ARCHITECTURE.mdcd backend# Create virtual environment
python -m venv fra_backend_env
# Activate virtual environment
# For PowerShell:
fra_backend_env\Scripts\Activate.ps1
# For Command Prompt:
fra_backend_env\Scripts\activate.bat
# Verify activation (should show (fra_backend_env) in prompt)# Upgrade pip first
python -m pip install --upgrade pip
# Install all backend dependencies
pip install -r requirements.txt
# This will install:
# - FastAPI and Uvicorn (web framework)
# - SQLAlchemy and Alembic (database)
# - PostGIS and GeoAlchemy2 (spatial data)
# - PaddleOCR (OCR processing)
# - SpaCy and Transformers (NLP)
# - Scikit-learn (machine learning)
# - And many more dependencies# Create database (run in PostgreSQL command line or pgAdmin)
# Replace 'your_password' with your actual password
createdb -U postgres fra_atlas_db
# Enable PostGIS extension (in psql or pgAdmin)
psql -U postgres -d fra_atlas_db -c "CREATE EXTENSION postgis;"# Create .env file in backend directory
# Copy the following content to .env file:
DATABASE_URL=postgresql://postgres:your_password@localhost:5432/fra_atlas_db
SECRET_KEY=your-secret-key-here-change-in-production
ALGORITHM=HS256
ACCESS_TOKEN_EXPIRE_MINUTES=30
ENVIRONMENT=development
DEBUG=True
CORS_ORIGINS=["http://localhost:5173", "http://localhost:3000"]# Initialize Alembic (if not done)
alembic init alembic
# Create initial migration
alembic revision --autogenerate -m "Initial migration"
# Apply migrations
alembic upgrade head# Download SpaCy English model
python -m spacy download en_core_web_sm
# Download additional models if needed
python -c "import nltk; nltk.download('punkt'); nltk.download('stopwords')"# Open new PowerShell window
cd "D:\New folder\FRA\frontend"# Install all frontend dependencies
npm install
# This will install:
# - React 19 and React DOM
# - Vite (build tool)
# - Tailwind CSS (styling)
# - React Router (navigation)
# - Chart.js (data visualization)
# - React Leaflet (mapping)
# - Axios (API calls)
# - And many more dependencies# Create .env file in frontend directory
# Add the following content:
VITE_API_BASE_URL=http://localhost:8000
VITE_APP_NAME=Smart FRA Atlas
VITE_APP_VERSION=1.0.0
VITE_MAPBOX_ACCESS_TOKEN=your_mapbox_token_herecd "D:\New folder\FRA\OCR"# Create separate environment for OCR
python -m venv Clean
# Activate environment
Clean\Scripts\Activate.ps1
# Install dependencies
pip install -r requirements.txt# In backend directory with activated virtual environment
cd "D:\New folder\FRA\backend"
fra_backend_env\Scripts\Activate.ps1
# Start FastAPI server
uvicorn app.main:app --reload --host 0.0.0.0 --port 8000
# Server will start at: http://localhost:8000
# API docs available at: http://localhost:8000/docs# In new PowerShell window - frontend directory
cd "D:\New folder\FRA\frontend"
# Start Vite development server
npm run dev
# Frontend will start at: http://localhost:5173# In new PowerShell window - OCR directory
cd "D:\New folder\FRA\OCR"
Clean\Scripts\Activate.ps1
# Start OCR service
python main.py
# OCR service will start at specified portOnce all services are running:
-
Frontend Application: http://localhost:5173
- Main user interface
- Dashboard, Atlas, Analytics, etc.
-
Backend API: http://localhost:8000
- REST API endpoints
- Interactive documentation at: http://localhost:8000/docs
-
Database: localhost:5432
- PostgreSQL with PostGIS
- Database name: fra_atlas_db
# Test API health endpoint
curl http://localhost:8000/api/system/health
# Or visit in browser:
# http://localhost:8000/docs# Visit in browser:
# http://localhost:5173
# Should show Smart FRA Atlas dashboard# Connect to database
psql -U postgres -d fra_atlas_db
# List tables
\dt
# Check PostGIS
SELECT PostGIS_Version();# If pip install fails, try:
pip install --upgrade pip setuptools wheel
pip install -r requirements.txt --no-cache-dir# Check PostgreSQL service is running
Get-Service -Name postgresql*
# Test database connection
psql -U postgres -h localhost -p 5432 -d fra_atlas_db# Kill process on port 8000
netstat -ano | findstr :8000
taskkill /PID <PID_NUMBER> /F
# Or use different port
uvicorn app.main:app --reload --port 8001# Clear npm cache and reinstall
npm cache clean --force
rm -rf node_modules package-lock.json
npm install# Kill process on port 5173
netstat -ano | findstr :5173
taskkill /PID <PID_NUMBER> /F
# Or Vite will automatically use next available port# Check backend is running
curl http://localhost:8000/api/system/health
# Verify CORS settings in backend .env file# If activation fails
Set-ExecutionPolicy -ExecutionPolicy RemoteSigned -Scope CurrentUser
# Then try activating again
fra_backend_env\Scripts\Activate.ps1# Run PowerShell as Administrator if needed
# Check file permissions in project directory- Real-time FRA claim statistics
- Recent activity feed
- Quick action buttons
- Performance metrics visualization
- Geographic visualization of claims
- Multiple map layers (satellite, boundaries)
- Spatial search and filtering
- Claim status visualization
- Drag-and-drop file upload
- Automatic text extraction
- Entity recognition (names, places, dates)
- Document processing statistics
- Comprehensive claim analytics
- Processing time analysis
- Geographic distribution
- Trend analysis and forecasting
- Export capabilities
- Automated claim recommendations
- Risk assessment scoring
- Evidence-based reasoning
- Processing time predictions
- Use strong passwords for database
- Change default secret keys
- Enable CORS only for development URLs
- Keep dependencies updated
- Use environment variables for secrets
- Enable HTTPS/SSL
- Configure proper CORS origins
- Set up database backups
- Monitor system logs
- Check this README for common issues
- Review the ARCHITECTURE.md file
- Check individual service README files
- Create GitHub issues for bugs
- Contact development team
# Backend
cd backend
fra_backend_env\Scripts\Activate.ps1
uvicorn app.main:app --reload
# Frontend
cd frontend
npm run dev
# Database migrations
alembic upgrade head
# Install new Python package
pip install package_name
pip freeze > requirements.txt
# Install new Node package
npm install package_name- Access the Dashboard at http://localhost:5173
- Explore the Atlas for interactive mapping
- Upload test documents to try OCR functionality
- Review analytics for system insights
- Check DSS recommendations for AI features
- β Backend API with 50+ endpoints
- β Frontend React application
- β Database models and migrations
- β AI/ML services integration
- β Interactive mapping
- β Document processing pipeline
- β Analytics and reporting
- β Decision support system
The Smart FRA Atlas is ready for development and testing! π