Skip to content

Latest commit

 

History

History
 
 

frontend

Frontend Boilerplate with React, Redux & TypeScript

A bare minimum react-redux-webpack-typescript boilerplate with TodoMVC example.

Live demo

Note that this project does not include Server-Side Rendering, Static code analysis, Testing Frameworks and other stuffs that makes the package unnecessarily complicated. (e.g. yarn, tslint, jest, ...)
If needed, please fork this repository and add your own that meets your requirements.

Ideal for creating React apps from the scratch.

See also: react-mobx-typescript-boilerplate

Contains

Build tools

Setup

$ npm install

Running

$ npm start

Build

$ npm run build

Prettier

$ npm run prettier

License

MIT

Glee-Specific Config

Connecting to Backend

During build, CRA will import the backend API url from API_URL which you can use via process.env.API_URL. To change the value of this locally, add that as an environment variable and set it to whatever you need. You can also create a .env file, of course.

Example:

API_URL=http://localhost:3030

Relative Paths in HTML

When deploying to a folder instead of the root on a web server, you need paths to resources to be relative (ex: ./scripts instead of /scripts). To force webpack to generate relative paths, add a FRONTEND_URL to your environment with the url to your application.

Logging

We are using Loggly to track log messages remotely. If you want to send your logs to Loggly for some reason, you should configure the following variables in your environment (either with .env or in your operating system):

LOGGLY_SUBDOMAIN=yoursubdomain
LOGGLY_TOKEN=yourlogglytoken
LOGGLY_LEVEL=info

E2E Tests with Ghost Inspector

You will need the following env vars for Ghost Inspector tests to run in CI/CD:

GHOST_SUITE_ID=5bdb36e08faf2b12926e7cf4
GHOST_API_KEY=da6f8fa10c129df055519e634530b531d3c068e5