🃏 Admin web app + documentation for Gambit
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
client
config
lib
routes
.env.example
.eslintignore
.eslintrc.js
.gitignore
.nvmrc
LICENSE
README.md
package-lock.json
package.json
server.js
wercker.yml

README.md

Gambit Admin

  • Looking for the admin guide? Check the wiki.

Gambit Admin is a Node.js server and React client app, providing a Gambit web interface for DoSomething staff.

Using https://github.com/mars/heroku-cra-node as an example, this repo is composed of two npm projects, the backend server and the frontend UI, with two package.json configs.

  1. package.json for Node server & Heroku deploy
    • heroku-postbuild script compiles the webpack bundle during deploy
    • cacheDirectories includes react-ui/node_modules/ to optimize build time
  2. client/package.json for React web UI

Local Development

Run the API Server

In a terminal:

# Initial setup
npm install

# Start the server
npm start

Run the React UI

The React app is configured to proxy backend requests to the local Node server. (See "proxy" config)

Note: If the server port changes, the client package.json proxy must be updated as well.

In a separate terminal from the API server, start the UI:

# Always change directory, first
cd client/

# Initial setup
npm install

# Start the server
npm start

Respond with a 'yes' when prompted to run the app on another port.

? Something is already running on port 3000. Probably:
  node server
  in /Users/sl0THi3B0i/Development/gambit-admin

Would you like to run the app on another port instead? (Y/n)