Skip to content

Repository files navigation

HopeConne## Node.js

MongoDB

🌐 Live Deployment

Note: The backend is hosted on Render's free tier and may sleep after 15 minutes of inactivity. First requests after sleep may take 40-60 seconds to wake up the server.

🌟 Features

✨ Modern UI/UXoyment

Note: The backend is hosted on Render's free tier and may sleep after 15 minutes of inactivity. First requests after sleep may take 40-60 seconds to wake up the server.NGO Volunteer Management Portal

⚠️ IMPORTANT NOTICE: The backend server is hosted on Render's free tier and may sleep after 15 minutes of inactivity. If you experience loading issues, please wait 40 seconds and refresh the page to wake up the server. For production use, consider upgrading to a paid hosting plan.

A modern, responsive web application built with the MERN stack for managing NGO volunteer applications. Features a beautiful glassmorphic design with comprehensive admin dashboard and seamless user experience.

Project Status React Node.js MongoDB

οΏ½ Live Deployment

Backend (Server)

  • Render (Free tier with sleep)
  • Vercel (For serverless functions)
  • DigitalOcean App Platform
  • Heroku (Paid only)
  • Database: MongoDB Atlas Free Tier

�🌟 Features

οΏ½ Modern UI/UX

  • Beautiful glassmorphic design with gradient backgrounds
  • Fully responsive mobile-first design
  • Smooth animations and transitions
  • Professional color scheme and typography

πŸ‘₯ Volunteer Registration

  • Comprehensive registration form with validation
  • 12 different volunteer interest categories
  • Real-time form validation with Zod schema
  • Success celebration with confetti animation

οΏ½ Admin Dashboard

  • Secure JWT-based authentication
  • Interactive analytics with Chart.js
  • Real-time search and filtering
  • CSV export functionality (bulk and individual)
  • Mobile-optimized admin interface

οΏ½ Analytics & Reports

  • Application trends over time
  • Interest area distribution charts
  • Weekly growth statistics
  • Exportable volunteer data

πŸ›  Tech Stack

Frontend

  • React 18 - Modern React with hooks and context
  • Vite - Fast build tool and development server
  • Tailwind CSS - Utility-first CSS framework
  • React Router DOM - Client-side routing
  • React Hook Form + Zod - Form management with schema validation
  • Chart.js + React Chart.js 2 - Interactive data visualization
  • Lucide React - Beautiful icon library
  • Canvas Confetti - Celebration animations

Backend

  • Node.js 20+ - JavaScript runtime environment
  • Express.js - Web application framework
  • MongoDB Atlas - Cloud database solution
  • Mongoose - MongoDB object modeling
  • JWT - JSON Web Token authentication
  • bcryptjs - Password hashing
  • Express Validator - Server-side validation
  • Helmet - Security middleware
  • CORS - Cross-origin resource sharing

πŸš€ Quick Start

Prerequisites

  • Node.js 18 or higher
  • MongoDB Atlas account (or local MongoDB)
  • Git

1. Clone Repository

git clone https://github.com/pentoshi007/HopeConnect.git
cd HopeConnect

2. Install Dependencies

# Install root dependencies
npm install

# Install client dependencies
cd client && npm install

# Install server dependencies
cd ../server && npm install

3. Environment Setup

Server Environment (.env)

Create server/.env file:

MONGODB_URI=mongodb+srv://your-username:your-password@cluster.mongodb.net/hopeconnect
JWT_SECRET=your_super_secret_jwt_key_minimum_32_characters_long
PORT=3001
NODE_ENV=development
ADMIN_EMAIL=admin@hopeconnect.org
ADMIN_PASSWORD=your_secure_admin_password
CORS_ORIGIN=http://localhost:5173

Client Environment (.env)

Create client/.env file:

VITE_API_URL=http://localhost:3001

4. Database Setup

The application will automatically:

  • Connect to MongoDB Atlas
  • Create necessary collections
  • Set up the admin user on first run

5. Run Development Servers

Option 1: Run both servers simultaneously

npm run dev

Option 2: Run servers separately

# Terminal 1 - Backend
cd server && npm run dev

# Terminal 2 - Frontend
cd client && npm run dev

Visit http://localhost:5173 to see the application.

πŸ“ Project Structure

