CRITICAL: Before deploying to production, read the security guides:
All production credentials have been secured and must be regenerated before deployment.
FlahaCalc is a professional web application for calculating evapotranspiration (ETo) using FAO-56 and ASCE methods. Built with modern TypeScript React architecture and enterprise-grade backend infrastructure.
- React 18 with TypeScript for type-safe development
- Redux Toolkit for state management
- React Router for client-side routing
- Material-UI for professional UI components
- Axios for API communication
- Express.js with TypeScript
- PostgreSQL with Prisma ORM
- JWT Authentication with refresh tokens
- Security Middleware (Helmet, CORS, Rate Limiting)
- Comprehensive API with OpenAPI documentation
- PostgreSQL for production data storage
- Prisma ORM for type-safe database operations
- Redis for session management and caching
- Docker for containerized deployment
- CI/CD with automated testing and deployment
- ✅ FAO-56 Penman-Monteith method
- ✅ ASCE Standardized Reference method
- ✅ Hourly, Daily, Monthly time scales
- ✅ Weather API Integration (OpenWeatherMap)
- ✅ EPW File Import for monthly calculations
- ✅ JWT Authentication with secure sessions
- ✅ User Profiles with subscription management
- ✅ Role-Based Access Control
- ✅ Password Reset with email verification
- 🆓 FREE: 50 calculations/month, basic features
- 💼 PRO: 500 calculations/month, advanced features
- 🏢 ENTERPRISE: Unlimited calculations, team features
- ✅ Calculation History with export capabilities
- ✅ Usage Analytics and reporting
- ✅ API Access for enterprise users
- ✅ Team Collaboration tools
- ✅ Custom Branding options
# Clone the repository
git clone https://github.com/rafatahmed/FlahaCalc.git
cd FlahaCalc
# Install dependencies
npm install
# Setup environment (automatically handled by scripts)
# Backend: Uses backend/.env for development
# Frontend: Uses frontend/.env.development automatically
# Start development servers
npm run dev:backend # Backend on port 3001
npm run dev:frontend # Frontend on port 3000
# Run tests
npm test# Build for production
npm run build
# Start production server
npm start
# Or use Docker
docker-compose up -dFlahaCalc/
├── backend/ # Node.js + Express backend
│ ├── src/
│ │ ├── controllers/ # API controllers
│ │ ├── middleware/ # Security & auth middleware
│ │ ├── models/ # Prisma models
│ │ ├── routes/ # API routes
│ │ ├── services/ # Business logic
│ │ └── utils/ # Utility functions
│ ├── prisma/ # Database schema & migrations
│ ├── tests/ # Backend tests
│ └── package.json
├── frontend/ # React TypeScript frontend
│ ├── src/
│ │ ├── components/ # React components
│ │ ├── hooks/ # Custom hooks
│ │ ├── pages/ # Page components
│ │ ├── services/ # API services
│ │ ├── store/ # Redux store
│ │ ├── types/ # TypeScript types
│ │ └── utils/ # Utility functions
│ ├── public/ # Static assets
│ └── package.json
├── docs/ # Documentation
├── docker/ # Docker configurations
└── scripts/ # Build & deployment scripts
- JWT tokens with secure headers
- Password complexity requirements
- Session management with refresh tokens
- Protected API endpoints
- Role-based access control
- Comprehensive input sanitization
- XSS attack prevention
- SQL injection protection
- Request size limiting
- User agent validation
- Threat detection patterns
- Progressive rate limiting
- Security audit logging
- CORS configuration
- Security headers enforcement
-
FREE Tier ($0/month)
- 50 calculations per month
- Basic weather data access
- Standard calculation methods
- Email support
-
PRO Tier ($24/month)
- 500 calculations per month
- Advanced weather data
- All calculation methods
- Priority support
- Export capabilities
-
ENTERPRISE Tier (Custom)
- Unlimited calculations
- Team collaboration
- API access
- Custom branding
- Dedicated support
POST /api/auth/login # User login
POST /api/auth/register # User registration
POST /api/auth/logout # User logout
GET /api/auth/verify # Verify session
POST /api/calculations # Create calculation
GET /api/calculations # Get calculation history
GET /api/calculations/:id # Get specific calculation
DELETE /api/calculations/:id # Delete calculation
GET /api/user/profile # Get user profile
PUT /api/user/profile # Update user profile
GET /api/user/usage # Get usage statistics
GET /api/user/subscription # Get subscription status
- ✅ Unit tests for all components
- ✅ Integration tests for API endpoints
- ✅ End-to-end tests for user workflows
- ✅ Performance tests for calculations
- ✅ Security tests for vulnerabilities
npm test # Run all tests
npm run test:unit # Unit tests only
npm run test:integration # Integration tests
npm run test:e2e # End-to-end tests
npm run test:coverage # Coverage report- Development: Local development with hot reload
- Staging: Pre-production testing environment
- Production: Optimized production deployment
- Native: Direct server deployment with Ansible
- DigitalOcean: Cloud hosting with automated deployment
- AWS/Azure: Enterprise cloud deployment
- On-Premise: Self-hosted deployment with native services
- User Guide - Complete user manual
- API Reference - REST API documentation
- Deployment Guide - Production deployment
- Developer Guide - Development setup
- Fork the repository
- Create a feature branch
- Make your changes
- Add tests for new functionality
- Submit a pull request
This project is licensed under the MIT License - see the LICENSE file for details.
Flaha Agri Tech is dedicated to providing innovative agricultural technology solutions. FlahaCalc represents our commitment to precision agriculture and sustainable water management.
Contact: eng.rafatahmed@hotmail.com Website: https://flahacalc.flaha.org