https://github.com/krondorl/lucid-light-lottery
Full Stack Lottery App with Websocket
https://github.com/krondorl/lucid-light-lottery
node-js react typescript websocket
Last synced: 4 months ago
JSON representation
Full Stack Lottery App with Websocket
- Host: GitHub
- URL: https://github.com/krondorl/lucid-light-lottery
- Owner: krondorl
- License: mit
- Created: 2024-07-12T10:01:17.000Z (11 months ago)
- Default Branch: main
- Last Pushed: 2024-07-13T18:15:30.000Z (11 months ago)
- Last Synced: 2024-07-14T14:49:07.970Z (11 months ago)
- Topics: node-js, react, typescript, websocket
- Language: TypeScript
- Homepage:
- Size: 127 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README

# Lucid Light Lottery
This lottery program is a React + Node.js full-stack app practice example.
The app works in a limited mode.
**The simulation starts when the user checks the random mode.**
## Screen
The app looks like this.

## Stack and Tooling
- framework: React
- styles: Tailwind
- language: TypeScript
- linter: ESLint
- tooling: Vite
- test framework: Vitest
- code formatting: Prettier## Features
- simulations on the backend
- presentation on the frontend
- architecture plan
- tests
- Node.js Crypto for pseudo-random numbers
- single player mode
- only random mode is supported
- five weeks of data are sent over with fixed intervals from server to client
- Websocket communication
- sketches for preparing databases and abstraction
- dialogs for messages
- prep files for running databases from Docker and init SQL scripts## Usage with `npm`
1. You need at least [Node.js](https://nodejs.org/en) v20.11.1 to start locally.
1. Installation: run `npm install` in the `client` and `server` directories.
1. After installation, use `npm start` in the `client` and `server` directories.
1. Open the browser at `http://localhost:5137/`
1. Click on the **Play with random numbers** checkbox in the GUI to start the lottery generation.## Usage with `Docker`
1. You need [Docker Desktop](https://www.docker.com/products/docker-desktop/) installed
1. Start Docker Desktop
1. In the project repo, where `docker-compose.yaml` is located, execute `docker compose up`
1. Open the browser at `http://localhost:3050/`## Test and development environment
I used the following setup:
- Node.js v20.11.0
- npm 10.2.4
- Windows 11
- PowerShell
- VS Code## System design
[A diagram and description](system-design.md) of the system are available.
## Notes
[The notes file](notes.md) contains valuable links and ideas I used for research and learning.
## Tests
You can check unit tests with these commands in the `server` folder.
- `npm run test`
- `npm run coverage`## History
I started the project in July 2024.
## License
Please see the [LICENSE file](LICENSE).