A Progressive Web Application (PWA) built with React, TypeScript, and Tailwind CSS, featuring offline capabilities, installability, and a mobile-first responsive design.
- ⚡ Progressive Web App (PWA) with offline support
- 📱 Mobile-first responsive design
- 🎨 Modern UI with Tailwind CSS
- 🔄 Service Worker for offline functionality
- 📦 Optimized production build
- 🔍 SEO friendly
- 📝 TypeScript for type safety
- 🛠️ ESLint and Prettier for code quality
- 🔄 Background sync support
- 🔔 Push notifications (ready to implement)
- Node.js (v14 or later)
- npm (v6 or later) or yarn
-
Clone the repository:
git clone https://github.com/yourusername/my-pwa-app.git cd my-pwa-app -
Install dependencies:
npm install # or yarn -
Create a
.envfile based on the.env.example:cp .env.example .env
Update the environment variables in the
.envfile as needed.
npm start- Start the development servernpm run build- Build the app for productionnpm test- Run testsnpm run lint- Run ESLintnpm run format- Format code with Prettiernpm run lint:fix- Fix ESLint issues automatically
my-pwa-app/
├── public/ # Static files
│ ├── index.html # Main HTML file
│ ├── manifest.json # PWA manifest
│ └── service-worker.js # Service worker
├── src/
│ ├── components/ # Reusable components
│ ├── hooks/ # Custom React hooks
│ ├── pages/ # Page components
│ ├── services/ # API services
│ ├── styles/ # Global styles
│ ├── types/ # TypeScript type definitions
│ ├── App.tsx # Main App component
│ ├── index.tsx # Application entry point
│ └── serviceWorker.ts # Service worker registration
├── .env.example # Example environment variables
├── craco.config.js # CRACO configuration
├── tailwind.config.js # Tailwind CSS configuration
└── tsconfig.json # TypeScript configuration
You can install this PWA on your device:
-
Chrome/Edge/Opera for Android:
- Open the app in Chrome/Edge/Opera
- Tap the menu (three dots) and select "Add to Home screen"
- Confirm the installation
-
Safari for iOS:
- Open the app in Safari
- Tap the share icon and select "Add to Home Screen"
- Confirm the installation
-
Desktop (Chrome/Edge/Opera):
- Open the app in the browser
- Look for the install icon in the address bar and click it
- Confirm the installation
This app works offline thanks to the service worker that caches all the necessary assets. You can test this by:
- Opening the app in your browser
- Going offline in your browser's developer tools
- Refreshing the page - the app should still load and function
To create a production build:
npm run buildThis will create a build directory with the production-ready files.
You can deploy the built files to any static hosting service like:
This project is licensed under the MIT License - see the LICENSE file for details.