A comprehensive platform connecting donors with NGOs through geographic discovery and seamless donation management
π Live Demo: https://giveback-hub.vercel.app/
GiveBack Hub is a cutting-edge donation platform that bridges the gap between compassionate donors and impactful NGOs. Built with modern web technologies, it features smooth animations, interactive maps, comprehensive donation management, and powerful administrative tools.
- οΏ½οΈ cInteractive Map-Based NGO Discovery**
- οΏ½ dFlexible Donation System (Money & Items)
- οΏ½ Adveanced Pickup Service with scheduling & tracking
- οΏ½*οΈ Comprehensive Admin Dashboard
- π Secure Multi-Provider Authentication
- π± Fully Responsive Design
- β¨ Smooth Animations with GSAP & Barba.js
- π¨ Modern UI/UX with Tailwind CSS
- π Emergency Admin Access with secret key system
- Framework: Next.js 14.2.16 with App Router
- Language: TypeScript
- UI Library: React 18
- Styling: Tailwind CSS + Radix UI Components
- Maps: OpenStreetMap with Leaflet Integration
- Animations: GSAP + Barba.js + Custom CSS Animations
- Smooth Scrolling: Native CSS + GSAP ScrollTrigger
- API: Next.js API Routes
- Database: SQLite (Development) / PostgreSQL (Production Ready)
- ORM: Prisma 6.16.2
- Authentication: NextAuth.js (OAuth + Credentials)
- Email: Nodemailer
- Security: bcryptjs for password hashing
- Package Manager: npm
- Database Management: Prisma Studio
- Code Quality: ESLint + TypeScript
- Deployment: Vercel Ready
- Multi-provider authentication (Google OAuth)
- Credential-based login for administrators
- Role-based access control (USER vs ADMIN)
- Secure session management
- Emergency admin access with secret key system
- Password hashing with bcryptjs
- Profile management with location tracking
- Geographic data for map visualization
- Account security settings
- Admin-based NGO registration with secure registration key
- Interactive location selection with Maps
- Comprehensive NGO profile management
- Protected registration process using
ADMIN_SECRET_KEY
- NGO discovery on interactive maps
- Location-based filtering
- Visual representation of NGO presence
- Predefined and custom amounts
- Currency support (βΉ)
- One-time donation processing
- Category-based donation system
- Quantity and description fields
- Photo upload capabilities
- π€ AI-Powered Item Analysis (NEW!)
- Smart Image Recognition: Upload photos of donation items for automatic identification
- Gemini 1.5 Flash Integration: Powered by Google's advanced AI model
- Automatic Form Filling: AI identifies item name, category, and condition
- Validation System: Rejects inappropriate or non-donation items
- User-Friendly Interface: Simple upload β analyze β submit workflow
- Fallback Support: Manual entry option if AI analysis fails
- Schedule pickup date and time
- Address specification
- Special instructions for pickup team
- Status tracking (Scheduled β In Progress β Completed)
- Admin management dashboard
- Comprehensive statistics overview
- Donation management (approve/reject)
- User oversight and analytics
- Pickup service management with status updates
- NGO profile administration
- Email notifications for donation events
- Status update alerts
- Pickup service notifications
- Admin alerts for new donations
User- User accounts with role-based accessNGO- Non-governmental organizations profilesDonation- Donation records with pickup service dataAccount&Session- Authentication data
Role- USER, ADMINDonationType- MONEY, ITEMSDonationStatus- PENDING, APPROVED, REJECTEDPickupStatus- NOT_REQUIRED, SCHEDULED, IN_PROGRESS, COMPLETED, CANCELLED
- User β Donations (One-to-Many)
- User β NGO (One-to-One for admins)
- NGO β Donations (One-to-Many)
giveback-hub/
βββ app/ # Next.js App Router
β βββ admin/ # Admin dashboard
β βββ admin-signup/ # NGO registration
β βββ api/ # Backend API routes
β βββ auth/ # Authentication pages
β βββ dashboard/ # User dashboard
β βββ donate/ # Donation pages
β βββ map/ # NGO map discovery
β βββ page.tsx # Landing page
βββ components/ # Reusable components
β βββ ui/ # Base UI components
β βββ google-map.tsx # Map component
β βββ donation-form.tsx # Donation form
β βββ ...
βββ prisma/ # Database schema & migrations
β βββ schema.prisma # Database model
β βββ migrations/ # Migration history
βββ lib/ # Utility functions
βββ public/ # Static assets
- Node.js 18+ and npm
- Git
- OpenStreetMap and Leaflet (for map features)
-
Clone the repository
git clone https://github.com/your-username/giveback-hub.git cd giveback-hub -
Install dependencies
npm install
-
Set up environment variables Create a
.env.localfile with:# Database DATABASE_URL="file:./dev.db" # NextAuth.js NEXTAUTH_URL="http://localhost:3000" NEXTAUTH_SECRET="your-nextauth-secret-here" # Google OAuth (optional - can be configured later) GOOGLE_CLIENT_ID="your-google-client-id-here" GOOGLE_CLIENT_SECRET="your-google-client-secret-here" # Google Maps API Key (optional - now using OpenStreetMap) # NEXT_PUBLIC_GOOGLE_MAPS_API_KEY="your-google-maps-api-key" # Google Gemini AI API Key (required for AI-powered donation analysis) GEMINI_API_KEY="your-gemini-api-key" # Email (optional - can be configured later) EMAIL_SERVER_HOST="smtp.gmail.com" EMAIL_SERVER_PORT=587 EMAIL_SERVER_USER="your-email@gmail.com" EMAIL_SERVER_PASSWORD="your-app-password" EMAIL_FROM="your-email@gmail.com" # Admin Secret Key for Emergency Access ADMIN_SECRET_KEY="GIVEBACK_ADMIN_2024_SECRET"
-
Initialize the database
npx prisma generate npx prisma db push
-
Start the development server
npm run dev
-
Open your browser Visit
http://localhost:3000to see the application.
- Gemini 1.5 Flash Integration: Advanced AI model for image recognition
- Smart Item Identification: Automatically detects donation items from photos
- Auto-Form Filling: AI fills item name, category, and description
- Content Validation: Rejects inappropriate or non-donation content
- User Experience: Simple upload β analyze β submit workflow
- Fallback Support: Manual entry if AI analysis is unavailable
- Enhanced Animations: Integrated GSAP and Barba.js for smooth page transitions
- Smooth Scrolling: Native CSS smooth scrolling with GSAP ScrollTrigger
- Modern Design: Updated Tailwind CSS with custom animations and effects
- Interactive Elements: Hover effects, loading states, and micro-interactions
- Accessibility: Improved focus states and mobile touch targets
- Secret Key Login: Instant admin account creation with secure key
- Flexible Authentication: Multiple ways to access admin features
- Security Enhanced: Proper password hashing and session management
- Added pickup scheduling with date/time selection
- Integrated address specification and special instructions
- Implemented pickup status tracking
- Enhanced admin dashboard with pickup management
- Added urgent notification system for pending pickups
- Enhanced mobile experience across all devices
- Improved map interactions on small screens
- Streamlined donation process with better UX
- Visit
/auth/user-login - Sign in with Google or email/password
- Redirected to
/dashboard(personalized) - Click "π€ AI Donate" or visit
/donate-aifor AI-powered donations - Upload photo of donation item β AI analyzes and fills form
- Review AI suggestions and submit donation
- Receive email confirmation when status changes
Alternative Flow (Traditional):
- Click "Donate Now" or visit
/donate - Manually fill donation form (item, quantity, description)
- Submit and receive confirmation
- Visit
/auth/admin-login - Sign in with admin credentials
- Redirected to
/admin/dashboard - View pending donations in table
- Click "Approve" or "Reject" buttons
- Donor automatically receives email notification
- π³ Payment Gateway Integration (Stripe, Razorpay)
- π Real-time Notifications with WebSockets
- π± Native Mobile Application (React Native)
- π Advanced Analytics Dashboard with charts and insights
- π Multi-language Support (i18n)
- π± Social Media Integration for sharing donations
- π€ AI-powered NGO Recommendations
- π§ Advanced Email Templates and notifications
- π Advanced Search & Filtering for NGOs and donations
- π Impact Tracking and reporting system
- Role-based Authentication: Separate login flows for users and admins
- Route Protection: Middleware prevents unauthorized access
- Password Hashing: bcrypt with salt rounds
- Session Management: NextAuth handles JWT tokens
- Input Validation: Server-side validation for all forms
- Emergency Access: Secure admin creation with secret keys
- CSRF Protection: Built-in NextAuth CSRF protection
NEXTAUTH_URL=https://your-domain.com
DATABASE_URL="your-production-database-url"
EMAIL_SERVER_USER=your-production-email
EMAIL_SERVER_PASSWORD=your-production-email-password
NEXTAUTH_SECRET="your-strong-secret-key"
ADMIN_SECRET_KEY="your-admin-creation-secret"- Update environment variables
- Run
npx prisma generate - Run
npx prisma db push - Deploy to Vercel, Netlify, or your preferred platform
- Next.js team for the amazing framework
- Prisma team for the excellent ORM
- Tailwind CSS for the styling system
- Radix UI for accessible components
- GSAP for smooth animations
- OpenStreetMap & Leaflet for interactive maps
- All the NGOs and communities that inspired this project
This project is optimized for Vercel deployment with zero configuration:
π Complete Deployment Guide: See DEPLOYMENT.md for step-by-step instructions.
- Fork/Clone this repository
- Connect to Vercel via GitHub
- Add Environment Variables (see
.env.example) - Deploy - Vercel handles the rest!
- Database: PostgreSQL (Vercel Postgres recommended)
- Environment Variables: All variables from
.env.example - OpenStreetMap Integration: Free map service with Leaflet
- Domain: Custom domain supported
- Set up Vercel Postgres database
- Run database migrations
- Create admin account via
/auth/admin-secret - Register first NGO via
/admin-signup
Once deployed, your platform will include:
- π Landing Page - Modern hero section with smooth animations
- πΊοΈ Interactive Map - Discover NGOs by location
- π Donation System - Support NGOs with money or items
- π€ AI-Powered Donations - Smart item analysis and form filling
- οΏ½ Pickup Sebrvice - Schedule item pickups with tracking
- οΏ½ Useir Dashboard - Track donations and impact
- π Admin Dashboard - Comprehensive management tools
- π’ NGO Management - Complete NGO administration
- οΏ½ Securee Authentication - Multiple login options
- π± Mobile Responsive - Perfect on all devices