Combat tracker for Dungeons and Dragons (D&D) 5th Edition
The official Improved Initiative app lives at https://improvedinitiative.app/
- Node.js (see package.json for specific version)
- Clone the repo to a folder on your computer
- Open the cloned folder in a code editor such as Visual Studio Code
- Open a terminal window (Powershell is the recommend terminal application for this project)
- Install dependencies and start the development environment:
npm install
npm run dev
- Visit http://localhost:3000 in a web browser. Client TypeScript and HTML changes reload the page, while LESS changes are injected without a reload. Server TypeScript changes restart the server automatically.
- In Visual Studio Code, the
Develop Improved Initiativelaunch configuration starts the same workflow with the debugger attached to child processes. - Open5e preloading is skipped by default for a faster startup. Run the server separately when developing Open5e behavior.
- To override development server settings, copy
.env.exampleto.envand edit it. The file is optional and ignored by Git. Environment variables set in the shell take precedence over.env, which takes precedence over the development defaults.
Development of Improved Initiative is supported through Patreon.
To learn more about how to contribute code to Improved Initiative, refer to CONTRIBUTING.md.
Improved Initiative uses Eslint with prettier to lint the code files.
Linting happens automatically on commit, but you can also run it manually via: npm run lint.
You can configure your instance of Improved Initiative with these settings. They are optional under npm run dev, which supplies development defaults; when you run the server yourself, BASE_URL is required and the rest are optional.
PORT- Defaults to 80NODE_ENV- Set to "production" to satisfy react, set to "development" to disable html view caching.BASE_URL- The canonical absolute URL of your instance, including the scheme, for examplehttp://localhost:3000. Used in absolute URLs on the client side, the Patreon callback, and browser localStorage. The server refuses to start if it is missing or is not an absolute URL.SESSION_SECRET- Used to keep session continuity through app restarts or something. Handed to express-session.DEFAULT_ACCOUNT_LEVEL- Set to "accountsync" or "epicinitiative" to grant rewards to all users. Useful if you have no DB.DEFAULT_PATREON_ID- Set the dummy Patreon user id when running withDEFAULT_ACCOUNT_LEVELset.DB_CONNECTION_STRING- Provide a DB connection string for session and user account storage. In memory Mongo DB will be used otherwise, which is cleared on app restart.METRICS_DB_CONNECTION_STRING- Provide a DB connection string to write metrics to.PATREON_URL,PATREON_CLIENT_ID,PATREON_CLIENT_SECRET- Configuration for Patreon integrationGOOGLE_ANALYTICS_ID- GA4 measurement ID used by the browser tag and Measurement Protocol events.GOOGLE_ANALYTICS_API_SECRET- GA4 Measurement Protocol API secret used for server-side Patreon subscription events.
The Improved Initiative app is made available under the MIT license.