Serious Gaming, Evolved - web interface
Installation and quick-start
In your command line, navigate to the project and then run the following commands:
yarn install yarn build yarn serge
This will start the full application in 'demo' mode, you can see the application in action by visiting: http://localhost:8080.
For front-end developers relying on live rebuilds, can simply run the following
yarn install yarn build yarn develop
This will do all of the building for you and then start the front-end server. The development environment will start up, and after a few seconds the browser page will open at something like
localhost:3000. The IP address for the backend server should be appended to this, so the URL looks like:
Note: to get into the backend in admin mode, you may need to use a URL like:
This will also start our Storybook implementation for more information about that, please see the readme in the components package. If you'd rather not run storybook as part of this process, then simply run
yarn dev instead of
Quick access to games & roles
Again for developers, there are convenient ways of going directly into a particular wargame, registered as a particular user. This is through the user of the
access URL parameters, like this:
Monorepo & package management
This repo is a monorepo using Lerna.
Splitting up large codebases into separate independently versioned packages is extremely useful for code sharing. However, making changes across many repositories is messy and difficult to track, and testing across repositories gets complicated really fast.
To solve these (and many other) problems, some projects will organize their codebases into multi-package repositories (sometimes called monorepos).
Each package folder has it's own npm package.json and is automatically linked together with lerna. Just remember to add the package to the
dependencies section of package.json (don't forget to prefix with the
@serge scope!) and then run
yarn install in the root of the repo.
Manage dependencies for packages like normal, but remember to use
yarn add instead of
Fork repository (optional)
If you're an external contributor make sure to fork this project first
git clone firstname.lastname@example.org:serge-web/serge-web.git # or clone your own fork cd serge-web
Using nvm (optional)
If you work across multiple Node.js projects there's a good chance they require different Node.js and npm versions.
To enable this we use nvm (Node Version Manager) to switch between versions easily.
The top level project contains scripts that are then executed for all packages.
testRuns tests in all the packages.
buildRuns the build script in all packages which require building.
startRuns the complete application in demo mode.
start-clientOnly starts the client application.
start-serverOnly starts the server application.
developRuns the client and server applications as well as the Storybook application and watches for typescript errors.
sergeA friendly alias for
Console commands for during dev and demos
clearDatabase() will clear message types (reload page and wait 2 seconds for rebuild and subsequent reload)
clearDatabase2() will clear created messages (reload page manually to start fresh)
Git commit hooks trigger linting of all staged files when a change is committed.
Code formatting & linting
For information and guidance about how to contribute to this project. Please see the Development standards guidelines
The Serge is licensed under the Apache License 2.0.