Skip to content

perashanid/Camply

Repository files navigation

🎯 Camply - Campaign Platform

Empowering communities through blood donation and fundraising campaigns. Together, we can make a difference and save lives.

License: MIT React TypeScript Node.js

πŸ“‹ Table of Contents

🌟 Overview

Camply is a modern, full-stack campaign management platform that enables users to create, manage, and track both blood donation and fundraising campaigns. Built with React, TypeScript, and Node.js, it provides a seamless experience for campaign creators and donors alike.

Key Highlights

  • 🩸 Blood Donation Campaigns - Organize and track blood donation drives
  • πŸ’° Fundraising Campaigns - Create and manage fundraising initiatives
  • πŸ“Š Real-time Analytics - Track campaign performance with detailed insights
  • 🎨 Modern UI/UX - Beautiful, intuitive interface with dark mode support
  • πŸ“± Fully Responsive - Optimized for mobile, tablet, and desktop
  • πŸ€– AI-Powered - Smart content suggestions using Google Gemini AI
  • πŸ” Secure Authentication - JWT-based auth with Google OAuth support
  • 🎯 Progress Tracking - Real-time updates on campaign goals

✨ Features

Campaign Management

  • βœ… Create blood donation and fundraising campaigns
  • βœ… Upload campaign images with URL validation
  • βœ… Set goals and track progress in real-time
  • βœ… Edit campaign details with full history tracking
  • βœ… Toggle campaign visibility (public/private)
  • βœ… Delete campaigns with confirmation

User Features

  • βœ… User registration and authentication
  • βœ… Google OAuth integration
  • βœ… Personal dashboard with campaign overview
  • βœ… Campaign analytics and insights
  • βœ… Profile management
  • βœ… Dark/Light theme toggle

Advanced Features

  • βœ… AI-powered writing assistant for campaign descriptions
  • βœ… Image gallery for campaigns
  • βœ… Campaign edit history tracking
  • βœ… Progress update system
  • βœ… Campaign statistics and counters
  • βœ… Most visited campaigns showcase
  • βœ… Testimonial carousel
  • βœ… Responsive design for all devices

Analytics

  • βœ… Campaign performance metrics
  • βœ… View count tracking
  • βœ… Donation/contribution tracking
  • βœ… Time-based filtering (7 days, 30 days, all time)
  • βœ… Campaign type filtering
  • βœ… Visual charts and graphs

πŸ› οΈ Tech Stack

Frontend

  • React 18.3.1 - UI library
  • TypeScript 5.5.3 - Type safety
  • Vite 5.4.2 - Build tool
  • React Router 6.26.1 - Routing
  • Framer Motion 11.5.4 - Animations
  • React Icons 5.3.0 - Icon library
  • Recharts 2.12.7 - Charts and graphs

Backend

  • Node.js 20+ - Runtime
  • Express 4.19.2 - Web framework
  • PostgreSQL - Database
  • Drizzle ORM 0.33.0 - Database ORM
  • JWT - Authentication
  • Bcrypt - Password hashing

AI & External Services

  • Google Gemini AI - Content generation
  • Google OAuth 2.0 - Social authentication

Development Tools

  • ESLint - Code linting
  • Prettier - Code formatting
  • TypeScript - Type checking
  • Vite - Hot module replacement

πŸš€ Getting Started

Prerequisites

  • Node.js 20 or higher
  • PostgreSQL 14 or higher
  • npm or yarn package manager
  • Google OAuth credentials (optional)
  • Google Gemini API key (optional)

Installation

  1. Clone the repository
git clone https://github.com/perashaniD/camply.git
cd camply
  1. Install dependencies
# Install frontend dependencies
npm install

# Install backend dependencies
cd server
npm install
cd ..
  1. Set up environment variables

Create .env file in the root directory:

VITE_API_URL=http://localhost:3000
VITE_GOOGLE_CLIENT_ID=your_google_client_id
VITE_GEMINI_API_KEY=your_gemini_api_key

Create server/.env file:

DATABASE_URL=postgresql://user:password@localhost:5432/camply
JWT_SECRET=your_jwt_secret_key
GOOGLE_CLIENT_ID=your_google_client_id
GOOGLE_CLIENT_SECRET=your_google_client_secret
PORT=3000
  1. Set up the database
cd server
npm run db:push
npm run db:seed
cd ..
  1. Start the development servers

In one terminal (backend):

cd server
npm run dev

In another terminal (frontend):

npm run dev
  1. Open your browser
http://localhost:5173

Demo Credentials

For testing purposes, you can use:

πŸ“ Project Structure

