This is a Next.js project bootstrapped with create-next-app.
Map rendering does not require env vars, but Firebase Authentication does.
Create .env in the project root:
NEXT_PUBLIC_FIREBASE_API_KEY=your_api_key
NEXT_PUBLIC_FIREBASE_AUTH_DOMAIN=your_project.firebaseapp.com
NEXT_PUBLIC_FIREBASE_PROJECT_ID=your_project_id
NEXT_PUBLIC_FIREBASE_APP_ID=your_app_idAlso enable Firebase Auth providers in Firebase Console:
- Email/Password
Roles are stored in Firestore under profiles/{uid} with one of these values:
adminsuperadmin
Behavior:
- On successful sign-in, a missing role doc is auto-created as
admin. - Only
superadmincan access/admin/usersand create new auth accounts.
Bootstrap first superadmin:
- Sign in once with the account to create its
adminrole doc. - In Firestore console, open
profiles/{uid}for that account. - Change
rolefromadmintosuperadmin.
To enable deleting Firebase Auth users from /admin/users, deploy functions:
firebase deploy --only functionsThis project is configured for static Firebase Hosting (next.config.ts uses output: "export", and firebase.json serves out/).
Deploy steps:
npm install
firebase login
firebase use iskolibmap
firebase deploy --only hostingNotes:
firebase deployrunsnpm run buildautomatically viahosting.predeploy.- If deploying through GitHub Actions, add the same
NEXT_PUBLIC_FIREBASE_*values to repository secrets and pass them into the build step.
First, run the development server:
npm run dev
# or
yarn dev
# or
pnpm dev
# or
bun devOpen http://localhost:3000 with your browser to see the result.
You can start editing the page by modifying app/page.tsx. The page auto-updates as you edit the file.
This project uses next/font to automatically optimize and load Geist, a new font family for Vercel.
To learn more about Next.js, take a look at the following resources:
- Next.js Documentation - learn about Next.js features and API.
- Learn Next.js - an interactive Next.js tutorial.
You can check out the Next.js GitHub repository - your feedback and contributions are welcome!
The easiest way to deploy your Next.js app is to use the Vercel Platform from the creators of Next.js.
Check out our Next.js deployment documentation for more details.