This project is a React application for a multi-bet selection interface. It demonstrates UI/UX skills, React component architecture, and the ability to handle complex form interactions.
Tech Stack:
- React (with TypeScript & Vite)
- json-server (for local API mocking)
- The app uses a local
json-serveras a backend. - Sports games data can be populated using a script or mock data.
- Script
initGameJsonObj.tsis provided in/server.
This script fetches and parses data from the-odds-api.com and generates a ready-to-usegames.json(ordb.json) file for your local backend. - Each game includes teams, timing, and betting odds.
To start the backend:
npx json-server server/data/db.json --port 3001Initial structure:
{
"games": [],
"bets": []
}- Displays available games in a clean, scannable format.
- Filtering options (by sport, date, etc.).
- Users can select multiple games with clear visual feedback.
- Shows relevant game information (teams, time, odds).
For each selected game, users can configure:
- Bet type (Home Win, Draw, Away Win)
- Stake amount (€1 - €1000)
- "Accept Terms & Conditions" checkbox
- Submit button for all selected bets
- At least one game must be selected
- Each selected game needs both bet type and stake
- All stakes must be valid numbers within range
- Terms must be accepted before submission
- Clear, non-intrusive error feedback
- Smooth, responsive interactions
- Immediate visual feedback for user actions
- Mobile-friendly design
- Thoughtful loading and error states
- Validates the entire form before submission
- Submits bets to the local backend (
POST /bets) - Shows appropriate loading, success, and error states
- Clears the form after successful submission
-
Install dependencies:
npm install
-
Start the backend:
npx json-server server/data/db.json --port 3001
-
Start the frontend:
npm run dev
/src— React application source code/server— Scripts and data for json-server
- The focus is on UI/UX and React logic, not on backend complexity.
- You can use mock data or fetch real data from the-odds-api.com for initial population.