Skip to content

Vopwe/assistng

Repository files navigation

Assist.ng - Crowdfunding Platform for Nigeria

A modern crowdfunding platform built with Next.js, Supabase, and TailwindCSS, designed to help Nigerians raise funds for causes that matter.

Features

  • 🚀 Campaign creation and management
  • 💳 Secure payment processing with Paystack
  • 📹 Video uploads with Mux
  • 📱 SMS notifications with Twilio
  • 🔐 Identity verification with Dojah
  • 📊 Real-time analytics and leaderboards
  • 🎨 Modern, responsive UI design

Tech Stack

  • Frontend: Next.js 14, React, TailwindCSS
  • Backend: Next.js API Routes
  • Database: Supabase (PostgreSQL)
  • Authentication: Supabase Auth
  • File Storage: Supabase Storage
  • Payments: Paystack
  • Video: Mux
  • SMS: Twilio
  • Verification: Dojah
  • Error Tracking: Sentry
  • Deployment: Vercel

Getting Started

Prerequisites

  • Node.js 18+
  • npm or yarn
  • Supabase account
  • Paystack account
  • Mux account
  • Twilio account
  • Dojah account
  • Sentry account (optional)

Installation

  1. Clone the repository:
git clone https://github.com/yourusername/assistng.git
cd assistng
  1. Install dependencies:
npm install
  1. Set up environment variables:
cp .env.example .env.local
  1. Configure your environment variables in .env.local:
# Supabase
NEXT_PUBLIC_SUPABASE_URL=your_supabase_url
NEXT_PUBLIC_SUPABASE_ANON_KEY=your_supabase_anon_key
SUPABASE_SERVICE_ROLE_KEY=your_supabase_service_role_key

# Paystack
NEXT_PUBLIC_PAYSTACK_PUBLIC_KEY=your_paystack_public_key
PAYSTACK_SECRET_KEY=your_paystack_secret_key

# Mux
NEXT_PUBLIC_MUX_TOKEN_ID=your_mux_token_id
MUX_TOKEN_SECRET=your_mux_token_secret

# Twilio
TWILIO_ACCOUNT_SID=your_twilio_account_sid
TWILIO_AUTH_TOKEN=your_twilio_auth_token
TWILIO_PHONE_NUMBER=your_twilio_phone_number

# Dojah
DOJAH_API_KEY=your_dojah_api_key
DOJAH_APP_ID=your_dojah_app_id

# Application
NEXT_PUBLIC_APP_URL=https://your-app-domain.com

# Sentry (optional)
NEXT_PUBLIC_SENTRY_DSN=your_sentry_dsn
SENTRY_DSN=your_sentry_dsn
  1. Set up the database:
# Apply migrations to your Supabase project
supabase db push

# Test migrations (staging)
npm run test:migrations

# Test migrations (production)
npm run test:migrations:prod
  1. Run the development server:
npm run dev

Open http://localhost:3000 with your browser to see the result.

Project Structure

assistng/
├── app/                    # Next.js app directory
│   ├── api/               # API routes
│   ├── campaigns/         # Campaign pages
│   ├── create/            # Campaign creation page
│   ├── explore/           # Campaign listing page
│   ├── globals.css        # Global styles
│   └── layout.tsx         # Root layout
├── components/            # Reusable components
│   ├── CampaignCard.tsx   # Campaign card component
│   ├── DonationBox.tsx    # Donation form component
│   ├── Footer.tsx         # Footer component
│   └── Header.tsx         # Header component
├── contexts/              # React contexts
│   └── AuthContext.tsx    # Authentication context
├── lib/                   # Utility libraries
│   ├── auth.ts            # Authentication utilities
│   ├── sentry.ts          # Sentry configuration
│   ├── storage.ts         # Storage utilities
│   ├── supabase.ts        # Supabase client
│   └── utils.ts           # General utilities
├── scripts/               # Build and deployment scripts
│   └── test-migrations.js # Migration testing script
├── supabase/              # Supabase configuration
│   └── migrations/        # Database migrations
├── types/                 # TypeScript type definitions
│   └── database.ts        # Database types
├── .github/workflows/     # GitHub Actions workflows
│   ├── ci.yml             # Continuous integration
│   └── supabase-migrate.yml # Database migration
├── vercel.json            # Vercel configuration
└── package.json           # Project dependencies

API Routes

Authentication

  • POST /api/auth - General authentication endpoint
  • POST /api/auth/otp/send - Send OTP verification code
  • POST /api/auth/otp/verify - Verify OTP code

Campaigns

  • GET /api/campaigns - List campaigns
  • POST /api/campaigns - Create campaign
  • GET /api/campaigns/[id] - Get campaign details
  • PUT /api/campaigns/[id] - Update campaign
  • POST /api/campaigns/[id]/upload-video - Upload campaign video
  • GET /api/campaigns/categories - Get campaign categories

Donations

  • POST /api/donations/initiate - Initiate donation
  • POST /api/donations/webhook/paystack - Paystack webhook handler

Withdrawals

  • POST /api/withdrawals/request - Request withdrawal
  • POST /api/admin/withdrawals/[id]/approve - Approve withdrawal (admin)

Other

  • GET /api/fees - Get platform fees
  • GET /api/leaderboards - Get leaderboards
  • POST /api/upload/image - Upload image

Deployment

Vercel

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

The project is configured with separate environments for staging and production.

Database Migrations

Database migrations are automatically applied when pushing to the main or develop branches through GitHub Actions.

Testing

# Run tests
npm test

# Run tests in watch mode
npm run test:watch

# Test database migrations (staging)
npm run test:migrations

# Test database migrations (production)
npm run test:migrations:prod

Contributing

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

License

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

Support

For support, email support@assist.ng or create an issue on GitHub.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors