Skip to content

rayshivam30/REYOG

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

68 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

ReYog - Rural Governance Platform

Empowering rural governance through digital connectivity

🌐 Live Demo: https://team-smar.vercel.app

ReYog is a comprehensive digital platform designed to bridge the gap between rural citizens and their local government. It enables citizens to raise queries, track government services, and engage with panchayats and government offices in a transparent and efficient manner.

🌟 Features

For Citizens (Voters)

  • Query Management: Submit and track queries about government services
  • Location Services: Find nearby government offices with integrated maps
  • Real-time Updates: Get notifications about query status and progress
  • Rating & Reviews: Provide feedback on government services
  • Emergency SOS: Quick access to emergency contacts and services
  • Multi-language Support: Google Translate integration for accessibility

For Panchayats

  • Query Processing: Review, accept, and manage citizen queries
  • Office Management: Manage multiple government offices and departments
  • Progress Tracking: Update query status and provide progress reports
  • Budget Management: Track budget allocation and spending
  • Analytics Dashboard: View service statistics and performance metrics

For Administrators

  • User Management: Manage citizens, panchayats, and system users
  • System Oversight: Monitor platform usage and performance
  • Data Analytics: Comprehensive reporting and insights
  • Content Moderation: Review and moderate user-generated content

πŸ› οΈ Tech Stack

Frontend

  • Next.js 15 - React framework with App Router
  • TypeScript - Type-safe development
  • Tailwind CSS - Utility-first CSS framework
  • Radix UI - Accessible component primitives
  • Lucide React - Beautiful icons
  • React Hook Form - Form management with validation
  • Zod - Schema validation

Backend & Database

  • PostgreSQL - Primary database (hosted on Neon)
  • Prisma - Database ORM and migrations
  • NextAuth.js - Authentication system
  • JWT - Token-based authentication

Maps & Location

  • Leaflet - Interactive maps
  • React Leaflet - React components for Leaflet
  • Google Maps API - Location services and geocoding

File Storage & Media

  • Cloudinary - Image and file storage
  • Vercel Blob - Additional file storage

Additional Services

  • Google Translate - Multi-language support
  • React Query - Data fetching and caching
  • jsPDF - PDF generation for reports

πŸš€ Getting Started

Prerequisites

  • Node.js 18+
  • PostgreSQL database
  • Cloudinary account
  • Google Maps API key (optional)

Installation

  1. Clone the repository

    git clone <repository-url>
    cd reyog
  2. Install dependencies

    npm install
    # or
    pnpm install
  3. Set up environment variables Create a .env file in the root directory:

    # Database
    DATABASE_URL="postgresql://username:password@localhost:5432/reyog"
    
    # Authentication
    JWT_SECRET="your-jwt-secret-key"
    JWT_REFRESH_SECRET="your-refresh-secret-key"
    
    # Cloudinary (for file uploads)
    NEXT_PUBLIC_CLOUDINARY_CLOUD_NAME="your-cloud-name"
    NEXT_PUBLIC_CLOUDINARY_UPLOAD_PRESET="your-upload-preset"
    NEXT_PUBLIC_CLOUDINARY_API_KEY="your-api-key"
    CLOUDINARY_API_SECRET="your-api-secret"
    
    # Optional: Google Maps
    NEXT_PUBLIC_GOOGLE_MAPS_API_KEY="your-google-maps-key"
  4. Set up the database

    # Generate Prisma client
    npx prisma generate
    
    # Run database migrations
    npx prisma migrate dev
    
    # Seed the database with initial data
    npx prisma db seed
  5. Start the development server

    npm run dev
    # or
    pnpm dev
  6. Open your browser Navigate to http://localhost:3000

πŸ” Authentication & Authorization

User Roles

  • VOTER - Regular citizens who can submit queries
  • PANCHAYAT - Government staff who process queries
  • ADMIN - System administrators with full access

Test Credentials

For development and testing:

Admin Account:

  • Email: admin@reyog.gov.in
  • Password: password123

Panchayat Accounts:

  • indore.staff@reyog.gov.in
  • bhopal.staff@reyog.gov.in
  • jabalpur.staff@reyog.gov.in
  • gwalior.staff@reyog.gov.in
  • ujjain.staff@reyog.gov.in
  • Password: password123

