Skip to content

mathiscode/reactify-boilerplate

Repository files navigation

Reactify Boilerplate

GitHub license JavaScript Style Guide Build Status GitHub issues PRs Welcome

“This is what I have learned, Malenfant. This is how it is, how it was, how it came to be.”

― Stephen Baxter, Manifold: Time

Tweet Help spread the word and share this project!

Live Demo


Screenshot


Why Reactify Boilerplate

Reinventing the wheel sucks. Reactify Boilerplate lets you get started with a solid foundation for new projects.

Frontend: React

Reactify Boilerplate uses React (via Create React App) as a frontend framework.

Includes:

Backend: Restify

Reactify Boilerplate uses Restify as a backend server.

Includes:


Installing

For best results, you should have Yarn installed.

You'll probably want to use this repository as a template, then replace the clone URL and directory name below.

git clone https://github.com/mathiscode/reactify-boilerplate.git
cd reactify-boilerplate
yarn

Configuring

cp .env.example .env

Edit .env or set environment variables for server configuration

Edit client/src/config/site.js for client configuration

Edit client/src/config/keys.js for client-side API keys (eg. Google OAuth)

Customizing

Edit/add client components in client/src/components

Edit/add server routes in server.js (look for the comment // Setup routes)

routes/users/index.js has examples of how to include routes

See more guides in the Wiki

Running the development environment

yarn dev # This will launch both the Restify server and the React development server.

Testing

# Complete:
yarn test

# Individually:
yarn lint
yarn test-server
yarn test-client

Building

Once you've made some changes to the client, run:

yarn build

This will bundle the React app and place it into the server's /public directory.

Logging

Logs will output to the console if NODE_ENV is not production

Log to file

In .env or your environment variables, set:

LOG_FILE=filename.log
ERROR_LOG_FILE=errors.log

Log to Logz.io

In .env or your environment variables, set:

USE_LOGZIO=true
LOGZIO_API_TOKEN=yourlogziotoken

Log to Loggly

In .env or your environment variables, set:

USE_LOGGLY=true
LOGGLY_SUBDOMAIN=yourlogglysubdomain
LOGGLY_TOKEN=yourlogglytoken
LOGGLY_TAGS=mytag-1,mytag-2

Note: you may get a warning about the loggly module; this can be safely ignored.

License

This project is licensed under the MIT License - see the LICENSE.md file for details

Donate

Contributing

Read the Contribution Guide

Contributors