Webtile is an open-source Vite + React application that connects to Firebase for authentication and data storage. Because all backend infrastructure is provided by Firebase, self-hosting means you only need to serve the compiled static files — no dedicated server process is required. This guide walks through everything from creating a Firebase project to deploying the production build to a VPS or any static host.Documentation Index
Fetch the complete documentation index at: https://mintlify.com/johnlobo/webtile/llms.txt
Use this file to discover all available pages before exploring further.
Check prerequisites
Before you begin, make sure you have:
- Node.js 18 or later installed locally (the reference CI pipeline uses Node 24, but 18+ works for local builds).
- A Google account to create a Firebase project.
- A target host for the static files: a VPS with a web server (nginx, Caddy, etc.), a static hosting platform (Netlify, Vercel, Cloudflare Pages, GitHub Pages), or any HTTP server that can serve a directory.
Create a Firebase project and enable services
- Go to https://console.firebase.google.com and click Add project.
- Enter a project name and follow the wizard. You can disable Google Analytics if you do not need it.
- Once the project is created, enable Authentication:
- In the left sidebar, click Build → Authentication → Get started.
- Under Sign-in method, enable Google (for OAuth popup sign-in) and/or Email/Password.
- Enable Firestore Database:
- In the left sidebar, click Build → Firestore Database → Create database.
- Choose Start in production mode (you will set proper security rules in a later step).
- Select a Cloud Firestore region close to your users.
- Register a web app to obtain your config values:
- In Project Settings (gear icon) → Your apps → click the
</>(Web) icon. - Give the app a nickname and click Register app.
- Copy the
firebaseConfigobject — you will need these values in the next step.
- In Project Settings (gear icon) → Your apps → click the
Fork or clone the repository
Configure environment variables
Copy the provided example file and fill in your Firebase values:Open
.env.local in your editor and populate all six variables. Find the values in Firebase Console → Project Settings → Your apps → Web app → SDK setup and configuration:| Variable | Where to find it | Description |
|---|---|---|
VITE_FIREBASE_API_KEY | SDK config → apiKey | Identifies your Firebase project to the SDK |
VITE_FIREBASE_AUTH_DOMAIN | SDK config → authDomain | OAuth redirect and popup domain |
VITE_FIREBASE_PROJECT_ID | SDK config → projectId | Firestore database and project identifier |
VITE_FIREBASE_STORAGE_BUCKET | SDK config → storageBucket | Cloud Storage bucket name (part of the standard Firebase config object) |
VITE_FIREBASE_MESSAGING_SENDER_ID | SDK config → messagingSenderId | Cloud Messaging sender number |
VITE_FIREBASE_APP_ID | SDK config → appId | Unique identifier for this web app registration |
Vite reads files named
.env.local automatically and keeps them out of version control by default. Never commit .env.local — it contains credentials tied to your Firebase billing account.Install dependencies and run the dev server
http://localhost:5173. Open that address in your browser and confirm the login page loads. Sign in with the Google account you used to create the Firebase project — it will be your first user.Hot Module Replacement (HMR) is intentionally disabled in
vite.config.js because the app is designed to run behind a code-server reverse proxy. Reload the browser manually after making source changes during local development.Build the production bundle
When you are ready to deploy, generate the static Vite outputs optimised, hashed assets to
dist/ directory:dist/. The production build sets base: './' so all asset references are relative — the bundle works correctly from any subdirectory or domain without further configuration.Preview the build locally before deploying:Deploy dist/ to your host
The GitHub Actions + SCP (reference CI pipeline)The repository ships a workflow at
The workflow installs Node 24, runs
dist/ directory is a self-contained static site. How you serve it depends on your infrastructure:Generic VPS (nginx example)Upload dist/ to your server and configure nginx to serve it, making sure all routes fall back to index.html (Webtile uses HashRouter, so the server never needs to resolve sub-paths — any 404 on a .html-less path should return index.html):.github/workflows/deploy.yml that builds the app and copies dist/ to a VPS via SCP on every push to main. Add the following secrets to your GitHub repository (Settings → Secrets and variables → Actions):| Secret | Description |
|---|---|
VITE_FIREBASE_API_KEY | Firebase API key |
VITE_FIREBASE_AUTH_DOMAIN | Firebase auth domain |
VITE_FIREBASE_PROJECT_ID | Firebase project ID |
VITE_FIREBASE_STORAGE_BUCKET | Firebase storage bucket |
VITE_FIREBASE_MESSAGING_SENDER_ID | Firebase messaging sender ID |
VITE_FIREBASE_APP_ID | Firebase app ID |
SSH_HOST | IP address or hostname of your VPS |
SSH_USER | SSH username on the VPS |
SSH_KEY | Private SSH key (the public key must be in ~/.ssh/authorized_keys on the VPS) |
SSH_PORT | SSH port (usually 22) |
npm install && npm run build with the Firebase secrets injected as environment variables, then SCPs dist/ to /home/ubuntu/docker/projects/mi-app-react/ on the target VPS. Adjust the target path in the workflow to match your server layout.Static hosting platformsFor Netlify, Vercel, or Cloudflare Pages, set the six VITE_FIREBASE_* environment variables in the platform’s dashboard and point the build command at npm run build with the output directory set to dist. No additional configuration is needed.Set Firestore security rules
By default, Firestore databases created in production mode deny all reads and writes. You need to add rules that allow each authenticated user to read and write only their own data.All Webtile data lives under the path To deploy these rules:
users/{uid}/projects/{pid} (and sub-collections beneath it). The following rules enforce that only the owner of a UID can access documents under that path:- In the Firebase Console, go to Firestore Database → Rules.
- Replace the existing rules with the block above.
- Click Publish.