Skip to content

erbuka/type-for-speed

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

15 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Type for Speed

A multiplayer typeracing game.

Type for Speed - Server

Run

npm start

The process will launch a HTTP server at localhost which will serve the following (relative) urls:

  • / - The root folder will serve the game client
  • /admin - The server control panel. This requires authentication.

The following environment variables can be configured:

  • PORT - Listening port. Default 5000.
  • TOS_SERVER_AUTH - HTTP Basic Authentication header to access the server control panel. Default is username = "admin", password = "admin".

Build

npm run build or tsc.

Text generation

Texts for the game are stored in the file /data/texts.json. This file can be regenerated by launching the command npm run generate-texts. This script will scan the /data_sources folder for text (*.txt) files. If you want to know how the text are extracted you can take a look at the source file /src/util/generate-texts.ts.

Deployment

Nothing special about deployment, you can simply clone this repository on the target machine and npm install && npm build.

Remember to configure your environment variables and also, if you have your own version of the client, make sure to replace the content of the /client folder. Note that this is not mandatory, as you may serve the client code from another host.

Project structure

  • / - project root
    • src - source TypeScript files
    • build - TypeScript compiler output
    • data - Assets
    • data_sources - Resources to generate assets
    • views - EJS views
    • client - Root folder of the client

Type for Speed - Client

Development server

Run ng serve for a dev server. Navigate to http://localhost:4200/. The app will automatically reload if you change any of the source files.

Build

Run ng build to build the project. The build artifacts will be stored in the dist/ directory. Use the --prod flag for a production build.

About

Type for Speed - Server

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published