Skip to content

Latest commit

Β 

History

7 Commits

Folders and files

NameName
Last commit message
Last commit date
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

Revive - Volunteer & Disaster Relief Platform

Next.js TypeScript Prisma PostgreSQL Tailwind CSS Socket.IO

A comprehensive Next.js platform connecting volunteers with NGOs for disaster relief campaigns. Built with modern web technologies to facilitate efficient disaster response and community support.

Revive Platform

🌟 Features

πŸ‘₯ Volunteer Features

  • User Registration & Authentication - Secure signup with role-based access
  • Advanced Campaign Discovery - Filter by location, disaster type, urgency, and skills
  • Application System - Easy application process for disaster relief campaigns
  • Profile Management - Skills, availability, and impact tracking
  • Real-time Chat - Coordinate with NGOs and other volunteers during campaigns
  • Certificate Generation - Earn and download certificates for completed campaigns
  • Impact Dashboard - Track hours served, campaigns participated, and ratings
  • Review System - Rate and review campaigns and NGOs

🏒 NGO Features

  • Organization Registration - NGO verification and approval system
  • Campaign Management - Create, edit, and manage disaster relief campaigns
  • Volunteer Coordination - Review applications and manage volunteer assignments
  • Real-time Communication - Chat with approved volunteers during campaigns
  • Analytics Dashboard - Comprehensive reporting on campaign performance
  • Resource Management - Track equipment, supplies, and volunteer hours
  • Impact Reporting - Generate reports on disaster relief efforts

πŸ› οΈ Admin Features

  • NGO Verification - Approve/reject NGO registrations
  • User Management - Oversee platform users and activities
  • System Analytics - Platform-wide statistics and insights

🎯 Additional Features

  • Interactive Maps - Visualize campaign locations with Leaflet
  • File Upload System - Profile pictures and campaign images
  • Email Notifications - Automated emails for important updates
  • Real-time Notifications - In-app notifications with read status
  • Mobile Responsive - Optimized for all device sizes
  • Multi-role Authentication - Separate dashboards for volunteers, NGOs, and admins

πŸ› οΈ Tech Stack

Frontend

Backend

DevOps & Tools

  • Deployment: Vercel/Netlify ready
  • Linting: ESLint
  • Code Formatting: Prettier
  • Testing: Jest (setup ready)
  • Database Management: Prisma Studio

πŸš€ Getting Started

Prerequisites

  • Node.js 18.0 or higher
  • PostgreSQL 13.0 or higher
  • npm or yarn package manager
  • Git for version control

Installation

  1. Clone the repository

    git clone https://github.com/your-username/revive-nextjs.git
    cd revive-nextjs
  2. Install dependencies

    npm install
    # or
    yarn install
  3. Set up environment variables

    Create a .env file in the root directory:

    # Database
    DATABASE_URL="postgresql://username:password@localhost:5432/revive"
    
    # NextAuth.js
    NEXTAUTH_SECRET="your-super-secret-key-here"
    NEXTAUTH_URL="http://localhost:3000"
    
    # Email Configuration (optional)
    SMTP_HOST="smtp.gmail.com"
    SMTP_PORT="587"
    SMTP_USER="your-email@gmail.com"
    SMTP_PASSWORD="your-app-password"
    
    # Socket.IO (optional)
    NEXT_PUBLIC_SOCKET_URL="http://localhost:3000"
  4. Set up the database

    # Generate Prisma client
    npx prisma generate
    
    # Run database migrations
    npx prisma migrate dev
    
    # (Optional) Seed the database
    npx prisma db seed
  5. Create upload directories

    mkdir -p public/uploads/profiles
    mkdir -p public/uploads/campaigns
  6. Run the development server

    npm run dev
    # or
    yarn dev
  7. Open your browser

    Navigate to http://localhost:3000

πŸ“ Project Structure

revive-nextjs/
β”œβ”€β”€ app/                          # Next.js App Router
β”‚   β”œβ”€β”€ admin/                    # Admin dashboard pages
β”‚   β”œβ”€β”€ api/                      # API routes
β”‚   β”‚   β”œβ”€β”€ auth/                 # Authentication endpoints
β”‚   β”‚   β”œβ”€β”€ campaigns/            # Campaign management
β”‚   β”‚   β”œβ”€β”€ chat/                 # Real-time chat system
β”‚   β”‚   β”œβ”€β”€ certificates/         # Certificate generation
β”‚   β”‚   └── ...
β”‚   β”œβ”€β”€ campaigns/                # Campaign pages
β”‚   β”œβ”€β”€ explore/                  # Campaign discovery
β”‚   β”œβ”€β”€ login/                    # Authentication pages
β”‚   β”œβ”€β”€ ngo/                      # NGO dashboard
β”‚   └── profile/                  # Volunteer profile
β”œβ”€β”€ components/                   # React components
β”‚   β”œβ”€β”€ campaigns/                # Campaign components
β”‚   β”œβ”€β”€ chat/                     # Chat system components
β”‚   β”œβ”€β”€ home/                     # Homepage components
β”‚   β”œβ”€β”€ navigation/               # Navigation components
β”‚   β”œβ”€β”€ notifications/            # Notification components
β”‚   β”œβ”€β”€ profile/                  # Profile components
β”‚   └── ui/                       # Reusable UI components
β”œβ”€β”€ lib/                          # Utility functions
β”‚   β”œβ”€β”€ auth.ts                   # Authentication config
β”‚   β”œβ”€β”€ certificate.ts            # Certificate generation
β”‚   β”œβ”€β”€ email.ts                  # Email utilities
β”‚   β”œβ”€β”€ notifications.ts          # Notification system
β”‚   └── prisma.ts                 # Database client
β”œβ”€β”€ prisma/                       # Database schema & migrations
β”‚   β”œβ”€β”€ schema.prisma             # Database schema
β”‚   └── migrations/               # Database migrations
β”œβ”€β”€ public/                       # Static assets
β”‚   └── uploads/                  # User uploaded files
β”œβ”€β”€ types/                        # TypeScript type definitions
β”‚   └── next-auth.d.ts            # NextAuth type extensions
β”œβ”€β”€ server.js                     # Custom server with Socket.IO
β”œβ”€β”€ tailwind.config.ts            # Tailwind CSS configuration
β”œβ”€β”€ next.config.js                # Next.js configuration
└── package.json                  # Dependencies & scripts

