A lightweight starter kit for building web applications and browser extensions with Preact and Tailwind CSS in TypeScript, optimized for Firefox, Chrome, Edge, and Tor Browser.
- β‘οΈ Preact - Fast 3kB alternative to React with the same modern API
- π¨ Tailwind CSS - Utility-first CSS framework
- π Vite - Lightning fast build tool
- π Hot Module Replacement (HMR)
- π¦ Optimized builds for production
- π Cross-browser support (Firefox, Chrome, Edge, Tor Browser)
- π Browser extension support with automated packaging
- π TypeScript support
- π Privacy-focused (Tor Browser compatible)
- Node.js (version 14 or higher)
- npm or yarn
-
Clone this repository:
git clone <repository-url>
-
Navigate to the project directory:
cd preact-tailwind-starterkit -
Install dependencies:
npm install # or yarn install
Start the development server:
npm run dev
# or
yarn devThe application will be available at http://localhost:5173 (or the next available port).
For browser extension development, use browser-specific commands:
# Firefox
npm run dev:firefox
# Chrome (also works for Opera, Brave, Vivaldi, etc.)
npm run dev:chrome
# Edge
npm run dev:edge
# Tor Browser
npm run dev:torSee README_BROWSER.md for detailed browser extension setup instructions.
Create a production build:
npm run build
# or
yarn buildPreview the production build:
npm run preview
# or
yarn previewCreate browser extension packages:
# Single browser
npm run release:firefox
npm run release:chrome
npm run release:edge
npm run release:tor
# All browsers at once
npm run release:allExtension packages will be created in the release/ directory.
βββ assets/ # Project assets (screenshots, etc.)
βββ config/ # Browser extension configurations
β βββ common.json # Shared extension settings
β βββ firefox.json # Firefox-specific settings
β βββ chrome.json # Chrome-specific settings
β βββ edge.json # Edge-specific settings
β βββ tor.json # Tor Browser-specific settings
βββ scripts/ # Build and development scripts
β βββ dev-setup.js # Development environment setup
β βββ merge-config.js # Configuration merging utility
β βββ release-browser.js # Browser extension packaging
βββ src/ # Source code
β βββ App.tsx # Main application component
β βββ index.css # Global CSS styles (Tailwind imports)
β βββ main.ts # Application entry point
βββ dist/ # Built application (generated)
βββ release/ # Browser extension packages (generated)
βββ index.html # HTML template
βββ package.json # Project dependencies and scripts
βββ postcss.config.js # PostCSS configuration
βββ tailwind.config.js # Tailwind CSS configuration
βββ tsconfig.json # TypeScript configuration
βββ vite.config.js # Vite configuration
βββ README.md # This file
βββ README_BROWSER.md # Browser extension setup guide
This starter kit supports both web applications and browser extensions for:
- Firefox (version 60 and above) - Manifest V2
- Chrome (version 60 and above) - Manifest V3
- Edge (Chromium-based) - Manifest V3
- Tor Browser - Manifest V2 with enhanced security
The Chrome extension build also works with:
- Opera, Brave Browser, Vivaldi, Arc Browser, Kiwi Browser (Android), Yandex Browser
The Firefox extension build also works with:
- Firefox Developer Edition, Firefox Nightly, Firefox ESR
- Automated manifest generation for each browser
- Browser-specific security policies
- Cross-browser compatibility testing
- Privacy-focused configurations (Tor Browser)
The build configuration targets ES2015+ syntax for modern browsers while maintaining compatibility with the specified minimum versions.
To customize Tailwind CSS, modify the tailwind.config.js file. You can extend the theme, add plugins, or configure other options according to your project needs.
Preact is configured through the Vite plugin in vite.config.js. You can modify the configuration there if needed.
TypeScript is configured through the tsconfig.json file. The configuration is set up to work with Preact and Vite, with JSX transforms enabled.
The production build outputs to the dist/ directory. You can deploy this folder to any static hosting service:
- Vercel
- Netlify
- GitHub Pages
- Any traditional web server
Browser extension packages are created in the release/ directory and can be submitted to:
- Firefox: Mozilla Add-ons
- Chrome: Chrome Web Store
- Edge: Microsoft Edge Add-ons
- Opera: Opera Add-ons
- Tor Browser: Manual distribution for privacy-focused users
For detailed browser extension setup and testing instructions, see README_BROWSER.md.
MIT
