This project demonstrates a setup using Vite for the frontend, Express for the backend, and WebSocket for real-time communication.
- Vite for fast frontend development
- Express for backend server
- Socket.IO for WebSocket communication
- ESLint for code linting
- Hot Module Replacement (HMR) for fast development
- Node.js (>= 14.x)
- npm or yarn
-
Clone the repository:
git clone https://github.com/Fcstro/ColoredLotto.git cd ColoredLotto -
Install dependencies:
npm install # or yarn install
-
Start the development server:
npm run dev # or yarn dev -
Open your browser and navigate to
http://localhost:3000.
-
Build the project:
npm run build # or yarn build -
Start the production server:
npm run start # or yarn start
This project includes a simple game where players roll cubes and receive results in real-time. The game mechanics are as follows:
- Countdown Timer: A countdown timer starts from 10 seconds. When the timer reaches zero, the cubes are rolled.
- Cube Roll: The server rolls the cubes and sends the result to all connected clients.
- Real-Time Updates: The countdown timer and cube roll results are sent to clients in real-time using WebSocket events.
- Placing Bets: Players can place bets on the outcome of the cube roll before the countdown timer reaches zero.
- Winning Conditions: Players win if their bet matches the result of the cube roll.
- Payouts: The server calculates and distributes payouts to the winning players based on the odds and the amount bet.
If you are developing a production application, we recommend using TypeScript and enabling type-aware lint rules. Check out the TS template to integrate TypeScript and typescript-eslint in your project.
This project is licensed under the MIT License.
- Fredderico Castro
- Bj Ashley Mercado