A comprehensive web-based asset management and resource tracking system designed for managing agriculture departments across South Punjab, Pakistan. The platform enables multiple agricultural research institutes, laboratories, and departments to efficiently manage their equipment inventory, track maintenance activities, and visualize asset data through role-based dashboards.
RAF-SP (Repair & Facility - Smart Platform) is a specialized government agriculture management system that consolidates and digitizes asset information from various agricultural departments across South Punjab. The system serves as a centralized platform for:
- 15+ Agricultural Departments including research institutes, testing laboratories, and university facilities
- Equipment & Asset Tracking for agricultural machinery, laboratory equipment, and research facilities
- Resource Management for staff, infrastructure, and departmental resources
- Real-time Analytics with interactive dashboards and data visualization
π https://raf-sp.vercel.app
The platform manages data for the following agriculture departments in South Punjab:
- Mango Research Institute (MRI) - Mango cultivation and post-harvest research
- Cotton Research Institute (CRI) - Cotton variety development and pest management
- Adaptive Research Center (ARC) - Agricultural research and development
- Entomological Research Sub-Station (ERSS) - Pest control and entomology research
- Agricultural Engineering - Farm mechanization and engineering solutions
- Agricultural Extension Wing - Farmer outreach and extension services
- Agricultural Mechanization Research Institute (AMRI) - Farm machinery research
- Floriculture Research Institute - Ornamental plants and landscaping research
- Regional Agricultural Research Institute (RARI) - Regional agricultural research
- Regional Agricultural Economic Development Centre (RAEDC) - Training and capacity building
- Pesticide Quality Control Laboratory - Pesticide testing and quality assurance
- Soil & Water Testing Laboratory - Soil and water analysis services
- Food Science & Technology Department (Muhammad Nawaz Shareef University of Agriculture) - Food processing research
- Agronomy Department (Muhammad Nawaz Shareef University of Agriculture) - Crop production and soil management
- Muhammad Nawaz Shareef University of Agriculture Estate - University farm management
- Secure NextAuth v5 authentication system
- Role-based access control (ADMIN, DEPT_HEAD)
- Department-specific user accounts with unique credentials
- Protected routes and API endpoints
- Customized Dashboards for each department type
- Real-time Statistics on equipment status and inventory
- Interactive Charts using Recharts for data visualization
- Equipment Status Tracking (Available, In Use, Needs Repair, Discarded)
- Maintenance History and repair logs
- Comprehensive equipment inventory tracking
- Machinery status monitoring (Functional/Non-functional)
- Laboratory equipment and infrastructure management
- Human resource tracking (staff positions and scales)
- Building and facility documentation
- Visual analytics with pie charts, bar graphs, and trend analysis
- Equipment utilization statistics
- Status-based filtering and sorting
- Export capabilities for reports
- CSV file upload for equipment data
- PDF parsing for document-based data entry
- Automated data processing and validation
- Government-themed landing page
- Responsive design for all devices
- Clean, professional interface using Shadcn UI components
- Smooth animations with Framer Motion
- Accessible and user-friendly navigation
- Framework: Next.js 16 (React 19)
- Styling: Tailwind CSS with custom government theme
- UI Components: Shadcn UI, Radix UI
- Animations: Framer Motion
- Charts: Recharts
- Forms: React Hook Form with Zod validation
- State Management: TanStack React Query
- Runtime: Node.js
- Framework: Next.js API Routes
- Authentication: NextAuth v5
- ORM: Prisma
- Database: PostgreSQL (via Supabase)
- File Parsing: PapaParse (CSV), pdf-parse (PDF)
- Hosting: Vercel
- Database: Supabase (PostgreSQL)
- Version Control: Git/GitHub
- Package Manager: npm
Before setting up the project, ensure you have:
- Node.js 18.x or higher
- npm or yarn package manager
- PostgreSQL database (or Supabase account)
- Git for version control
git clone https://github.com/AliAbdullahpgr/raf-sp.git
cd raf-spnpm installCreate a .env.local file in the root directory:
# Database Configuration
DATABASE_URL="postgresql://user:password@host:port/database"
# NextAuth Configuration
AUTH_SECRET="your-auth-secret-key-here"
NEXTAUTH_URL="http://localhost:3000"
# Supabase Configuration (Optional)
NEXT_PUBLIC_SUPABASE_URL="your-supabase-url"
NEXT_PUBLIC_SUPABASE_ANON_KEY="your-supabase-anon-key"Generate Prisma client and run migrations:
npx prisma generate
npx prisma db pushThe platform includes seeding scripts for all departments:
# Seed all departments
npm run seed
# Or seed specific departments
npm run seed:ento
ts-node scripts/seed-mri.ts
ts-node scripts/seed-cri.ts
ts-node scripts/seed-amri.ts
# ... and so on for other departmentsRun the admin creation SQL script in your database:
-- See create-admin.sql for full scriptnpm run devVisit http://localhost:3000 to access the application.
raf-sp/
βββ actions/ # Server actions for data mutations
βββ app/ # Next.js 14 app directory
β βββ (auth)/ # Authentication routes
β βββ admin/ # Admin dashboard
β βββ department/ # Department-specific pages
β βββ api/ # API routes
βββ components/ # React components
β βββ departments/ # Department-specific components
β βββ ui/ # Reusable UI components
β βββ ...
βββ lib/ # Utility functions and configurations
β βββ data/ # Static data files
β βββ ...
βββ prisma/ # Database schema and migrations
β βββ schema.prisma
βββ scripts/ # Database seeding scripts
β βββ seed-*.ts # Department-specific seeders
β βββ ...
βββ public/ # Static assets (images, logos)
βββ types/ # TypeScript type definitions
βββ ...
Each department has dedicated login credentials. See DEPARTMENT_LOGIN_CREDENTIALS.md for complete details.
Default Password: ChangeMe123! (All departments - to be changed on first login)
Sample Logins:
- MRI: abidhameedkhan@yahoo.com
- CRI: dircrimm@gmail.com
- AMRI: focalperson@amri.gov.pk
- Admin: admin@raf-sp.gov.pk
Note: Change all default passwords in production.
- Research equipment tracking
- Project management
- Staff and researcher details
- Publication records
- Lab equipment inventory
- Testing capacity tracking
- Quality control records
- Sample processing management
- Academic equipment tracking
- Laboratory management
- Student resource allocation
- Faculty details
- Farm machinery inventory
- Functional status monitoring
- Maintenance schedules
- Equipment specifications
# Development
npm run dev # Start development server
# Building
npm run build # Build for production
npm run start # Start production server
# Code Quality
npm run lint # Run ESLint
# Testing
npm run test # Run tests
npm run test:watch # Run tests in watch mode
# Database
npm run seed # Seed all department data
npm run seed:ento # Seed entomology dataThe application is optimized for deployment on Vercel:
- Push your code to GitHub
- Import the repository in Vercel
- Configure environment variables
- Deploy
For manual deployment:
npm run build
npm run start- Setup Guide: See
SUPABASE_SETUP.mdfor database configuration - Login Credentials: See
DEPARTMENT_LOGIN_CREDENTIALS.md - API Documentation: Available in
/app/apidirectory - Component Docs: JSDoc comments in component files
Contributions are welcome! Please follow these steps:
- Fork the repository
- Create a feature branch (
git checkout -b feature/AmazingFeature) - Commit your changes (
git commit -m 'Add some AmazingFeature') - Push to the branch (
git push origin feature/AmazingFeature) - Open a Pull Request
This project is developed for the Agriculture Department of South Punjab, Pakistan. All rights reserved.
For issues, questions, or support:
- Project Repository: https://github.com/AliAbdullahpgr/raf-sp
- Issues: GitHub Issues
- Agriculture Department, Government of Punjab
- MNS University of Agriculture, Multan
- All participating research institutes and laboratories
- Development team and contributors
Built with β€οΈ for South Punjab Agriculture Development