How It Works
When a request arrives, tinykit:- Extracts the domain from the request
- Looks up the project with that domain in Pocketbase
- Serves the production HTML for that project
URL Structure
For any domain pointing to your tinykit server:| URL | What It Shows |
|---|---|
/ | Production app for this domain |
/tinykit | Redirects to builder for this domain |
/tinykit/studio | Builder for this domain’s app |
/tinykit/dashboard | List of ALL apps (same on every domain) |
/tinykit/studio?id=X | Edit a specific app by ID |
The dashboard shows all apps regardless of which domain you access it from. Domains only affect which app is served at the root URL (
/).Setting Up Multiple Domains
1
Deploy tinykit
Deploy to Railway or your preferred host. Note your server’s IP address or hostname.
2
Configure DNS
Point your domains to your tinykit server:Or use CNAME records if your host provides a hostname:
3
Create apps
Visit each domain. If no app exists for that domain, you’ll be redirected to create one:Build your app, and it’s immediately live at that domain.
4
Configure SSL (if needed)
Railway and most platforms handle SSL automatically. For self-hosted setups, use a reverse proxy like Caddy or nginx with Let’s Encrypt.
Managing Apps
From the Dashboard
Visit/tinykit/dashboard from any domain to see all your apps:
- Click an app to edit it
- See each app’s domain
- Create new apps
From Any Domain
Access the builder for the current domain:Domain Normalization
tinykit normalizes domains for matching:- Removes port numbers (
:5173,:3000) - Removes
www.prefix - Converts to lowercase
Unknown Domains
When someone visits a domain that doesn’t have a project:Example Setup
Scenario: Agency with Multiple Clients
Scenario: Personal Projects
Local Development
During local development, tinykit useslocalhost as the domain. All apps are accessible via the dashboard at /tinykit/dashboard.
To test domain routing locally:
-
Add entries to your hosts file:
-
Visit
recipes.local:5173andblog.local:5173 - Each will resolve to its respective project
Deployment Considerations
Railway
Railway provides a single URL (e.g.,your-app.railway.app). To use custom domains:
- Go to your Railway project settings
- Add custom domains
- Configure DNS as instructed
- SSL is automatic
Self-Hosted
For VPS deployments, use a reverse proxy:- Caddy (Recommended)
- nginx
Caddy handles SSL automatically:
Limitations
-
Shared database: All apps share the same Pocketbase instance. Collection names should be unique across apps, or use prefixes (e.g.,
recipes_items,blog_posts). - Shared authentication: Pocketbase auth is shared. A user logged in on one domain is logged into all domains on that server.
- Single server: All apps run on the same server. High-traffic apps might need dedicated hosting.
FAQ
Can I move an app to a different domain?
Can I move an app to a different domain?
Yes. Edit the project in the dashboard and change its domain field. The app will immediately be served at the new domain.
What happens if two projects have the same domain?
What happens if two projects have the same domain?
The first matching project is served. Avoid duplicate domains—each project should have a unique domain.
Can I have an app with no domain?
Can I have an app with no domain?
Yes. Apps without domains are only accessible via the dashboard using their ID (
/tinykit/studio?id=X).Do subdomains work?
Do subdomains work?
Yes.
app.example.com and other.example.com are treated as different domains.