- node v16.13.0
- docker (technically not entirely needed; postgres can be ran locally, with the
.env
creds updated as such)
- via
/backend
, rundocker-compose up
to get postgres up & running through docker - create a
backend/.env
andMinuteBets/.env
. see.env.example
for reference, orcp .env.example .env
to create a local env file for both. If running postgres via Docker and the default ports, both should be accurate for local testing! - configure db migrations by navigating to
/backend
and runningyarn
followed byyarn typeorm
. - from root dir:
yarn start
to run both applications! note: you may need to refresh the web-page once Nest is fully deployed, could take ~10 seconds
- via
/backend
, runyarn typeorm:test
to prepare the testdb migrations for testing - from root dir:
yarn test
to run all tests (or individually in each if desired)
- Through the web-app, one is able to select a desired "bet" for BTC's future price, judging from it's current price on whether or not it will be higher/lower in the next minute.
- To select a bet, use the Select Dropdown. (UP: betting the price will be higher; DOWN: price being lower)
- Then click "Place" to submit the bet
- One is able to see their current score, number of past guesses, BTC's current price, and time until their current guess expires. When the guess does expire, the final results will be shown
- User authentication/sessions are managed with basic uuids stored via cookies. Some of the technologies leveraged for the entire stack are listed below:
- Nest really brings finesse into building backends with typescript. The decorators are also very simple & keep things explicit, and it pairs nicely with Typeorm
- Database model translations & fits very nicely with NestJS. Very simple to use query interface as well, and (personally) enjoy it's querybuilder over Sequelizer
- Ease of global localization/translations
- Simplifies styling, and personally is my favorite for styling readibility inline with React
- Faster then npm & has
yarn workspaces
- consider sockets as they would likely improve any latency issues / the real-time experience for users (require paid APIs)
-
- realtime price updates while the wager is active, especially for longer bets (e.g hourly)
- improve UI test coverage (with invocations)
- convert frontend to TS
- consolidate backend entities/services into their own personal modules (vs. single, shared "database.service"). probably better for maintainability & decoupling