A framework-agnostic template for building web apps.
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
config
public
scripts
src
.babelrc
.commitlintrc.json
.eslintrc
.gitignore
.lintstagedrc
.prettierrc
LICENSE
README.md
package.json

README.md

web-app-template

A framework-agnostic web app template. It's a stripped down version of create-react-app in which dependencies like React are removed.

Demo

Installation

Clone repository:

git clone https://github.com/remarkablemark/web-app-template.git myapp
cd myapp
rm -rf .git
git init

Install dependencies:

# with npm
npm install

# with yarn
yarn

Make initial commit (but make sure to modify files like package.json beforehand):

git add .
git commit -m "chore: first commit"

Notice that the commit message follows the Conventional Commits format. This will help with releasing.

Push to GitHub or another remote:

git remote add origin <remote-repository-url>
git push origin -u origin master

Scripts

Start development server:

# with npm
npm start

# with yarn
yarn start

Create production build:

# with npm
npm run build

# with yarn
yarn build

Release:

# with npm
npm run build

# with yarn
yarn build

Deploy:

Before deploying, make sure the deploy script and the homepage field in package.json are correct. The current setup deploys to GitHub Pages by pushing the build/ directory to the remote's gh-pages branch.

# with npm
npm run deploy

# with yarn
yarn deploy

Environment Variables

Environment variables work the same as create-react-app except custom environment variables begin with APP_ instead of REACT_APP_.

Test

There are no tests in the template, just linting:

# with npm
npm run lint
npm run lint:fix

# with yarn
yarn lint
yarn lint:fix

Feel free to add a testing framework.

Layout

Directory structure (with files like README.md and package.json omitted):

.
├── config
│   ├── env.js
│   ├── paths.js
│   ├── webpack.config.dev.js
│   ├── webpack.config.prod.js
│   └── webpackDevServer.config.js
├── public
│   ├── index.html # html template
│   └── manifest.json
├── scripts
│   ├── build.js
│   └── start.js
└── src
    ├── index.css
    ├── index.js  # entry js file
    └── registerServiceWorker.js

License

MIT