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
yarnin the terminal to install package dependencies. - Create and populate a
.envfile in the root folder based on the.env.examplefile, which contains default environment variable values for a dev environment. - Optionally switch the
USE_DBenvironment variable tofalseand 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.ymland selectCompose Up.
Launch:
- Run
yarn devto 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
debuglaunch configuration in VS Code (pressF5), which essentially runsyarn devwith the VS Code debugger attached to the server. The client can be debugged in the browser developer tools via source maps.
