You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
# Tracks Blog Editor
This is a standalone static PWA for managing Tracks blog posts. It is intentionally separate from the public website so the website remains read-only.
## Setup
1. Run `../supabase/blog_posts.sql` in the Supabase SQL editor.
2. Create each super admin in Supabase Auth with an email and password.
3. Add the same email, or the Auth user id, in `public.blog_editors` with role `owner` or `super_admin`.
4. For local development, copy `config.example.js` to `config.js` and set the Supabase project URL, publishable/anon key, and optional public website URL.
The app uses Supabase Auth email/password sign-in and RLS-backed CRUD against `public.blog_posts`.
## Deploy to Netlify from a Git repo
This folder can be deployed as its own Netlify site.
1. Push the repo to GitHub/GitLab/Bitbucket.
2. In Netlify, choose **Add new site** -> **Import an existing project**.
3. If this folder is inside the main website repo, set **Base directory** to `blog-editor`. If this folder is the repo root, leave **Base directory** empty.
4. Netlify will read `netlify.toml` and run `npm run build`, then publish `.`.
5. Add these Netlify environment variables:
```bash
SUPABASE_URL=https://YOUR-PROJECT-REF.supabase.co
SUPABASE_ANON_KEY=YOUR_SUPABASE_PUBLISHABLE_OR_ANON_KEY
PUBLIC_SITE_URL=https://YOUR-PUBLIC-WEBSITE.example
```
`PUBLIC_SITE_URL` is optional, but set it if the public blog is deployed as a separate Netlify site. The build generates `config.js` during deploy, so do not commit your local `config.js`.
## Local Preview
Run the editor from a local server, not by opening `index.html` directly:
```bash
npm run preview
```
Then open `http://localhost:4174`.
# Tracks-Music-BlogEditor