Prerequisites
Before you begin, ensure you have the following installed:- Node.js (v14 or higher)
- npm (comes with Node.js)
- A code editor (VS Code recommended)
- A local development server (Live Server extension or similar)
Getting Started
Install Dependencies
Install the required npm packages (primarily Tailwind CSS):This will install:
tailwindcss- For styling- Any other development dependencies
Build Tailwind CSS
Compile Tailwind CSS for the first time:This command:
- Takes
src/input.cssas input (which imports Tailwind) - Outputs to
css/style.css - Minifies the output for production
Start Development Server
Open the project in your preferred development server:
- Using VS Code Live Server: Right-click
index.htmland select “Open with Live Server” - Using Python:
python -m http.server 8000 - Using Node.js http-server:
npx http-server
http://localhost:5500 (or your server’s URL) to see the application.Development Workflow
Watch Mode for Tailwind CSS
For active development, use watch mode to automatically recompile CSS when you make changes:Keep this command running in a terminal while you develop. It will automatically rebuild your CSS whenever you modify HTML or JavaScript files that use Tailwind classes.
Development Process
-
Start Tailwind watch mode in one terminal:
- Start your local server in another terminal or via your editor
- Make changes to HTML, CSS, or JavaScript files
- Refresh your browser to see changes (or use live reload)
Building for Production
When you’re ready to deploy, build the minified CSS:--minify flag optimizes the CSS file size for production deployment.
Testing PWA Features
Testing Service Worker Offline Functionality
Testing Service Worker Offline Functionality
To test the Progressive Web App (PWA) features:
- Build and serve the application over HTTPS or localhost
- Open DevTools (F12) → Application tab
- Check “Service Workers” to see registration status
- Enable “Offline” mode in the Network tab
- Reload the page - it should still work offline
sw.js in the root directoryRegistration: Handled in js/shared.js:21-26Testing PWA Installation
Testing PWA Installation
To test the “Install App” functionality:
- Serve the app over HTTPS (required for PWA installation)
- Open in Chrome/Edge (desktop or mobile)
- Look for the “Install” button in the header
- Click to install as a standalone app
- Launch from your OS to test standalone mode
manifest.json in the root directoryTroubleshooting
Tailwind styles not applying
Tailwind styles not applying
Solution:
- Make sure watch mode is running (
npm run dev) - Check that
tailwind.config.jsincludes your files in thecontentarray - Verify
src/output.cssis linked in your HTML files - Clear browser cache and hard reload (Ctrl+Shift+R)
Service Worker caching issues
Service Worker caching issues
Solution:
- Open DevTools → Application → Service Workers
- Click “Unregister” for the service worker
- Clear site data in Application → Storage
- Hard reload the page (Ctrl+Shift+R)
IndexedDB data not persisting
IndexedDB data not persisting
Solution:
- Check browser console for errors
- Verify you’re not in private/incognito mode
- Check browser storage settings allow local data
- Clear IndexedDB and start fresh: DevTools → Application → Storage → IndexedDB
Next Steps
Project Structure
Learn about the codebase organization
Customization Guide
Customize the POS system for your needs