ngo-internship/
β”œβ”€β”€ client/                     # React frontend
β”‚   β”œβ”€β”€ src/
β”‚   β”‚   β”œβ”€β”€ components/         # Reusable components
β”‚   β”‚   β”‚   β”œβ”€β”€ Navbar.jsx
β”‚   β”‚   β”‚   β”œβ”€β”€ Footer.jsx
β”‚   β”‚   β”‚   └── ProtectedRoute.jsx
β”‚   β”‚   β”œβ”€β”€ context/           # React context
β”‚   β”‚   β”‚   └── AuthContext.jsx
β”‚   β”‚   β”œβ”€β”€ hooks/             # Custom hooks
β”‚   β”‚   β”‚   └── useScrollAnimation.js
β”‚   β”‚   β”œβ”€β”€ pages/             # Page components
β”‚   β”‚   β”‚   β”œβ”€β”€ Home.jsx
β”‚   β”‚   β”‚   β”œβ”€β”€ Register.jsx
β”‚   β”‚   β”‚   β”œβ”€β”€ ThankYou.jsx
β”‚   β”‚   β”‚   β”œβ”€β”€ AdminLogin.jsx
β”‚   β”‚   β”‚   └── AdminDashboard.jsx
β”‚   β”‚   β”œβ”€β”€ App.jsx
β”‚   β”‚   β”œβ”€β”€ main.jsx
β”‚   β”‚   └── index.css
β”‚   β”œβ”€β”€ public/
β”‚   β”œβ”€β”€ package.json
β”‚   └── vite.config.js
β”œβ”€β”€ server/                     # Node.js backend
β”‚   β”œβ”€β”€ src/
β”‚   β”‚   β”œβ”€β”€ controllers/        # Route controllers
β”‚   β”‚   β”‚   β”œβ”€β”€ authController.js
β”‚   β”‚   β”‚   └── applicantController.js
β”‚   β”‚   β”œβ”€β”€ middleware/         # Custom middleware
β”‚   β”‚   β”‚   └── auth.js
β”‚   β”‚   β”œβ”€β”€ models/            # MongoDB models
β”‚   β”‚   β”‚   β”œβ”€β”€ AdminUser.js
β”‚   β”‚   β”‚   └── Applicant.js
β”‚   β”‚   β”œβ”€β”€ routes/            # API routes
β”‚   β”‚   β”‚   β”œβ”€β”€ authRoutes.js
β”‚   β”‚   β”‚   └── applicantRoutes.js
β”‚   β”‚   └── app.js
β”‚   β”œβ”€β”€ server.js
β”‚   β”œβ”€β”€ package.json
β”‚   └── .env.example
└── package.json               # Root package file

🎯 Available Scripts

Root Level

  • npm run dev - Run both client and server
  • npm run install:all - Install all dependencies
  • npm run build - Build client for production
  • npm start - Start production server

Client Scripts

  • npm run dev - Start development server
  • npm run build - Build for production
  • npm run preview - Preview production build
  • npm run lint - Run ESLint

Server Scripts

  • npm run dev - Start with nodemon
  • npm start - Start production server
  • npm run lint - Run ESLint

πŸ”§ API Endpoints

Public Routes

  • POST /api/applicants - Submit volunteer application
  • GET /health - Health check endpoint

Protected Admin Routes

  • POST /api/auth/login - Admin login
  • POST /api/auth/logout - Admin logout
  • GET /api/auth/verify - Verify JWT token
  • GET /api/applicants - Get all applications (admin only)

🎨 Volunteer Interest Categories

The application supports 12 volunteer interest areas:

  • Education & Literacy
  • Rural Development
  • Women Empowerment
  • Child Welfare
  • Healthcare & Sanitation
  • Environmental Conservation
  • Skill Development & Training
  • Elderly Care
  • Disaster Relief
  • Digital Literacy
  • Arts & Culture
  • Food Security & Nutrition

πŸ›‘οΈ Security Features

  • JWT-based authentication
  • Password hashing with bcryptjs
  • Input validation (client and server-side)
  • CORS protection
  • Rate limiting
  • Security headers with Helmet
  • Environment variable protection

πŸ“± Responsive Design

  • Mobile-first approach
  • Tailwind CSS breakpoints:
    • sm: 640px and up
    • md: 768px and up
    • lg: 1024px and up
    • xl: 1280px and up

πŸš€ Deployment

Production Environment Variables

Server

MONGODB_URI=your_production_mongodb_uri
JWT_SECRET=your_production_jwt_secret_32_chars_minimum
PORT=3001
NODE_ENV=production
ADMIN_EMAIL=your_admin_email
ADMIN_PASSWORD=your_secure_password
CORS_ORIGIN=https://your-frontend-domain.vercel.app

Client

VITE_API_URL=https://your-backend-domain.com

Current Deployment Setup

Frontend (Client)

  • Vercel - Fast, reliable frontend hosting with global CDN
  • Automatic deployments from GitHub
  • Custom domain support
  • Environment variables configured

Backend (Server)

  • Render - Free tier backend hosting (⚠️ May sleep after 15 minutes of inactivity)
  • Automatic wake-up on first request (takes ~40 seconds)
  • Direct GitHub integration
  • SSL certificates included

Database

  • MongoDB Atlas - Cloud database with free tier
  • Global availability and automatic backups
  • Secure connections and monitoring

