A web platform where users can create charity-based dares, pledge money, and make a difference. Users create dares with monetary pledges, others can vote and comment, and money goes to charity based on dare completion.
- User authentication with Firebase
- Create and manage dares with charity integration
- Secure payment processing with Stripe
- Voting and commenting system
- Image generation for dares
- Admin dashboard for platform management
- Real-time notifications
- Responsive design
- Multi-tier payment flow (platform fees, Stripe fees, charity amounts)
- React 18 with TypeScript
- Tailwind CSS for styling
- Firebase Auth for authentication
- React Router v6 for routing
- Formik & Yup for form validation
- React Hot Toast for notifications
- Stripe Elements for payments
- Axios for API calls
- Node.js with Express
- TypeScript for type safety
- MongoDB with Mongoose
- Firebase Admin SDK
- Stripe API integration
- Node-cron for scheduled tasks
- Winston for logging
- Express-validator for input validation
- Node.js (v18 or higher)
- npm or yarn
- MongoDB database
- Firebase account
- Stripe account
- Clone the repository:
git clone <repository-url>
cd dare2do- Install dependencies:
# Install frontend dependencies
cd frontend
npm install
# Install backend dependencies
cd ../backend
npm install- Set up environment variables:
Create a .env file in the frontend directory with the following variables:
REACT_APP_API_URL=http://localhost:3001/api
REACT_APP_FIREBASE_API_KEY=your_firebase_api_key
REACT_APP_FIREBASE_AUTH_DOMAIN=your_firebase_auth_domain
REACT_APP_FIREBASE_PROJECT_ID=your_firebase_project_id
REACT_APP_FIREBASE_STORAGE_BUCKET=your_firebase_storage_bucket
REACT_APP_FIREBASE_MESSAGING_SENDER_ID=your_firebase_messaging_sender_id
REACT_APP_FIREBASE_APP_ID=your_firebase_app_id
REACT_APP_STRIPE_PUBLIC_KEY=your_stripe_public_key
Create a .env file in the backend directory with the following variables:
PORT=3001
MONGODB_URI=your_mongodb_uri
FIREBASE_PROJECT_ID=your_firebase_project_id
FIREBASE_STORAGE_BUCKET=your_firebase_storage_bucket
FIREBASE_PRIVATE_KEY=your_firebase_private_key
FIREBASE_CLIENT_EMAIL=your_firebase_client_email
STRIPE_SECRET_KEY=your_stripe_secret_key
STRIPE_WEBHOOK_SECRET=your_stripe_webhook_secret
NODE_ENV=development
PLATFORM_FEE_PERCENTAGE=0.10
PLATFORM_FEE_FIXED=0.35
- Start the development servers:
# Start the backend server
cd backend
npm run dev
# Start the frontend development server
cd frontend
npm startThe application will be available at http://localhost:3000.
dare2do/
├── frontend/
│ ├── public/
│ └── src/
│ ├── components/
│ │ └── ui/
│ ├── contexts/
│ ├── pages/
│ ├── services/
│ ├── types/
│ └── config/
└── backend/
├── src/
│ ├── controllers/
│ ├── middleware/
│ ├── models/
│ ├── routes/
│ ├── services/
│ ├── config/
└── uploads/
In the frontend directory:
npm start: Start the development servernpm build: Build the production versionnpm test: Run testsnpm run lint: Run ESLintnpm run format: Format code with Prettier
In the backend directory:
npm run dev: Start the development servernpm start: Start the production servernpm test: Run testsnpm run lint: Run ESLint
- Fork the repository
- Create your feature branch (
git checkout -b feature/amazing-feature) - Commit your changes (
git commit -m 'Add some amazing feature') - Push to the branch (
git push origin feature/amazing-feature) - Open a Pull Request
- Authentication endpoints /api/auth/*
- Dare management /api/dares/*
- Payment processing /api/payments/*
- User management /api/users/*
- Admin controls /api/admin/*
- Charity management /api/charities/*