A comprehensive Dota 2 hero recommendation and build guide application with mood-based hero selection, detailed build guides, and multi-language support.
- ๐ฏ Mood-Based Hero Selection: Choose your gaming mood and get personalized hero recommendations
- ๐ Detailed Build Guides: Complete item builds, playstyle tips, and game phase strategies
- ๐ Advanced Hero Search: Filter heroes by role, difficulty, and availability of build guides
- ๐ Multi-Language Support: Available in English, Russian, and Uzbek
- ๐ Dark/Light Theme: Toggle between dark and light modes
- ๐ฑ Responsive Design: Optimized for desktop, tablet, and mobile devices
- ๐๏ธ Supabase Backend: Modern PostgreSQL database with real-time capabilities
- React 18 with TypeScript
- Tailwind CSS for styling
- Lucide React for icons
- Vite for development and building
- Netlify Functions with TypeScript
- Supabase for PostgreSQL database and authentication
- Row Level Security for data protection
- CORS enabled for cross-origin requests
Before you begin, ensure you have the following:
- Node.js (version 18 or higher)
- npm (comes with Node.js)
- Supabase account (free tier available)
- Netlify account (free tier available)
git clone <your-repository-url>
cd dota-helpernpm install- Go to supabase.com and create a free account
- Create a new project
- Wait for the project to be fully set up (this may take a few minutes)
- Get your project credentials:
- Go to Settings โ API
- Copy your Project URL and anon public key
- Copy your service_role key (keep this secret!)
-
Copy the environment template:
cp .env.example .env
-
Edit
.envfile with your Supabase credentials:VITE_SUPABASE_URL=https://your-project-id.supabase.co VITE_SUPABASE_ANON_KEY=your-anon-key-here SUPABASE_SERVICE_ROLE_KEY=your-service-role-key-here
- Go to your Supabase project dashboard
- Navigate to SQL Editor
- Copy and paste the content from
supabase/migrations/01_create_dota_schema.sql - Click "Run" to create all tables and security policies
npm run db:populateYou should see output like:
๐ Populating heroes...
โ
Inserted 150+ heroes
๐ Populating builds...
โ
Inserted 50+ builds
๐ Database population completed successfully!
npm run devThe application will start on http://localhost:8888 (Netlify Dev server)
Note: We use
netlify devinstead ofviteto ensure both the frontend and Netlify Functions are served locally. This allows the API endpoints (/api/heroes,/api/builds) to work correctly during development.
If you need to run only the Vite frontend server (without API functionality), you can use:
npm run dev:vite-
Connect your repository:
- Go to netlify.com
- Click "New site from Git"
- Connect your repository
-
Configure build settings:
- Build command:
npm run build - Publish directory:
dist - Functions directory:
netlify/functions
- Build command:
-
Set environment variables:
- Go to Site settings โ Environment variables
- Add your Supabase credentials:
VITE_SUPABASE_URLVITE_SUPABASE_ANON_KEYSUPABASE_SERVICE_ROLE_KEY
-
Deploy:
- Click "Deploy site"
- Your app will be live at
https://your-site-name.netlify.app
Ensure these are set in Netlify:
VITE_SUPABASE_URL: Your Supabase project URLVITE_SUPABASE_ANON_KEY: Your Supabase anonymous keySUPABASE_SERVICE_ROLE_KEY: Your Supabase service role key
Free Supabase projects can pause after a period of inactivity (leading to a slow first request). This repo includes a Netlify Scheduled Function (keepalive) that runs daily (06:00 UTC) and performs a minimal read query against the database so it stays active.
How it works:
- Function file:
netlify/functions/keepalive.ts - Schedule defined in
netlify.tomlunder[[scheduled.functions]] - Executes a single lightweight
SELECT id FROM heroes LIMIT 1
To adjust frequency:
- Edit the cron expression in
netlify.toml(e.g.,0 */6 * * *for every 6 hours) - Commit & deploy โ Netlify applies the new schedule automatically.
To verify it runs:
- Check Netlify -> Functions -> Scheduled Functions -> Logs
- Or manually invoke:
curl https://<your-site>.netlify.app/.netlify/functions/keepalive
If you prefer an external uptime pinger instead, you can disable this by removing the [[scheduled.functions]] block.
โโโ netlify/
โ โโโ functions/ # Netlify serverless functions
โโโ scripts/
โ โโโ populate-database.ts # Database population script
โโโ src/
โ โโโ components/ # React components
โ โโโ contexts/ # React context providers
โ โโโ data/ # Static data files
โ โโโ lib/ # Library configurations
โ โโโ services/ # API service layer
โ โโโ types/ # TypeScript type definitions
โโโ supabase/
โ โโโ migrations/ # Database migration files
โโโ .env.example # Environment variables template
โโโ .env # Your environment variables (not in git)
โโโ netlify.toml # Netlify configuration
โโโ README.md # This file
The backend provides the following REST API endpoints:
GET /api/health- Health checkGET /api/heroes- Get all heroesGET /api/heroes/:id- Get specific heroGET /api/builds- Get all buildsGET /api/heroes/:heroId/builds- Get builds for specific heroGET /api/heroes/:heroId/builds/:mood- Get specific build
- Edit the data file:
src/data/heroes.ts - Add your hero data following the existing format
- Run the population script:
npm run db:populate
- Edit the data file:
src/data/builds.ts - Add your build data following the existing format
- Run the population script:
npm run db:populate
- Create a new migration file in
supabase/migrations/ - Write your SQL changes
- Run the migration in Supabase SQL Editor
- Update TypeScript types if needed:
npm run db:types
- Go to your Supabase project dashboard
- Navigate to Table Editor
- Browse and edit your data directly
- Check Supabase project status in the dashboard
- Verify environment variables in
.envfile - Test database connection:
npm run db:populate
- Check Netlify function logs in the dashboard
- Verify environment variables are set in Netlify
- Test API directly:
curl https://your-site.netlify.app/.netlify/functions/api/health
- Check Netlify build logs
- Verify all dependencies are in
package.json - Test build locally:
npm run build
- Check Supabase SQL Editor for error messages
- Verify migration syntax is correct
- Run migrations one at a time
- Check table permissions and RLS policies
- Choose from 5 different moods: Aggressive, Defensive, Experimental, Creative, Chaos
- Each mood filters heroes that match your current gaming style
- Smart algorithm considers hero complexity and playstyle
- Item Progression: Step-by-step item builds with costs and timing
- Playstyle Tips: Do's, don'ts, and pro tips for each build
- Game Plan: Detailed strategy for early, mid, and late game phases
- English, Russian, and Uzbek translations
- Localized hero names and descriptions
- Cultural adaptations for different regions
- Mobile-first approach
- Tablet and desktop optimizations
- Touch-friendly interface elements
- Fork the repository
- Create a feature branch:
git checkout -b feature/new-feature - Add your changes to the appropriate data files
- Test locally with
npm run dev - Update database with
npm run db:populate - Commit your changes:
git commit -am 'Add new feature' - Push to the branch:
git push origin feature/new-feature - Submit a pull request
- Research the hero thoroughly
- Add hero data to
src/data/heroes.ts - Include all required fields: id, name, role, difficulty, moods, description, strengths, weaknesses
- Test the hero appears correctly in the UI
- Add translations if needed in
src/contexts/LanguageContext.tsx
- Create a complete build guide with items, playstyle, and gameplan
- Add build data to
src/data/builds.ts - Test the build displays correctly
- Verify all item costs and descriptions are accurate
- Include detailed playstyle guidance
This project is licensed under the MIT License.
Created by CYBERSPYDE - A comprehensive tool for Dota 2 players to discover heroes and builds based on their current gaming mood and playstyle preferences.
The application uses modern web technologies to provide a smooth, responsive experience while maintaining a beautiful, game-inspired design that appeals to Dota 2 players.
- Supabase Documentation - Database and backend services
- Netlify Functions Documentation - Serverless functions
- Vite Documentation - Frontend build tool
- React Documentation - Frontend framework
- Tailwind CSS Documentation - CSS framework
- Live Demo: https://your-site.netlify.app
- Supabase Dashboard: https://supabase.com/dashboard
- Netlify Dashboard: https://app.netlify.com
Happy gaming! ๐ฎโจ