Giter VIP home page Giter VIP logo

trialpwas's Introduction

web-app-template

Framework agnostic web app template. This project is like Create React App except React is removed.

View web app.

Prerequisites

Install

Clone the repository:

git clone https://github.com/remarkablemark/web-app-template.git
cd web-app-template

Rename the project:

git grep -l web-app-template | xargs sed -i '' -e 's/web-app-template/my-app/g'
git grep -l 'Web App Template' | xargs sed -i '' -e 's/Web App Template/My App Template/g'
git grep -l 'Web App' | xargs sed -i '' -e 's/Web App/My App/g'

Update the files:

  • README.md
  • package.json
  • public/index.html
  • public/manifest.json
  • src/index.js

Install the dependencies:

npm install

Initialize a new repository:

rm -rf .git
git init

Make your first commit:

git add .
git commit -m 'feat: initialize project from web-app-template'

Commit messages follow the Conventional Commits format, which is used during release.

Once you're ready, push the local repository to GitHub (or another remote repository):

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

Available Scripts

In the project directory, you can run:

npm start

Runs the app in the development mode.

Open http://localhost:3000 to view it in the browser.

The page will reload if you make edits.

You will also see any lint errors in the console.

npm run build

Builds the app for production to the build folder.

It correctly bundles in production mode and optimizes the build for the best performance.

The build is minified and the filenames include the hashes.

Your app is ready to be deployed!

See the section about deployment for more information.

npm run release

Bumps the package.json version with standard-version.

npm run deploy

Deploys the app to GitHub Pages by force pushing the build folder to the remote repository's gh-pages branch.

Environment Variables

Environment variables work similarly to Create React App except they begin with WEB_APP_ instead of REACT_APP_.

For example:

# .env
WEB_APP_VERSION=$npm_package_version
WEB_APP_DOMAIN=www.example.com
WEB_APP_FOO=$DOMAIN/foo

Testing

Tests are run just like Create React App:

npm test

Build

You can build the production app locally with:

npm run build

Rename the build directory if your app is hosted at a subdirectory:

mv build web-app-template

Or enter the build directory if your app is hosted at the root:

cd build

Start a static file server:

python -m SimpleHTTPServer

Stop the server with Ctrl + C.

Open http://localhost:8000 to view it in the browser.

If your app is hosted at a subdirectory, open the folder in the directory listing.

Once you're done, clean up the build directory.

If your app is hosted at a subdirectory:

rm -rf web-app-template

Or if your app is hosted at the root:

rm -rf build

Layout

Directory structure (dotfiles are omitted):

tree -I 'build|node_modules'
.
├── LICENSE
├── README.md
├── package.json
├── public
│   ├── favicon.ico
│   ├── index.html
│   ├── logo192.png
│   ├── logo512.png
│   ├── manifest.json
│   └── robots.txt
└── src
    ├── index.css
    ├── index.js
    ├── reportWebVitals.js
    └── setupTests.js

2 directories, 13 files

Migration

Migrate to use @descriptive/web-scripts:

npx web-scripts-migration

See blog post or web-scripts-migration.

License

MIT

trialpwas's People

Contributors

umiatiyah avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.