Docs/Self-Hosting Guide
Self-Hosting Guide
Run StudyMap for your own city. Everything below works from a fork, no coding required beyond editing one config file and your place data.
Click "Use this template" at the top of StudentSuite/StudyMap to create your own copy, then clone it.
git clone https://github.com/<your-account>/<your-fork>.gitcd <your-fork>npm installEverything region- and data-specific lives in studymap.config.ts at the repo root.
cp studymap.config.example.ts studymap.config.tsEdit it:
center:[lat, lng]for the initial map viewdefaultZoom: initial zoom level (11-13 works well for a metro area)bounds: rough coordinate box around your region, used for data validation and map fittingcities: display order for the city filter (anything in your data but missing here still shows, just sorted alphabetically after)places: swap the sample imports for your owndata/places/*.jsonfiles
The dataset itself follows the schema on Place Data Format. data/places.sample/ has two minimal example entries if you want to start from a clean skeleton instead of the dataset that ships with the template.
Validate as you go:
npm run validatecp .env.example .env.localNEXT_PUBLIC_MAPTILER_KEYis required for the map basemap. Free tier, no credit card, at cloud.maptiler.com.- The Supabase variables are optional. Leave them blank and the map, filters, and calendar all work; you just won't get sign-in or the two private features in step 5.
npm run devOpen localhost:3000/map and confirm your places show up in the right spot.
These three features (sign-in, saved custom places, personal calendar events) need a Supabase project. Skip this whole step if you only want the public map and calendar.
- Create a free project at supabase.com.
- Copy its URL and anon key into
.env.local(NEXT_PUBLIC_SUPABASE_URL,NEXT_PUBLIC_SUPABASE_ANON_KEY). - In the Supabase SQL editor, run every file in
supabase/migrations/, in filename order. Each one creates its tables with row-level security already scoped toauth.uid(), so users can only ever read or write their own rows. - Enable whichever auth providers you want (email, Google, etc.) under Authentication > Providers.
Deploy like any standard Next.js app, for example on Vercel:
npx vercelor import the repo at vercel.com/new and set the same environment variables from step 3 in the project settings.
Static export (output: "export") is not supported. Sign-in needs a live server: the OAuth callback route exchanges a code for a session server-side, and middleware refreshes that session on every request. Both are incompatible with a static build. Deploy to a normal server/edge runtime instead - that's the default for Vercel and most other Next.js hosts.
To pull in upstream fixes, add the original repo as a remote and merge from it:
git remote add upstream https://github.com/StudentSuite/StudyMap.gitgit fetch upstreamgit merge upstream/mainYour studymap.config.ts, .env.local, and data/places/*.json are yours - upstream changes to shared code (map, calendar, components) merge in without touching them, unless you've also edited those files.