This is a live, working reference of every infrastructure capability available to OneShot OS agents. Each section below demonstrates a capability and shows how it works. When you're in the Build phase, study these patterns and adapt them for your product.
Source: public/index.html, public/styles.css, public/app.js
Firebase Auth with Google provider. Users sign in with one click. A user document is auto-created in Firestore on first sign-in. Auth state persists across page refreshes.
Not signed in. Click "Sign in with Google" in the header.
firebase.auth().signInWithPopup(new firebase.auth.GoogleAuthProvider())firebase.auth().onAuthStateChanged(callback) — fires on every page loadusers/{uid} in Firestore with email, displayName, createdAt, paid: falsepublic/app.js (frontend auth), functions/user-lifecycle.js (triggers)NoSQL document database. Store user profiles, product config, conversations, or any structured data. Real-time updates, automatic scaling, security rules per collection.
Sign in to interact with the database.
// Your Firestore user document will appear here
firebase.firestore().collection('users').doc(uid).get().set({ key: value }, { merge: true })admin.firestore().collection('users').doc(uid) (via firebase-admin)config/ (product config), content/ (CMS data), users/ (user profiles), conversations/ (chat history)firestore.rules — users can only read/write their own doc, config/content is public-readfunctions/lib/config.js (config loading + caching), setup/seed-content.js (initial data seeding)Streaming AI chat powered by Gemini (or Claude). Uses Server-Sent Events for real-time token streaming. Conversation history persisted in Firestore. System prompt and product context loaded from config.
POST /api/chat with { message, conversationId?, userId? }{ text: "chunk" }, final event is { done: true, conversationId }fetch('/api/chat', { method: 'POST', body }) then read response.body as a streamconversations/{convId}/messages/{msgId} — last 20 messages loaded as contextconfig/chat-context in Firestore (seeded from project.config.json)ai.provider ("gemini" or "claude") and ai.model in project.config.jsonfunctions/chat.js (endpoint), functions/lib/ai-client.js (model-agnostic wrapper)Stripe Checkout for one-time payments or subscriptions. Webhook handler updates user status in Firestore. Admin coupon auto-created. Promotion codes enabled at checkout.
Sign in to test the payment flow.
Click below to start a Stripe Checkout session ($1.00 demo charge).
Use admin coupon FISHSTUDIO123OFF to make it free.
POST /api/create-checkout with { userId } — returns { url }window.location.href = data.url sends user to Stripe's hosted checkoutPOST /api/stripe-webhook handles checkout.session.completed — sets users/{uid}.paid = truecustomer.subscription.deleted sets paid = false (subscriptions only)allow_promotion_codes: true in checkout paramsstripe.priceAmount, stripe.mode ("payment" or "subscription") in project.config.jsonsetup/create-stripe-product.jsfunctions/create-checkout.js, functions/stripe-webhook.jsAutomatic emails via Resend. Signup confirmation fires on user creation. Post-payment welcome fires when payment is confirmed. Branded with product colors from config.
Emails are sent automatically by Firestore triggers — no frontend code needed:
users/{uid} document is createdusers/{uid}.paid changes from false to trueSign in above to trigger the signup email (check your inbox).
onDocumentCreated('users/{userId}') and onDocumentUpdated('users/{userId}')new Resend(apiKey).emails.send({ from, to, subject, html })email.from, email.signupSubject, email.welcomeSubject in project.config.jsonbrand.colors.primary from Firestore configfunctions/user-lifecycle.js — both triggers in one file
Every product gets {subdomain}.northmirror.com with automatic SSL.
Handled entirely by deploy.sh — no manual DNS configuration needed.
proxied: false — DNS only)SSL cert takes 5-30 minutes. The .web.app URL works immediately.
subdomain in project.config.json — deploy.sh does everything elseproxied: false) — Cloudflare proxy breaks Firebase domain verificationdeploy.sh Step 10 (lines 270+)These capabilities will be added to this demo over time. Once added, they'll be available to all OneShot Startup workspaces immediately.
When you're ready to deploy, your project needs this structure:
your-project/ ├── project.config.json ← Required: name, subdomain, pricing, email ├── public/ ← Required: your frontend ├── functions/ ← Required: your backend │ ├── package.json │ └── index.js ← Exports your Cloud Functions ├── content/ ← Optional: JSON files seeded to Firestore ├── firebase.json ← Optional: defaults provided └── firestore.rules ← Optional: defaults provided
Then run:
../Infrastructure\ Demo/deploy.sh /path/to/your-project/
Read AgentManual.md in this folder for the complete guide.