Skip to content
/ React-Starter Public template

React starter powered by Webpack, TypeScript, Jest and Cypress.

License

Notifications You must be signed in to change notification settings

Sebosek/React-Starter

Repository files navigation

React startup with Redux

🔋 by Webpack, TypeScript, Jest and Cypress.

Build Status Quality Gate Status DeepScan grade

The starter contains a single Counter component, how you're going to use React hierarchy it's up to you, however I'm going to use separations by pages. Each page is made by a dictionary containing components and redux.

The tests live near by source code. Unit test are using *.test.js or *.test.ts naming convetion, Cypress end to end tests are using *.spes.js or *.spec.ts naming convention.

Commands

yarn run serve

Serves the application with webpack dev server.

yarn build

Builds the application in production mode into ./public output directory.

yarn run dev

Builds the application in development mode into ./public output directory.

yarn start

Starts static file server with the application from ./public directory on at http://localhost:5000.

yarn test

Runs Jest tests.

yarn run cypress

Opens Cypress integration testing tool.

yarn lint

Runs TypeScript compiler without any output to check type correctness and then runs ESLint.

SVG support

SVG files are supported in a stupidly easy way to use, thanks to file-loader and @svgr/webpack.

If you want to use an SVG inside the image tag, just import the SVG file and put it into the <img /> tag, as it's shown in the code snippet.

import reactLogo from './logo.svg';

const Image = <img src={reactLogo} alt="React logo" />

But sometimes you want to use the SVG file as the React component and this is exactly the time when @svgr/webpack comes to the party and shines. Just import the SVG file as liked it would be a named export.

import { ReactComponent as ReactLogo } from './logo.svg';

const WithImage = <><ReactLogo /></>

Docker support

Startup comes with Docker support. The application is served by Caddy server, the configuration for Caddy server is in the Caddyfile. To build the Docker file use docker build . --tag react-startup:alpha.

To start that Docker image docker run --rm -it -p 127.0.0.1:9090:80 react-startup:alpha.

Todo

  • Add ESLint
  • Add Dockerfile
  • Add images imports
  • Add SVG imports
  • Add Azure CI pipeline including Unit tests and Cypress
  • Add SonarQube via SonarCloud
  • Dependencies cleanup
  • Add font-types imports

About

React starter powered by Webpack, TypeScript, Jest and Cypress.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published