Skip to content

myoolala/react-starter

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

54 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

React Starter

This project is a foundation for building custom applications using React and Node.js.

Requirements

You will need to have either Nodejs or Docker installed. If you are working on multiple projects and not using docker, it may be a good idea to install the latest version of Node using nvm.

Getting Started

Follow the steps below to get the app running on your local machine:

  1. docker-compose up --build app

Alternatively, you can run the app in directly on your machine if you do not have docker installed

  1. Navigate into the app folder.
  2. Run npm i.
  3. Run npm run dev.
  4. Open your browser to http://localhost:3000.

Scripts

Name Description
dev Run in development mode
test Run Jest using defaults
start Run in production mode
prettier Format all JS code in the src directory
build Generate the static js files for the ui

Deployment Container

Built in is a container with terraform, terragrunt, and node all installed. The main purpose is so that there is a committed place of what version of each is necessary to deploy the code.

Other highlights of the container include:

  1. Persistent bash history preserved in docker volumes
  2. Volumes in the host machine's aws and ssh credentials
  3. volumes in the entire repo to keep the docker context non-existant

Running the devops container for the first time

  1. Make sure your aws credentials are valid
  2. Run docker-compose build devops && docker-compose run devops
  3. Run cd devops/scripts
  4. Run ./init-terragrunt.sh

You can now run terragrunt from the terragrunt folder. You will need to update the various HCL files for your cloud environments, but they will be marked Once done, run terragrunt apply on the area you'd like to deploy

Redis

The app out of the box is configured to be able to work with redis for an offsite session storage. This will allow deploys to occur without logging users out. It also removes the need for sticky load balancers. This is config driven so you can disable it for a lighter backend

Config

The app uses env-var to pull in environment variables into a single config file. There are no other ways to inject a config by environment to keep the inheritance down to a minimum

Conventions

Read more on the following topics in our included docs:

Known issues:

  • If a module unfound error from a missing npm package is thrown, the live restart does not work as it doesn't run npm installs. The process should exit instead

About

Starter package for a React based single page application.

Resources

License

Contributing

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • JavaScript 67.9%
  • HCL 16.7%
  • Shell 10.7%
  • SCSS 2.3%
  • Dockerfile 1.6%
  • Pug 0.8%