πŸ—ΊοΈ Project Structure

reyog/
β”œβ”€β”€ app/                    # Next.js App Router
β”‚   β”œβ”€β”€ api/               # API routes
β”‚   β”œβ”€β”€ auth/              # Authentication pages
β”‚   β”œβ”€β”€ dashboard/         # Role-based dashboards
β”‚   β”œβ”€β”€ offices/           # Office directory
β”‚   └── globals.css        # Global styles
β”œβ”€β”€ components/            # React components
β”‚   β”œβ”€β”€ admin/            # Admin-specific components
β”‚   β”œβ”€β”€ auth/             # Authentication components
β”‚   β”œβ”€β”€ dashboard/        # Dashboard components
β”‚   β”œβ”€β”€ layout/           # Layout components
β”‚   β”œβ”€β”€ maps/             # Map components
β”‚   β”œβ”€β”€ offices/          # Office components
β”‚   β”œβ”€β”€ ui/               # Reusable UI components
β”‚   └── voter/            # Voter-specific components
β”œβ”€β”€ hooks/                # Custom React hooks
β”œβ”€β”€ lib/                  # Utility libraries
β”œβ”€β”€ prisma/               # Database schema and migrations
└── styles/               # Additional styles

πŸ”§ Available Scripts

# Development
npm run dev          # Start development server
npm run build        # Build for production
npm run start        # Start production server

# Database
npx prisma generate  # Generate Prisma client
npx prisma migrate   # Run database migrations
npx prisma db seed   # Seed database with test data
npx prisma studio    # Open Prisma Studio

# Testing
npm run test:redis   # Test Redis connection
npm run lint         # Run ESLint

🌐 Deployment

Vercel (Recommended)

  1. Connect your GitHub repository to Vercel
  2. Set environment variables in Vercel dashboard
  3. Deploy automatically on push to main branch

Manual Deployment

  1. Build the application: npm run build
  2. Set up PostgreSQL database
  3. Configure environment variables
  4. Run migrations: npx prisma migrate deploy
  5. Start the server: npm start

🀝 Contributing

  1. Fork the repository
  2. Create a feature branch: git checkout -b feature/new-feature
  3. Make your changes and commit: git commit -m 'Add new feature'
  4. Push to the branch: git push origin feature/new-feature
  5. Submit a pull request

Development Guidelines

  • Follow TypeScript best practices
  • Use Prettier for code formatting
  • Write meaningful commit messages
  • Test your changes thoroughly
  • Update documentation as needed

πŸ“ API Documentation

Authentication Endpoints

  • POST /api/auth/login - User login
  • POST /api/auth/register - User registration
  • POST /api/auth/logout - User logout

Query Management

  • GET /api/queries - Get user queries
  • POST /api/queries - Create new query
  • PUT /api/queries/[id] - Update query
  • DELETE /api/queries/[id] - Delete query

Office & Location Services

  • GET /api/offices - Get nearby offices
  • GET /api/departments - Get departments
  • GET /api/panchayats - Get panchayats

πŸ”’ Security Features

  • JWT-based authentication
  • Role-based access control
  • Input validation with Zod
  • SQL injection prevention with Prisma
  • CSRF protection
  • Secure file uploads with Cloudinary

🌍 Accessibility

  • Multi-language support via Google Translate
  • Keyboard navigation support
  • Screen reader compatibility
  • High contrast mode support
  • Mobile-responsive design

πŸ“± Mobile Support

ReYog is fully responsive and optimized for mobile devices, ensuring citizens can access government services from anywhere.

πŸ“„ License

This project is licensed under the MIT License - see the LICENSE file for details.

πŸ™ Acknowledgments

  • Built with Next.js and modern web technologies
  • Maps powered by Leaflet and OpenStreetMap
  • Icons by Lucide React
  • UI components by Radix UI
  • Hosted on Vercel with Neon PostgreSQL

ReYog - Connecting rural India with digital governance solutions.

About

Resources

License

Stars

0 stars

Watchers

0 watching

Forks

Releases

No releases published

Packages

 
 
 

Contributors