Installation & Code tour - sh4rkman/SquadCalc GitHub Wiki

Next: Translating SquadCalc. ➡️

Want to fork, clone, contribute ? Here's a quick overview.

Clone and install

git clone https://github.com/sh4rkman/SquadCalc.git
cd SquadCalc
npm ci

NPM scripts

Running a development server

The folowing npm script will launch squadcalc in watch-mode : you can code and test at the same time.

npm run start

Bundling for production

The folowing script will build a production-ready bundle in the /dist/ folder , see bellow.

npm run build

Configuration

When forking this project, you will need to configure a .env file to define specific environment variables. The .env file need to placed at the root of the project.

Example .env file for production use :

# Base URL for the API the application communicates with.
# Disable or leave empty if you don't want to use API features (publishing markers & heatmaps)
# Note that official API access need to be obtained first, see : https://github.com/sh4rkman/SquadCalc/wiki/API-Documentation
#API_URL=https://beta.squadcalc.app/api
API_URL=https://squadcalc.app/api

# Enable or disable WebSocket functionality for SquadMortarOverlay
# If set to 'true' SquadCalc will try to open a socket with any running local instance of squadmortaroverlay.exe
# see https://github.com/Devil4ngle/SquadMortarOverlay
WEBSOCKET=true

# Enable or disable search engine indexing
# If set to 'true' a robots.txt with allow all will be created
# If set to 'false' a robots.txt with disallow all will be created
INDEX=true

# Enable or disable Factions/Vehicles functions
# If set to 'true' no faction will be displayed after selecting a layer
# Default to false
DISABLE_FACTIONS=false

Bundler & WebServer

Squadcalc is using Webpack as a code bundler: using npm run build will launch webpack and create a ready-for-production bundle inside a dist folder that can be deployed and fed to any web server instance of your own.

Squadcalc doesn't include a web server : you'll have to use your own nginx/lighthttpd/appache instance. Just point it to the dist folder.


Next: Translating SquadCalc. ➡️

⚠️ **GitHub.com Fallback** ⚠️