Modern remake of the classic addicting flash game.
Play on fly.io: copterjs.fly.dev
Install prerequisites:
- Node.js
- Visual Studio Code
- Yarn (
npm i -g yarn
)
Optional (for database-related development only):
- Docker Desktop (plus WSL if on Windows)
- Docker VS Code Extension
Set up dev environment:
- Clone repo and open root folder in VS Code.
- Install recommended VS Code extensions to conform to project linting/formatting config:
- Run
yarn
in the terminal to install package dependencies. - Create and populate a
.env
file in the root folder based on the.env.example
file, which contains default environment variable values for a dev environment. - Optionally switch the
USE_DB
environment variable tofalse
and skip the "Set up dev database" instructions below if there is no need for a dev database.
Set up dev database (only required if USE_DB=true
in the .env
file):
- Open Docker Desktop and leave it running in the background.
- In VS Code, right-click on
/.copterjs-dev-container/docker-compose.yml
and selectCompose Up
.
Launch:
- Run
yarn dev
to concurrently run the server via ts-node-dev and the client via webpack in watch mode. This will cause either to automatically restart whenever a change is made to any of their respective source code files. The client will be accessible on localhost:3000. - Alternatively, start the
debug
launch configuration in VS Code (pressF5
), which essentially runsyarn dev
with the VS Code debugger attached to the server. The client can be debugged in the browser developer tools via source maps.