πŸ—„οΈ Database Schema

The application uses Prisma ORM with PostgreSQL. Key models include:

Core Models

  • User - Authentication and role management
  • Volunteer - Volunteer profiles and skills
  • NGO - Organization profiles and verification
  • Campaign - Disaster relief campaigns
  • Application - Volunteer applications to campaigns

Activity Models

  • Chat - Real-time messaging between users
  • CheckIn - Volunteer location check-ins
  • VolunteerHours - Time tracking for campaigns
  • Task - Campaign task management
  • Resource - Equipment and supply tracking

Engagement Models

  • Review - Campaign and NGO reviews
  • Certificate - Achievement certificates
  • Badge - Volunteer achievement badges
  • Notification - In-app notifications

πŸ”Œ API Routes

Authentication

  • POST /api/auth/signin - User sign in
  • POST /api/auth/signup - User registration
  • POST /api/auth/signout - User sign out

Campaigns

  • GET /api/campaigns - List campaigns with filters
  • POST /api/campaigns - Create new campaign (NGO only)
  • GET /api/campaigns/[id] - Get campaign details
  • PUT /api/campaigns/[id] - Update campaign (NGO only)
  • DELETE /api/campaigns/[id] - Delete campaign (NGO only)

Applications

  • GET /api/applications - Get user's applications
  • POST /api/applications - Apply to campaign
  • PUT /api/applications/[id]/status - Update application status (NGO only)

Chat System

  • GET /api/chat?campaignId=X - Get chat messages
  • POST /api/chat - Send message
  • POST /api/chat/read - Mark messages as read

Certificates

  • GET /api/certificates - Get user's certificates
  • GET /api/certificates/campaigns - Get eligible campaigns for certificates
  • POST /api/certificates/generate - Generate certificate

Other

  • /api/notifications - Notification management
  • /api/upload - File upload handling
  • /api/analytics/* - Analytics and reporting

🎨 Design System

Color Palette

  • Primary: Coral Pink (#E27872) - Warm and approachable
  • Secondary: Soft Gold (#F8D57E) - Trust and reliability
  • Background: Cream (#FFF7E5) - Calming and professional
  • Text: Dark Charcoal (#2F2F2F) - High contrast and readability

Typography

  • Body: Outfit (sans-serif) - Clean and modern
  • Headings: Prata (serif) - Elegant and trustworthy

Components

  • Buttons: Consistent styling with hover states
  • Forms: Accessible forms with validation
  • Cards: Clean layouts with proper spacing
  • Navigation: Intuitive navigation patterns

πŸš€ Deployment

Vercel (Recommended)

  1. Connect your GitHub repository to Vercel
  2. Add environment variables in Vercel dashboard
  3. Set up PostgreSQL database (e.g., Neon, Supabase)
  4. Deploy automatically on push

Manual Deployment

  1. Build the application:

    npm run build
  2. Start production server:

    npm start

Environment Variables for Production

DATABASE_URL="postgresql://user:pass@host:5432/db"
NEXTAUTH_SECRET="your-production-secret"
NEXTAUTH_URL="https://your-domain.com"
SMTP_HOST="smtp.your-provider.com"
SMTP_PORT="587"
SMTP_USER="noreply@your-domain.com"
SMTP_PASSWORD="your-smtp-password"

🀝 Contributing

We welcome contributions! Please follow these steps:

  1. Fork the repository
  2. Create a feature branch
    git checkout -b feature/amazing-feature
  3. Commit your changes
    git commit -m 'Add amazing feature'
  4. Push to the branch
    git push origin feature/amazing-feature
  5. Open a Pull Request

Development Guidelines

  • Follow TypeScript best practices
  • Write meaningful commit messages
  • Add tests for new features
  • Update documentation as needed
  • Ensure code passes linting

About

Revive is a comprehensive Next.js platform connecting volunteers with NGOs for disaster relief campaigns. Built with modern web technologies to facilitate efficient disaster response and community support.

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages