···25252626Read ours here: [Leaflet Lab Notes](https://lab.leaflet.pub/).
27272828+### Local Development (Linux, WSL)
2929+3030+#### Prerequisites
3131+3232+- [NodeJS](https://nodejs.org/en)
3333+- [Supabase](https://supabase.com)
3434+- [Docker](https://docker.com)
3535+3636+#### App setup
3737+3838+1. Clone the repository `git clone https://tangled.org/leaflet.pub/leaflet.git`
3939+ 1. If using WSL, it's recommended to install in the native file structure vs in a mounted Windows file structure (i.e, prefer installing at `~/code/leaflet` vs `/mnt/c/code/leaflet`)
4040+2. Install the dependencies: `npm install`
4141+3. Create a new Supabase project via the Supabase web dashboard.
4242+ 1. Your `API URL`, `ANON KEY`, and `SERVICE ROLE KEY` are found in the `Project Settings --> API Keys` menu. This project uses legacy keys not the publishable/secret API key system.
4343+ 2. The Database URL is found by pressing the `Connect` button at the top of the screen. The direct connection string by default uses the IPv6 systems which can cause issues in default local setups. If that is the case, the Shared Pool connection string will work for IPv4 local development.
4444+4. Create an `.env.local` file in the root folder with the following configuration:
4545+4646+```env
4747+# Supabase Configuration
4848+NEXT_PUBLIC_SUPABASE_API_URL=https://your-project.supabase.co
4949+NEXT_PUBLIC_SUPABASE_ANON_KEY=your-anon-key-here
5050+SUPABASE_SERVICE_ROLE_KEY=your-service-role-key-here
5151+5252+# Database
5353+DB_URL=postgresql://postgres:your-password@db.your-project.supabase.co:5432/postgres
5454+5555+# Leaflet specific
5656+LEAFLET_APP_PASSWORD=any-password-you-want
5757+5858+# Feed Service (for publication features)
5959+FEED_SERVICE_URL=https://localhost:3001
6060+```
6161+5. `npm run dev` to run the project
6262+6363+#### Database Migrations
6464+6565+1. Install the supabase CLI `npm install supabase`
6666+ 1. You can install it globally with the -g flag, in which case you can omit the `npx` from the following commands
6767+2. Login to the CLI `npx supabase login`
6868+3. Link to your database project `npx supabase link --project-ref <project-id>`
6969+4. Run migrations `npx supabase db push`
7070+7171+#### Feed service setup (optional)
7272+7373+Setup instructions to run a local feed service from a docker container. This step isn't necessary if you're not working on publication or BlueSky integration features.
7474+7575+1. Clone the repo `git clone https://github.com/hyperlink-academy/leaflet-feeds.git`
7676+2. Update your `.env.local` to include the FEED_SERVICE_URL (if not already set): `git clone https://github.com/hyperlink-academy/leaflet-feeds.git`
7777+3. Change to the directory and build the docker container `docker build -t leaflet-feeds .`
7878+4. Run the docker container on port 3001 (to avoid conflicts with the main app): `docker run -p 3001:3000 leaflet-feeds`
7979+2880## Technical details
29813082The stack: