Skip to content

General boilerplate for static React site using Next.js and Typescript with minimal dependencies

Notifications You must be signed in to change notification settings

EricDobyns/React-Boilerplate

Repository files navigation

React Boilerplate

This repository contains a boilerplate for static React site using Next.js and Typescript with minimal dependencies.

  • Hot-Reloading in development
  • Automatic routing
  • Automatic code splitting
  • Static site generation
  • Typescript support
  • Offline support
  • PWA support
  • Multi-language support
  • Unit test support

Getting Started

Install all dependencies

npm i

Run locally with hot reloading

npm start

Run locally as static production build (Requires serve dependency)

npm run serve

Analyze bundle

npm run analyze

Remove temporary files and directories

npm run clean

Lint project files

npm run lint

Run unit tests

npm test

Generate unit test coverage report

npm run test:coverage

Build project files

npm run build

Package static files

npm run package

Deploy to S3 - Requires AWS-CLI, See ./scripts/uploadToS3.sh for details

npm run deploy

Project Structure

/components

React components which could be reused in multiple pages or are complex enough to move them to another file and test them individually.

/lib

Internal code that can be reused and is not specific to an individual project such as apis, contexts, hooks, middleware, utilities, etc.

/pages

In Next.js, a page is a React Component exported from a .js, .jsx, .ts, or .tsx file in the pages directory. Each page is associated with a route based on its file name.

/public

Next.js can serve static files, like images, under a folder called public in the root directory. Files inside public can then be referenced by your code starting from the base URL (/)

/scripts

Miscellaneous scripts used for tooling, automation, deployments, etc.


Code of Conduct

Please see the code of conduct form.

Contributing

Please see the contributing form.

Pull Requests

Please see the pull request form.

License

Copyright © 2019-present Eric Dobyns.

About

General boilerplate for static React site using Next.js and Typescript with minimal dependencies

Topics

Resources

Code of conduct

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published