Skip to content
This repository has been archived by the owner on Jun 28, 2022. It is now read-only.

A very opinionated (React/TypeScript/Redux/etc) frontend boilerplate

License

Notifications You must be signed in to change notification settings

lapanti/ts-react-boilerplate

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

A very opinionated frontend boilerplate

Greenkeeper badge Build Status License: MIT Dependency Status DevDependency Status Coverage Status Code Climate

Purpose

This is all you need to get started in developing your own web application, using TypeScript, React, server-side rendering and all the other hip tools. If you know what you are doing, you can follow the quick start guide or you can go learn with the walk-through starting here.

Contents

  • If you don't already have it, install Node
  • If you don't already have it, install git
  • Install Yarn
  1. Open up your favorite kind of console
  2. Navigate to the folder in which you want to store the source code
  3. Run git clone git@github.com:Lapanti/ts-react-boilerplate.git
  1. Open up the source code in your favorite TypeScript-capable editor (I recommend Visual Studio Code if you don't have a preference)
  2. Run yarn in the console to install dependencies (it'll take a while on the first run, so go on and read ahead while you wait)
  3. Read through the comments in all the source files to get yourself acquinted with the ideas, concepts and patterns
  4. Start the application by running yarn develop in your console (inside the folder you downloaded the code to) and open up your browser in the address it prints out
  5. Create a deployable version of the application by running yarn build
  6. Start the deployable version by running yarn start or read the How to Docker guide to Dockerize your application
  7. To test your application, run yarn test
  8. Start modifying the code to build your own application
  • Make sure everything has a type (the more you squeeze out of the compiler the easier you're going to have it while developing)
  • Follow BEM-naming with CSS
  • Follow Redux-ducks pattern except that name the reducers as according to the file (see IndexReducer.tsx for an example)

The Dockerfile is where you can find the configuration to build a Docker image out of your application. The first line of the Dockerfile (starting with FROM) includes the base for your Dockerfile, feel free to change it if you want to.

  1. Put your email to the fourth line in the Dockerfile
  2. In your console run docker build .
  3. In your console run docker run -d -p 8080:8080 bd9b1d6725bc but replace bd9b1d6725bc with the image ID you received from the previous command
  4. Host your Docker image in your favorite cloud or local server (the web is filled with guides for this)

The following are all the dependencies of the project, with the reasoning behind their inclusion:

Read the contribution guidelines

  1. Clone this repo (or fork and clone)
  2. Navigate to the directory in console
  3. Run yarn in console
    • [Optional] Install livereload extension to your browser in Chrome or Firefox
  4. Run yarn develop in console
  5. Open your browser in the address printed to the console
  6. Modify the code with your favorite editor
  • You can run all the tests with yarn test
    • psst, you can update your snapshots with yarn test -- -u
  • You can run Jest tests in watch mode with yarn test:watch
  • You can run all tests with coverage with yarn test:ci
  • TypeScript
  • React
  • Redux
  • Server-side rendering
  • Browserify
  • SASS support
  • Add a test framework
  • Dockerize
  • Deployment scripts to AWS
  • create-ts-react-boilerplate scripts

You can contact me through here in Github or on Twitter

All of the code is licensed under the MIT license