StudioSpace is a creative-space marketplace for independent filmmakers, photographers, podcasters, musicians, and makers.
- Discover and filter photo studios, film stages, podcast lounges, music suites, and workshops.
- Create an account with email/password or Google; private APIs require an authenticated session and a signed HTTP-only JWT cookie.
- Add, edit, and delete studio listings. Listing ownership is checked by the API.
- Request a studio booking, review your bookings, and cancel pending requests. The API checks confirmed time-slot overlaps.
- Responsive home page, studio details, theme toggle, custom empty and not-found states, and toast notifications.
- Stack: Next.js App Router, TypeScript, Express, MongoDB, Better Auth, JWT, Sonner, and Lucide.
- Install Node.js 20.9 or later and run MongoDB locally, or create a MongoDB Atlas database.
- In
server, copy.env.exampleto.env, setMONGODB_URI, and replaceBETTER_AUTH_SECRETwith a random string of at least 32 characters. SetBETTER_AUTH_URL=http://localhost:5000andCLIENT_URL=http://localhost:3000. - In
client, copy.env.exampleto.env.local; the default API URL works for local development. - For Google sign-in, create Google OAuth credentials and set
GOOGLE_CLIENT_IDandGOOGLE_CLIENT_SECRETin the server environment. Addhttp://localhost:5000/api/auth/callback/googleas an authorized redirect URI. - To enable direct cover-image uploads, add an ImgBB API key to
NEXT_PUBLIC_IMGBB_API_KEYinclient/.env.local. A public image URL can also be entered directly. - Run
npm installin bothclientandserver. Start the API withnpm run devinserverand the website withnpm run devinclient. - Visit
http://localhost:3000, register an account, and use it to create a studio and a booking. Examiner accounts should be created in the deployed app; no shared default password is committed.
Deploy server as a Node service and client as a Next.js app. The Vercel rewrite in vercel.json proxies /api/* requests to the API so authentication cookies remain same-origin in the browser. Set the client's NEXT_PUBLIC_API_URL to the deployed website origin (for example, https://your-site.vercel.app). Set the server's CLIENT_URL to that exact origin and BETTER_AUTH_URL to the API's public URL. Register the Google callback at <BETTER_AUTH_URL>/api/auth/callback/google. Ensure the API host supports Next.js route fallback/reloads.
Live site: add the deployed URL after hosting.
GET /api/healthGET /api/studios,GET /api/studios/featured,GET /api/studios/:idPOST /api/studios,PATCH /api/studios/:id,DELETE /api/studios/:idGET /api/studios/minePOST /api/bookings,GET /api/bookings/mine,PATCH /api/bookings/:id/cancel
Private endpoints validate the Better Auth session and a signed JWT in a seven-day HTTP-only cookie. Never commit production credentials or examiner passwords.