SafeScore is a professional, data-driven football prediction platform that leverages advanced statistical analysis to provide high-probability betting insights. Built with modern web technologies, it offers users a sleek, responsive, and real-time experience.
- Smart Predictions: Algorithmic analysis of form, H2H, goal statistics, and league strength.
- Risk Management: Filter predictions by risk levels: 'Safe', 'Very Safe', and 'Medium Safe'.
- Multi-League Coverage: Supports 14+ major global leagues including Premier League, La Liga, Bundesliga, Serie A, and Champions League.
- PWA Support: Installable as a native-like app on mobile and desktop.
- Premium UI: Dark-mode first design with smooth animations using Framer Motion.
- Framework: Next.js (React)
- Database: Supabase (Cloud Persistence)
- Styling: Tailwind CSS
- Animations: Framer Motion
- Data Source: Football-Data.org API
- Analytics: Vercel Analytics
The frontend delegates prediction requests to a private core engine via the CORE_ENGINE_URL. This allows for proprietary analysis while keeping the UI and contribution layer open.
SafeScore features an automated settlement system that:
- Saves predictions to a Supabase
historytable. - Periodically verifies pending matches against real-world scores using the Football-Data API.
- Automatically updates the status (Won/Lost) and final scores for transparency.
- Node.js (v18 or higher)
- An API Key from Football-Data.org
- (Optional) A SafeScore Core Engine API Key
- Supabase account and project
-
Clone the repository:
git clone https://github.com/devtofunmi/safescore.git cd safescore -
Install dependencies:
npm install
-
Setup Environment Variables: Copy the example env file and fill in your keys:
cp .env.example .env.local
Required variables:
NEXT_PUBLIC_SUPABASE_URL=your_supabase_url NEXT_PUBLIC_SUPABASE_ANON_KEY=your_anon_key SUPABASE_SERVICE_ROLE_KEY=your_service_role_key FOOTBALL_DATA_API_KEY=your_football_data_api_key
-
Setup Database & Admin Users:
Quick Method (Recommended):
- Open Supabase Dashboard > SQL Editor
- Run
supabase/complete-setup.sql(replace email with your admin email) - Or use the one-liner:
supabase/one-liner-admin.sql
Automated Method:
npm run seed:admin
See
supabase/QUICK_SETUP.mdfor detailed instructions. -
Run the development server:
npm run dev
Open http://localhost:3000 to see the result.
-
Access Admin Dashboard:
- Go to
/admin/login - Login with your admin credentials
- Access the admin dashboard at
/admin
- Go to
Contributions are welcome! Please feel free to submit a Pull Request. For major changes, please open an issue first to discuss what you would like to change.
This project is licensed under the MIT License - see the LICENSE file for details.
Disclaimer: This platform is for informational purposes only. Use the predictions at your own risk. We do not guarantee accuracy or financial gain.