Skip to content
This repository was archived by the owner on Apr 5, 2020. It is now read-only.
Joe Krump edited this page Sep 2, 2016 · 2 revisions

Setup Instructions

Setup Steps

  1. Install node modules by running:
$ npm install
  1. Create app_config directory in the project root:
$ mkdir app_config
  1. Create two config files: app.js and stripe.js with the following content:
  • app.js:
const app_config = {
  baseUrl: 'THE PATH OF THE CLIENT: ex. http://localhost:3000', // Note: If you are unsure what this is, try running `npm start` to see.
  apiBaseUrl: 'THE PATH TO YOUR API SERVER (followed by a trailing slash "/"): ex. http://localhost:8000/api/',
  adminRouteLinks: [
    { linkText: 'Dashboard', url: '/admin' },
    // Add more that you would like here ex. { linkText: 'Users', url: '/admin/users' } or { linkText: 'Books', url: '/admin/books' }
  ],
  publicRouteLinks: [
    { linkText: 'Log In', url: '/login' },
    { linkText: 'Home', url: '/' },
    { linkText: 'About', url: '/about' },
    { linkText: 'Make a donation', url: '/donate' },
    // Add more here (BUT UNLIKE THE ADMIN ROUTES, MAKE SURE YOU ADD TO routes.js as well)
  ],
  validResources: [
    'users',
    'books',
    'permissions',
    'roles',
    'pages'
  ],
  resourcesWithEditor: [ // Specify resources that you would like to use the inline editor for rather than a form.
    'page'
  ]
};

module.exports = app_config;
  • stripe.js:
var stripe_config = {
  test: {
    pk: 'YOUR STRIPE TEST PUBLIC KEY'
  }
};

module.exports = stripe_config; 

NOTE This app currently requires Stripe for payments to be set up.

  1. Start Client App
$ npm start

Configuration Options Explained

One of the first things that is required in the setup of this app in order for it to work, is the creation of a app_config directory which in turn contains two files:

  • app.js
  • stripe.js

These two files contain configuration options for various parts of the app.

app.js

The content of app.js is a configuration object with several key pieces. This is what each part is for

  • basurl - {string} The base URL for your client. ex. http://localapp:3000
  • apiBaseUrl - {string} The base URL for your API server. ex. http://localhost:8000/api
  • **adminRouteLinks ** - {Array} Used to populate Links in the left nav Drawer of the Admin interface of the app. Each entry should be an Object with the following format: {linkText: 'Some String', url: 'the path that the link should direct to'}
  • publicRouteLinks - {Array} Used to populate Links in the left nav Drawer when the User is not logged in. Each entry should be an Object with the following format: {linkText: 'Some String', url: 'the path that the link should direct to'}
  • validResourceRootPaths - {Array} A list of paths to resources that can be safely assumed to be valid and correspond to actual resources returned from the server. This list will likely be used for route validation in React Router later on.
  • resourcesWithEditor - {Array} A list of resource that should user the Quill Editor to modify their content rather than a traditional form. Entries should be in the singular (ex. 'page' NOT 'pages') and should be lowercase.
Clone this wiki locally