Live: photolio-portfolio.web.app
A light-table style builder for photography portfolios. Pick a design system,
customize its colors, stack reorderable "frames" (cover, galleries, about,
pricing, contact, and more), drop in your own photos and logo, choose exactly
which photo fills which spot, and preview the finished one-page site at
desktop, tablet, or mobile width. Sign in to save your work to the cloud and
publish it at a public URL — /portfolio/your-username.
npm install npm run dev
Open the printed local URL (usually http://localhost:5173).
The builder (/app) works fully without any setup — you just can't sign in or
save until Firebase is configured (see below).
/— landing page/app— the builder/signin— sign in / create an account (Google or email+password)/account— profile (name, avatar), email, password, portfolio publish status, switch account, delete account/portfolio/:username— a published portfolio's public, read-only page/privacy,/terms— legal pages (edit these — see the note below)
- Auto sign-in — sessions persist across browser restarts (Firebase's
browserLocalPersistence, set explicitly insrc/firebase.js), so returning visitors land back in the builder already signed in. - Switch account — from
/account, signs out and sends you to/signin; Google sign-in always shows the account chooser (prompt: "select_account") rather than silently reusing whichever Google account was used last, so you can actually pick a different one. - Change name/email/password, all from
/account. Email changes send a verification link to the new address (it only takes effect once clicked — the current Firebase-recommended flow); password/email changes on an older sign-in automatically prompt to re-confirm your password first (or re-auth with Google, for Google-only accounts) — Firebase requires a "recent" sign-in for these. - Delete account — type-to-confirm, then removes the Firestore portfolio doc, every photo doc, and the username reservation before deleting the Firebase Auth account itself, so nothing is left orphaned.
Runs entirely on Firebase's free Spark plan — no billing account needed (Firebase Storage is deliberately not used, since it requires the paid plan; see "How images are stored" below).
- Create a project at console.firebase.google.com.
- Add a web app (Project settings → General → Your apps →
</>) and copy the config values it gives you. - Copy
.env.exampleto.envand fill in those values:cp .env.example .env
- Set up Authentication: Build → Authentication → click "Get started" if you see it (this initializes the product — a separate step from picking providers), then Sign-in method → enable Email/Password, and Google too if you want the "Continue with Google" button to work.
- Set up Firestore: Build → Firestore Database → Create database (production mode is fine — this repo ships its own security rules).
- Restart
npm run dev. The "Firebase isn't configured" notice on/signinshould be gone.
Without steps 3–5 done, the app still runs — sign-in/save/publish just show a clear "not configured" message instead of a crash.
npm install -g firebase-tools # if you don't have it firebase login firebase use --add # pick the project you created above npm run deploy # builds, then `firebase deploy`
firebase.json ships an SPA rewrite, so deep links like /portfolio/someone
and /app work correctly on a full page load or refresh, not just
client-side navigation — no extra routing workaround needed.
- Save (top bar, signed in) writes your content, layout, and design choice to Firestore under your account.
- How images are stored: Firebase Storage isn't used (it needs the paid
Blaze plan) — uploaded photos and your logo are compressed and downscaled
client-side (
src/lib/image.js) and saved directly as Firestore fields instead, one photo per document, so nothing risks Firestore's 1 MiB document-size limit. This comfortably fits typical portfolio-sized photo sets; if you outgrow it, swapping in real object storage (Firebase Storage on the Blaze plan, or S3/R2/Cloudinary) is a contained change — replace the upload calls insrc/lib/portfolioStore.js. - Publish (top bar, signed in) lets you claim a username and makes your
saved portfolio viewable, read-only, at
/portfolio/that-username— by anyone, signed in or not. It's off by default and can be unpublished at any time; unpublishing keeps your username reserved. - Signing in again later automatically loads your last save.
src/pages/Privacy.jsxandsrc/pages/Terms.jsxare real, tailored drafts — accurate to what the app does — but they still have placeholders ([email protected], the "last updated" date, and a governing-law line in the Terms) that need your actual details, and you should have them reviewed before relying on them.- The contact-form segment in the portfolio itself is a visual placeholder — it doesn't send anywhere yet.
npm run dev— start the dev server with hot reloadnpm run build— build a production bundle intodist/npm run preview— preview the production build locallynpm run deploy— build, then deploy to Firebase Hosting
- Vite + React 18, react-router-dom for routing
- Firebase: Authentication, Firestore, Hosting (Spark/free plan — no Storage)
- lucide-react for icons
- Plain CSS (injected via
<style>tags) — no CSS framework. The portfolio's own responsive layout uses CSS container queries scoped to the light table (src/components/Portfolio.jsx), so it reflows correctly on a real narrow window, under the Builder's Tablet/Mobile preview toggle, and standalone on the public portfolio page.
src/
Builder.jsx the editor (design panel, light table, save/publish)
App.jsx route definitions
main.jsx app entry (Router + AuthProvider)
firebase.js Firebase SDK init (reads .env)
contexts/AuthContext.jsx sign-in state + actions
lib/
portfolioStore.js Firestore save, load, publish
image.js client-side photo compression (see "How images are stored")
components/
Portfolio.jsx the shared portfolio renderer — every segment
type, themes, and styles. Used by both the
Builder and the public portfolio page.
MarketingLayout.jsx shared header/footer for the marketing/legal pages
pages/
Landing.jsx, SignIn.jsx, Privacy.jsx, Terms.jsx, PublicPortfolio.jsx