Build Commands

Frontend Build

cd client
npm run build

Production Start

cd server
npm start

🀝 Contributing

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

πŸ“ License

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

πŸ‘₯ Team

Created with ❀️ for NGO volunteer management

πŸ“ž Support

For support and questions:


Note: Make sure to update the MongoDB connection string, JWT secret, and other environment variables before deploying to production. cd ngo-internship


2. **Install dependencies**
```bash
npm run install:all
  1. Set up environment variables

    # Copy and configure server environment
    cp server/.env.example server/.env
    
    # Update server/.env with your MongoDB URI and secrets
    # Update client/.env if needed for API URL
  2. Start development servers

    npm run dev

    This will start:

    • Client at http://localhost:5173
    • Server at http://localhost:3001

Environment Variables

Server (.env)

MONGODB_URI=your_mongodb_connection_string
JWT_SECRET=your_super_secret_jwt_key
PORT=3001
NODE_ENV=development
ADMIN_EMAIL=admin@ngo.com
ADMIN_PASSWORD=admin123
CORS_ORIGIN=http://localhost:5173

Client (.env)

VITE_API_URL=http://localhost:3001

Project Structure

ngo-internship/
β”œβ”€β”€ client/                 # React frontend
β”‚   β”œβ”€β”€ src/
β”‚   β”‚   β”œβ”€β”€ components/     # Reusable components
β”‚   β”‚   β”œβ”€β”€ pages/          # Page components
β”‚   β”‚   β”œβ”€β”€ context/        # React context
β”‚   β”‚   β”œβ”€β”€ hooks/          # Custom hooks
β”‚   β”‚   └── assets/         # Static assets
β”‚   β”œβ”€β”€ public/
β”‚   └── package.json
β”œβ”€β”€ server/                 # Express backend
β”‚   β”œβ”€β”€ src/
β”‚   β”‚   β”œβ”€β”€ controllers/    # Route handlers
β”‚   β”‚   β”œβ”€β”€ models/         # Mongoose models
β”‚   β”‚   β”œβ”€β”€ routes/         # API routes
β”‚   β”‚   β”œβ”€β”€ middleware/     # Custom middleware
β”‚   β”‚   └── app.js          # Express app
β”‚   β”œβ”€β”€ server.js           # Server entry point
β”‚   └── package.json
└── package.json            # Root package.json

API Endpoints

Public Endpoints

  • POST /api/applicants - Submit internship application
  • POST /api/auth/login - Admin login
  • GET /health - Health check

Protected Endpoints (Admin Only)

  • GET /api/applicants - List all applicants (with search/filter)
  • GET /api/applicants/:id - Get specific applicant
  • GET /api/auth/me - Get current admin user
  • POST /api/auth/logout - Admin logout

Admin Access

Default admin credentials:

⚠️ Important: Change the admin password in production!

Design System

Color Palette

  • --bg-main: #F7F9FC (Main background)
  • --bg-glass: rgba(255,255,255,0.15) (Glass effect)
  • --text-primary: #0F172A (Primary text)
  • --accent: #6366F1 (Accent color)
  • --accent-light: #A5B4FC (Light accent)
  • --error: #EF4444 (Error color)

Glassmorphism Effects

  • Backdrop blur: 20px
  • Border radius: 16px
  • Semi-transparent backgrounds
  • Subtle borders and shadows

Available Scripts

Root Directory

  • npm run dev - Start both client and server in development
  • npm run install:all - Install all dependencies
  • npm run build - Build client for production
  • npm run lint - Lint both client and server
  • npm run format - Format code with Prettier

Client Directory

  • npm run dev - Start Vite dev server
  • npm run build - Build for production
  • npm run preview - Preview production build
  • npm run lint - ESLint
  • npm run format - Prettier

Server Directory

  • npm run dev - Start with nodemon
  • npm start - Start production server
  • npm run lint - ESLint
  • npm run format - Prettier

Deployment

Frontend (Vercel)

  1. Push to GitHub
  2. Connect repository to Vercel
  3. Set build command: npm run build
  4. Set output directory: dist
  5. Add environment variable: VITE_API_URL=https://your-api-domain.com

Backend (Render)

  1. Push to GitHub
  2. Create new Web Service on Render
  3. Set build command: npm install
  4. Set start command: npm start
  5. Add environment variables from .env.example

Database

  • Use MongoDB Atlas (free tier available)
  • Whitelist your deployment server IPs
  • Use connection string in MONGODB_URI

Contributing

  1. Fork the repository
  2. Create a feature branch
  3. Make your changes
  4. Run linting and formatting
  5. Submit a pull request

License

MIT License - see LICENSE file for details

Support

For support or questions, please open an issue on GitHub.


Built with ❀️ using modern web technologies

About

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages