···11BFF_DATABASE_URL=grain.db
22BFF_PRIVATE_KEY_1=
33BFF_PRIVATE_KEY_2=
44-BFF_PRIVATE_KEY_3=44+BFF_PRIVATE_KEY_3=
55+66+# If running local infra
77+USE_CDN=false
88+DENO_TLS_CA_STORE=system
99+BFF_PLC_DIRECTORY_URL=https://plc.dev.grain.social
1010+BFF_JETSTREAM_URL=https://jetstream.dev.grain.social
1111+PDS_HOST_URL=https://pds.dev.grain.social
···5858deno run dev
5959```
60606161+### Running the whole infra locally PDS + PLC + Jetstream
6262+6363+You must ensure that pds.dev.grain.social resolves to your local machine
6464+(typically 127.0.0.1 or your Docker host).
6565+6666+#### Add to /etc/hosts (macOS/Linux)
6767+6868+```bash
6969+sudo nano /etc/hosts
7070+```
7171+7272+```bash
7373+127.0.0.1 pds.dev.grain.social
7474+127.0.0.1 plc.dev.grain.social
7575+127.0.0.1 jetstream.dev.grain.social
7676+```
7777+7878+#### Start services
7979+8080+```bash
8181+cd local-infra
8282+docker compose up -d
8383+```
8484+8585+#### Install the Root Certificate on Host
8686+8787+First, get your Caddy container ID:
8888+8989+```bash
9090+docker ps
9191+```
9292+9393+Then copy the cert out:
9494+9595+```bash
9696+sudo security add-trusted-cert -d -r trustRoot -k /Library/Keychains/System.keychain grain-root.crt
9797+```
9898+9999+Once you have grain-root.crt, install it:
100100+101101+macOS:
102102+103103+```bash
104104+sudo security add-trusted-cert -d -r trustRoot -k /Library/Keychains/System.keychain grain-root.crt
105105+```
106106+107107+Ubuntu/Linux:
108108+109109+```bash
110110+sudo cp grain-root.crt /usr/local/share/ca-certificates/grain.crt
111111+sudo update-ca-certificates
112112+```
113113+114114+#### Update ENV Variables
115115+116116+Make sure the following env vars are in your .env
117117+118118+```bash
119119+# for running local infra only
120120+DENO_TLS_CA_STORE=system
121121+USE_CDN=false
122122+BFF_PLC_DIRECTORY_URL=https://plc.dev.grain.social
123123+BFF_JETSTREAM_URL=https://jetstream.dev.grain.social
124124+PDS_HOST_URL=https://pds.dev.grain.social
125125+```
126126+127127+#### Run the app
128128+129129+Start the app:
130130+131131+```bash
132132+deno run dev
133133+```
134134+135135+You can then create an account via the "Create Account" button in the navbar.
136136+137137+After clicking the link, verify you are redirected to
138138+`https://pds.dev.grain.social/...`
139139+140140+Create an account with your desired handle.
141141+142142+If all goes well you will be redirectly to the app at
143143+`http://localhost:8080/onboard` and prompted to edit your profile details.
144144+145145+From then on, you can login by typing `https://pds.dev.grain.social` into the
146146+login input and follow the PDS prompts to login.
147147+148148+NOTE: When running with local-infra, only blobs on the local PDS will get
149149+resolved because of the PLC directory. All of the other images will appear
150150+broken. We could do some more work to support both but seems fine for now to
151151+test new features. Just switch back to non local-infra mode and you'll see them
152152+all.
153153+61154## License
6215563156[MIT License](LICENSE)