Giter Club home page Giter Club logo

TomatoRPG Build Status

Simple server for creating HTTP chatroom that's suitable for TRPG games online.

Installation

go get -u github.com/tomatorpg/tomatorpg/cmd/tomatorpg

The server code will be inside your $GOPATH folder in $GOPATH/src/github.com/tomatorpg/tomatorpg.

Usage

If you have included $GOPATH/bin into your $PATH, you can run this:

tomatorpg

Or you can run this:

$(go env GOPATH)/bin/tomatorpg

Development

You may work in the Frontend Development mode. Or you may work in the Fullstack Development mode.

Depends on what development work are you doing.

Fronend Development

To golang server on development mode, with webpack-dev-server for frontend development:

yarn devfront

The frontend javascript / scss code will be monitored and rebuilt by webpack-dev-server. The golang server will be using the javascript that provided by webpack-dev-server.

Fullstack Development

You should install gin live reloader for fullstack development:

go get -u github.com/codegangsta/gin

To run development server both for frontend and backend:

yarn dev

The golang server binary will be monitored, automatically rebuilt by gin and listen at http://localhost:8080 by default.

The frontend javascript / scss code will be monitored and rebuilt by webpack-dev-server. The javascript built assets will be served at http://localhost:8081/assets by default.

Resolve port conflict

If you encountered port conflict, you may use the following env variables:

  • PORT controls the port for tomatorpg server to bind to (if you're not running the server through gin). Default is 8080.

  • PUBLIC_URL provides the base public URL of the site to OAuth2. This will be used in the OAuth2 login (i.e. Google / Facebook / Twitter) process only. Default is: http://localhost:8080.

  • WEBPACK_DEV_SERVER_HOST defines the webpack-dev-server public path. If you have set NODE_ENV to "development", the tomatorpg server will use javascript from this host, instead of its built-in assets.

You may use the .env file to override these variables. Or you may directly set these variables in your environment.

.env file

Both the Golang server and the webpack-dev-server config support loading variables from dotenv file (.env). You may simply put your environment variables in the .env of the project root.

For production, you may add a .env file at the same folder of the tomatorpg binary.

TomatoRPG's Projects

tomatorpg icon tomatorpg

An open source TRPG chatroom with Golang and React

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.