An Instagram Reels-like platform where people in need can post video requests for help and receive direct donations from donors worldwide.
- Vertical Video Feed: Instagram Reels-style scrolling experience
- Video-Only Posts: Every post requires an MP4 video (no exceptions)
- Direct Donations: Stripe-powered secure payments
- Trust System: Verification, risk scoring, and reporting
- Following Feed: Stay updated on posts you care about
- Real-time Updates: Posters can add video updates to their campaigns
- Admin Dashboard: Review reports and manage trust status
- Node.js 18+
- MongoDB 6+
- Stripe account (for payments)
- Clone and install dependencies:
npm install- Set up environment variables:
cp .env.example .envEdit .env with your actual values:
- MongoDB connection string
- JWT secret (generate a strong random string)
- Stripe API keys (from Stripe Dashboard)
- Start MongoDB:
# If using local MongoDB
mongod- Seed the database:
npm run seedThis creates:
- 1 admin user (admin@scroll4good.com / admin123)
- 2 needy users
- 1 donor user (donor@example.com / donor123)
- 12 demo posts with real video URLs
- Start the server:
npm run dev- Open your browser:
http://localhost:3000
-
Install Stripe CLI: https://stripe.com/docs/stripe-cli
-
Login to Stripe:
stripe login- Forward webhooks to local server:
stripe listen --forward-to localhost:3000/api/stripe/webhook- Copy the webhook signing secret to
.env:
STRIPE_WEBHOOK_SECRET=whsec_xxxxx
Use Stripe test cards:
- Success:
4242 4242 4242 4242 - Decline:
4000 0000 0000 0002 - Any future expiry date and any 3-digit CVC
- Browse feed and discover posts
- Donate to campaigns
- Follow posts for updates
- Report suspicious content
- Create video posts requesting help
- Add video updates to campaigns
- Track donations received
- Review reported posts
- Verify or flag content
- Manage trust status
- Remove inappropriate posts
scroll4good/
βββ client/ # Frontend (Vanilla JS + Tailwind)
β βββ index.html # Feed (Reels UI)
β βββ login.html
β βββ register.html
β βββ post.html # Post details
β βββ create.html # Create post (needy)
β βββ following.html # Following feed
β βββ profile.html
β βββ admin.html # Admin panel
β βββ success.html # Payment success
β βββ src/
β βββ api.js # API client
β βββ auth.js # Auth utilities
β βββ feed.js # Feed logic
β βββ post.js # Post details
β βββ create.js # Create post
β βββ following.js # Following feed
β βββ admin.js # Admin panel
β βββ ui/
β βββ reelCard.js
β βββ modal.js
β βββ toast.js
β βββ utils.js
βββ server/
β βββ index.js # Express app entry
β βββ models/ # Mongoose models
β βββ routes/ # API routes
β βββ middleware/ # Auth, validation, etc.
β βββ utils/ # Helpers
β βββ uploads/ # Video storage
β βββ scripts/
β βββ seed.js # Database seeding
βββ package.json
POST /api/auth/register- Register new userPOST /api/auth/login- LoginPOST /api/auth/logout- LogoutGET /api/auth/me- Get current user
GET /api/posts- Get posts feed (cursor pagination)POST /api/posts- Create post (needy only, video required)GET /api/posts/:id- Get post detailsPATCH /api/posts/:id- Update post (limited)
POST /api/posts/:id/follow- Follow a postDELETE /api/posts/:id/follow- UnfollowGET /api/posts/following- Get following feed
GET /api/posts/:id/updates- Get post updatesPOST /api/posts/:id/updates- Add update (video required)
POST /api/donations/checkout- Create Stripe checkoutGET /api/donations/session/:id- Check session statusPOST /api/stripe/webhook- Stripe webhook handler
POST /api/reports- Report a post
POST /api/ai/risk-score- Calculate risk score
GET /api/admin/reports- Get all reportsPATCH /api/admin/posts/:id/trust-status- Update trustPATCH /api/admin/posts/:id/status- Update statusPATCH /api/admin/posts/:id/verify- Verify post
POST /api/uploads/video- Upload video (returns URL)
Frontend:
- HTML5
- Vanilla JavaScript (ES Modules)
- Tailwind CSS (CDN)
- Fetch API
Backend:
- Node.js + Express
- MongoDB + Mongoose
- JWT (httpOnly cookies)
- Stripe Checkout + Webhooks
- Multer (file uploads)
- JWT authentication with httpOnly cookies
- Password hashing with bcryptjs
- Request validation with Zod
- Rate limiting on sensitive endpoints
- CORS with credentials
- File type and size validation
- Role-based access control
- β Only people in need can post (role must be "needy")
- β Every post MUST include a video (mp4 required)
- β Feed UI mimics Instagram Reels (vertical snap scrolling)
- β No NGO accounts, no organization accounts
- β No other content types (only help request videos)
MongoDB connection issues:
- Ensure MongoDB is running:
mongod - Check connection string in
.env
Video upload fails:
- Check
MAX_VIDEO_SIZE_MBin.env - Ensure
server/uploadsdirectory exists - Verify video is mp4 format
Stripe webhook not working:
- Run
stripe listen --forward-to localhost:3000/api/stripe/webhook - Copy webhook secret to
.env - Restart server after updating
.env
CORS errors:
- Ensure
FRONTEND_URLmatches your client URL - Check that credentials are included in fetch requests
Import postman_collection.json to test all API endpoints.
MIT
Built with β€οΈ for a better world