Skip to content

This is a React PWA Template with setup of core libraries like unstated, axios, moments etc.

License

Notifications You must be signed in to change notification settings

balsikandar/react-pwa-template

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

React PWA Template

This is a template for building a Progressive Web App (PWA) using React. It provides a starting point for creating a web application that can be installed on a user's device and offers offline capabilities.

react-pwa-template

Features

  • ✅ Progressive Web App (PWA) setup
  • ✅ Service Worker for caching and offline support
  • ✅ React Router for client-side routing
  • ✅ Axios for making HTTP requests
  • ✅ Responsive design with CSS Grid and Flexbox
  • ✅ Webpack configuration for development and production builds
  • ✅ ES6+ support with Babel
  • ✅ Hot module replacement for a faster development experience
  • ✅ ESLint and Prettier integration for code consistency
  • ✅ Example components and routes for a quick start

Getting Started

Prerequisites

Make sure you have the following software installed on your system:

Installation

  1. Clone this repository to your local machine:

    git clone https://github.combalsikandar/react-pwa-template.git
    
  2. Navigate to the project directory:

    cd react-pwa-template
    
  3. Install the project dependencies:

    npm install #or yarn
    

Development

Start the development server

npm start
or
yarn start

This will launch the development server at http://localhost:3000. Any changes you make to the code will automatically trigger hot module replacement.

Building for Production

To create a production-ready build of your app, run the following command:

npm run build
or
yarn build

This will generate optimized production files in the build directory.

Deploying

You can deploy your PWA to your preferred hosting platform. Simply upload the contents of the build directory to your server.

Customization

Update the public/manifest.json file with your app's details. Add your own components, styles, and routes to build your app. Customize the service worker in the src/service-worker.ts file to cache specific assets or data.

Contributing

Contributions are welcome! If you'd like to contribute to this template, please follow these steps:

Fork the repository. Create a new branch for your feature or bug fix: git checkout -b feature/your-feature-name or bugfix/issue-number. Make your changes and commit them with descriptive commit messages. Push your changes to your fork: git push origin feature/your-feature-name. Open a pull request against the main branch of this repository. Please make sure to follow the code of conduct and the contribution guidelines.

License

Copyright (C) 2021 Bal Sikandar
Copyright (C) 2011 Android Open Source Project

Licensed under the Apache License, Version 2.0 (the "License");
You may not use this file except in compliance with the License.
You may obtain a copy of the License at

    http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.

Acknowledgments

This template is inspired by best practices in PWA development and the React ecosystem. Special thanks to the open-source community for their contributions and support.