Use this prompt, thank me later... Create an online sports betting platform following these rules:
- Create a web app for betting on sports like baseball, basketball, football, hockey and soccer
- App name is BetMax
Use this tech stack:
- Use node js and express for server code, ejs for templates and UI, postgresql for database management
- Use only HTML, JS and CSS for web pages
- Create a public folder with fonts, icons, media, scripts and styles subfolders
- Place respective files in each folder according to its function
Styling:
- Design in light mode and dark mode
- Design in responsive mode for mobile devices
- Use one single file for shared styles named common.css, and one file for every web page for custom styles related to that page if necessary, each stylesheet file will be named like the page that it customizes but using .css extension
- Create a header and footer component, include them in every html file directly at the top and the bottom according to ejs, passing vars when needed
Authentication:
- User registration, login, logout, forgot password, and all the forms for user and session management
- Once registered, users can top up their wallet with money, we will use Binance wallet for that
- Binance integration will be done later, for now leave placeholders
- No avatar is required
- Use node:crypto Sha256 encryption instead of bcrypt
Betting info:
- Once registered, landing page will show five buttons, one for every sport: baseball, basketball, football, hockey, soccer
- Once clicked on the desired sport, daily schedule will be shown with all the games for that day, showing teams, times, odds
- Users will be able to pick one or more winners in parlay mode, recalculating the max winning amount based on the odds of selected teams
- They can bet all the money they want up to a limit per user, stored in the user config info
- Once ready, the user will finish the bet, deduct a payment from their wallet balance, and the betting ticket will be stored in the database and shown in the screen
- Keep in mind some matches can be postponed or cancelled, use a status field for that
Other pages neded:
- Landing page: make it professional, light/dark themed, responsive, minimalist but be creative
- Once the user is registered, show the sports selection page
- Once the sport is selected, show the schedule for games of the day
- They can pick their teams, confirm the purchase and get their betting ticket
- Once the match has finished and results available, admins will enter them in the database and calculate winners, payouts and commissions
- Keep a history of tickets so users can know their outcome, winner or loser
Rules:
- Place views in 'views' folder
- html file extensions as .html not .ejs, make changes in express for that
- Keep the style in all pages, make it uniform
- Try not to use popups, use linked pages most of the time, save user state while navigating between pages
- Design the database tables and fields, create a database.sql file with all commands to create the DB
- Use dummy data for now, create a dummydata.sql file for that. Make it easy to replace dummy data for db calls in the future
- Place all db commands and queries in a class stored in a single database.js file that can be accessed from any module
- Use an .env file for all keys, secrets and configuration
Thank you