camply/
β”œβ”€β”€ src/                          # Frontend source code
β”‚   β”œβ”€β”€ components/               # React components
β”‚   β”‚   β”œβ”€β”€ Header.tsx           # Navigation header
β”‚   β”‚   β”œβ”€β”€ Footer.tsx           # Footer component
β”‚   β”‚   β”œβ”€β”€ CampaignCard.tsx    # Campaign card component
β”‚   β”‚   β”œβ”€β”€ AIWritingAssistant.tsx
β”‚   β”‚   └── ...
β”‚   β”œβ”€β”€ pages/                   # Page components
β”‚   β”‚   β”œβ”€β”€ HomePage.tsx         # Landing page
β”‚   β”‚   β”œβ”€β”€ Dashboard.tsx        # User dashboard
β”‚   β”‚   β”œβ”€β”€ CampaignDetails.tsx  # Campaign details
β”‚   β”‚   └── ...
β”‚   β”œβ”€β”€ contexts/                # React contexts
β”‚   β”‚   β”œβ”€β”€ AuthContext.tsx      # Authentication context
β”‚   β”‚   └── ThemeContext.tsx     # Theme context
β”‚   β”œβ”€β”€ services/                # API services
β”‚   β”‚   β”œβ”€β”€ api.ts              # API client
β”‚   β”‚   └── gemini.ts           # AI service
β”‚   β”œβ”€β”€ styles/                  # Global styles
β”‚   β”‚   β”œβ”€β”€ themes.css          # Theme variables
β”‚   β”‚   β”œβ”€β”€ responsive.css      # Responsive styles
β”‚   β”‚   └── ...
β”‚   └── utils/                   # Utility functions
β”œβ”€β”€ server/                      # Backend source code
β”‚   β”œβ”€β”€ src/
β”‚   β”‚   β”œβ”€β”€ routes/             # API routes
β”‚   β”‚   β”‚   β”œβ”€β”€ auth.ts         # Authentication routes
β”‚   β”‚   β”‚   └── campaigns.ts    # Campaign routes
β”‚   β”‚   β”œβ”€β”€ db/                 # Database
β”‚   β”‚   β”‚   β”œβ”€β”€ schema.ts       # Database schema
β”‚   β”‚   β”‚   β”œβ”€β”€ seed.ts         # Seed data
β”‚   β”‚   β”‚   └── migrate.ts      # Migrations
β”‚   β”‚   └── index.ts            # Server entry point
β”‚   └── package.json
β”œβ”€β”€ public/                      # Static assets
β”œβ”€β”€ index.html                   # HTML template
β”œβ”€β”€ package.json                 # Frontend dependencies
β”œβ”€β”€ tsconfig.json               # TypeScript config
β”œβ”€β”€ vite.config.ts              # Vite config
└── README.md                    # This file

πŸ” Environment Variables

Frontend (.env)

Variable Description Required
VITE_API_URL Backend API URL Yes
VITE_GOOGLE_CLIENT_ID Google OAuth Client ID No
VITE_GEMINI_API_KEY Google Gemini API Key No

Backend (server/.env)

Variable Description Required
DATABASE_URL PostgreSQL connection string Yes
JWT_SECRET Secret key for JWT tokens Yes
GOOGLE_CLIENT_ID Google OAuth Client ID No
GOOGLE_CLIENT_SECRET Google OAuth Client Secret No
PORT Server port (default: 3000) No

πŸ“œ Available Scripts

Frontend

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

Backend

npm run dev          # Start development server with nodemon
npm run build        # Build TypeScript
npm run start        # Start production server
npm run db:push      # Push database schema
npm run db:seed      # Seed database with sample data
npm run db:studio    # Open Drizzle Studio

πŸ“± Mobile Responsive

Camply is fully responsive and optimized for all devices:

  • βœ… Mobile phones (320px - 768px)
  • βœ… Tablets (769px - 1024px)
  • βœ… Desktops (1025px+)
  • βœ… Portrait and landscape orientations
  • βœ… Touch-friendly interactions
  • βœ… Optimized for iOS Safari and Android Chrome

Key Mobile Features

  • Hamburger menu navigation
  • Touch-friendly buttons (44x44px minimum)
  • Responsive images and layouts
  • Optimized forms for mobile input
  • Fixed viewport height issues
  • Prevented zoom on input focus
  • Smooth scrolling and animations

For detailed mobile implementation, see MOBILE_RESPONSIVE_GUIDE.md

πŸ“š API Documentation

Authentication Endpoints

POST   /api/auth/register        # Register new user
POST   /api/auth/login           # Login user
POST   /api/auth/google          # Google OAuth login
GET    /api/auth/me              # Get current user

Campaign Endpoints

GET    /api/campaigns            # Get all campaigns
GET    /api/campaigns/:id        # Get campaign by ID
POST   /api/campaigns            # Create campaign
PUT    /api/campaigns/:id        # Update campaign
DELETE /api/campaigns/:id        # Delete campaign
PATCH  /api/campaigns/:id/visibility  # Toggle visibility
POST   /api/campaigns/:id/progress    # Update progress
GET    /api/campaigns/:id/history     # Get edit history

Analytics Endpoints

GET    /api/analytics/stats      # Get overall statistics
GET    /api/analytics/campaigns  # Get campaign analytics

🀝 Contributing

Contributions are welcome! Please follow these steps:

  1. Fork the repository
  2. Create a 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

Development Guidelines

  • Follow the existing code style
  • Write meaningful commit messages
  • Add tests for new features
  • Update documentation as needed
  • Ensure all tests pass before submitting PR

πŸ“„ License

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

πŸ‘¨β€πŸ’» Contact

Shanid Sajjatuz Islam

πŸ™ Acknowledgments

🌟 Features Roadmap

  • Email notifications
  • Payment gateway integration
  • Social media sharing
  • Campaign comments and reviews
  • Advanced search and filters
  • Multi-language support
  • PWA support
  • Mobile app (React Native)
  • Campaign categories and tags
  • User verification system

πŸ“Š Project Status

This project is actively maintained and under continuous development. Feel free to report issues or suggest new features!


Made with ❀️ by Shanid Sajjatuz Islam

⭐ Star this repo if you find it helpful!

About

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published