A social platform for sports betting predictions focused on fight sports (UFC, MMA, Boxing).
After clicking, you'll need to add these environment variables:
MONGODB_URI
- Your MongoDB connection stringJWT_SECRET
- A secure secret key (generate with:openssl rand -base64 32
)CORS_ORIGIN
- Your frontend URL (e.g., https://your-app.vercel.app)ODDS_API_KEY
- Your sports data API key
- Node.js 18+
- MongoDB running locally or MongoDB Atlas URL
- Clone the repository
- Install dependencies:
npm install
- Set up environment variables:
Backend (.env in /backend):
MONGODB_URI=mongodb://localhost:27017/clout
JWT_SECRET=your-secret-key-here
PORT=3000
NODE_ENV=development
SPORTS_DB_API_KEY=3 # Optional: for sports data integration
Frontend (.env in /frontend):
VITE_API_URL=http://localhost:3000/api
-
Start MongoDB (if running locally)
-
Seed the database (creates test users and data):
npm run seed
- Start both frontend and backend:
npm run dev
This will start:
- Backend API at http://localhost:3000
- Frontend at http://localhost:5173
After seeding, you can login with:
Cappers:
- Email: ironmike@example.com, Password: password123
- Email: mysticmac@example.com, Password: password123
- Email: thepredator@example.com, Password: password123
Regular Users:
- Email: johndoe@example.com, Password: password123
- Email: janedoe@example.com, Password: password123
- โ Authentication: JWT-based auth with login/signup endpoints
- โ Sports Data Integration: Event model with fight data, mock API fallback
- โ Enhanced Clout Algorithm: 70% win rate + 30% social (capped at 300 followers)
- โ Follow System: Users can follow cappers, affects clout score
- โ Event Management: Link picks to real events, auto-verification system
- โ Error Handling: Global error middleware, frontend toast notifications
- โ Testing: Jest tests for auth flows and clout calculation
- โ Enhanced Seed Data: 20+ picks, events, and social connections
- ๐ Real-time fight results from live APIs
- ๐ Comment system on picks
- ๐ Advanced analytics dashboard with charts
- ๐ Email notifications for followed cappers
- ๐ Mobile app (React Native)
- ๐ Expand to other sports
- Username, email, password (hashed)
- Role: 'capper' | 'user'
- Followers/following arrays
- Stats: totalPicks, correctPicks, winRate
- Clout score (computed: 70% accuracy + 30% social)
- Capper reference
- Event reference with fight index
- Prediction: winner, method, round, confidence
- Analysis text
- Verified outcome with correctness
- Likes array
- External ID, name, organization
- Event date, venue, location
- Fights array with fighter details
- Status: upcoming/live/completed
- Fight results for verification
- Dynamic aggregation pipeline
- Ranks by clout score
- Period filtering (all/month/week)
# Backend unit tests
cd backend
npm test
# With coverage
npm test -- --coverage
- Authentication flows (signup, login)
- Clout score calculation
- Pick verification system
- API endpoint validation
Run tests with:
# Backend tests
cd backend
npm test
# Frontend tests
cd frontend
npm test
- Create new web service
- Set environment variables
- Deploy from GitHub
- Import GitHub repository
- Set build command:
npm run build
- Set output directory:
dist
Base URL: http://localhost:3000/api
POST /auth/signup
- Register new user- Body:
{ username, email, password, role }
- Body:
POST /auth/login
- Login user- Body:
{ email, password }
- Returns: JWT token
- Body:
GET /users/:id
- Get user profilePOST /users/:id/follow
- Follow user (auth required)POST /users/:id/unfollow
- Unfollow user (auth required)GET /users/:id/followers
- Get user's followersGET /users/:id/following
- Get who user follows
GET /picks
- Get pick feed (paginated)GET /picks/capper/:id
- Get capper's picksPOST /picks
- Create new pick (capper only)POST /picks/:id/like
- Like a pick (auth required)
GET /events
- Get upcoming/past eventsGET /events/:id
- Get specific event detailsPOST /events/refresh
- Refresh events from API (admin)
GET /leaderboard
- Get top cappers by clout score- Query params:
?period=all|month|week
- Query params:
- Create feature branch:
git checkout -b feature/your-feature
- Commit changes:
git commit -m 'Add feature'
- Push branch:
git push origin feature/your-feature
- Open Pull Request
MIT License - see LICENSE file for details
Questions? Contact the team on Slack or open an issue.
Clout - Where fight predictions meet social proof. ๐ฅ๐