Skip to content

Commit 9129115

Browse files
feat(roadmap): add roadmap page with json data loading logic with sim… (#215)
…ilar UI like linear custom view ## New .env variable - `LINEAR_API_KEY` - linear API KEY - `LINEAR_CUSTOM_VIEW_ID` - the custom view id from linear that shows the public roadmap - `API_SECRET` - a secret API KEY generated by us that can be used in endpoint to refresh roadmap data and clear cache - `NETLIFY_API_TOKEN` - netlify api token that are used to purge CDN cache of the /developers/roadmap page ## PR Checklist - [ ] Linked issue added (e.g., `Fixes #123`) - [ ] I have run `bun run format` to ensure code is properly formatted - [ ] I have verified that `bun run lint` passes without errors - [ ] If blog post was added: - [ ] Ensure images have been optimised - [ ] Update dates to reflect the actual publishing date when merged (file names, folder names, and frontmatter) ## Summary <!-- What has been updated and why --> Fixes INTORG-636 --------- Co-authored-by: JoblersTune <sarah@interledger.org>
1 parent e292bd6 commit 9129115

28 files changed

Lines changed: 3818 additions & 223 deletions

.env.example

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
# Variables marked "required" will cause a build/runtime error if missing in production.
2+
# To build locally without these keys, run: bun run astro build -- --mode development
3+
4+
# -----------------------------------------------------------------------------
5+
# Linear (required)
6+
# -----------------------------------------------------------------------------
7+
8+
# Linear API key — used by sync functions to fetch roadmap data from Linear
9+
# Get from: Linear → Settings → API → Personal API keys → Create key (read-only scope is sufficient)
10+
LINEAR_API_KEY=lin_api_...
11+
12+
# Linear custom view ID containing the roadmap projects (required)
13+
LINEAR_CUSTOM_VIEW_ID=27df73bc-50ec-4fc1-bbb2-d906236a5bbc
14+
15+
# -----------------------------------------------------------------------------
16+
# Sync API (required)
17+
# -----------------------------------------------------------------------------
18+
19+
# Bearer token for POST /api/sync (manual sync trigger) — set to any strong secret
20+
API_SECRET=
21+
22+
# -----------------------------------------------------------------------------
23+
# Netlify (optional — used for CDN cache purging after sync)
24+
# -----------------------------------------------------------------------------
25+
26+
# Netlify Personal Access Token
27+
# Get from: Netlify UI → User Settings → Applications → Personal access tokens
28+
NETLIFY_API_TOKEN=
29+
30+
# Netlify Site ID — auto-injected by Netlify in production and by `netlify dev` after `netlify link`
31+
# Set manually only if running sync functions outside of the Netlify CLI
32+
# NETLIFY_SITE_ID=

.gitignore

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,12 @@ pnpm-debug.log*
2323
# lock files
2424
bun.lock
2525
bun.lockb
26+
deno.lock
2627
pnpm-lock.yaml
2728
package-lock.json
2829

2930
# webstorm
3031
.idea/
32+
33+
# Local Netlify folder
34+
.netlify

.prettierignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,5 +3,6 @@
33
node_modules
44
public
55
dist
6+
.netlify
67
**/*.min.css
78
**/*.min.js

README.md

Lines changed: 38 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -37,29 +37,48 @@ For more information about the way our documentation projects are set up, please
3737

3838
## Local Development
3939

40-
We are using [Bun](https://bun.sh/) in this repository, but you could theoretically use the package manager of your choice. To install Bun, run
40+
This project requires the [Netlify CLI](https://docs.netlify.com/cli/get-started/) for local development. Running `bun run start` alone will produce a redirect loop — the Netlify CLI proxy is needed to handle routing correctly.
41+
42+
### Prerequisites
43+
44+
Install [Bun](https://bun.sh/) and the Netlify CLI:
4145

4246
```sh
4347
curl -fsSL https://bun.sh/install | bash
48+
npm install -g netlify-cli
4449
```
4550

46-
### 🧞 Commands
51+
Then link the repo to the Netlify site (one-time):
52+
53+
```sh
54+
netlify login
55+
netlify link
56+
```
57+
58+
### Running locally
59+
60+
```sh
61+
bun install
62+
netlify dev # http://localhost:8888
63+
```
4764

48-
All commands are run from the root of the project, from a terminal:
65+
> **Troubleshooting:** If `netlify dev` fails with a Neon extension network error, run `netlify dev --offline` instead — this skips the extension install and everything else works normally. See [`docs/roadmap-linear-sync.md`](docs/roadmap-linear-sync.md) for details.
66+
67+
> **Note:** The roadmap page also requires a one-time blob population step after first run. See [`docs/roadmap-linear-sync.md`](docs/roadmap-linear-sync.md) for details.
68+
69+
### 🧞 Other commands
4970

5071
| Command | Action |
5172
| :------------------------ | :----------------------------------------------- |
5273
| `bun install` | Installs dependencies |
53-
| `bun run start` | Starts local dev server at `localhost:1103` |
74+
| `netlify dev` | Starts local dev server at `localhost:8888` |
5475
| `bun run build` | Build your production site to `./dist/` |
5576
| `bun run preview` | Preview your build locally, before deploying |
5677
| `bun run astro ...` | Run CLI commands like `astro add`, `astro check` |
5778
| `bun run astro -- --help` | Get help using the Astro CLI |
5879
| `bun run format` | Format code and fix linting issues |
5980
| `bun run lint` | Check code formatting and linting |
6081

61-
You can substitute the `bun` commands with whatever package manager of your choice uses.
62-
6382
### 🔍 Code Formatting
6483

6584
This project uses [ESLint](https://eslint.org/) for code linting and [Prettier](https://prettier.io/) for code formatting. Before submitting a pull request, please ensure your code is properly formatted:
@@ -99,6 +118,19 @@ This runs `gcloud compute url-maps invalidate-cdn-cache` against `/developers/*`
99118

100119
For more information about the main Interledger.org infrastructure and deployment pipeline, see the [`interledger.org-v4`](https://github.com/interledger/interledger.org-v4) repository.
101120

121+
## Netlify Serverless Functions
122+
123+
This project uses Netlify serverless functions to power the live roadmap page:
124+
125+
| Function | Purpose |
126+
| :------------------------------- | :--------------------------------------------------------------------------------------------------- |
127+
| `netlify/functions/sync.mts` | Scheduled sync — fetches roadmap data from Linear every 12 hours and caches it in Netlify Blobs |
128+
| `netlify/functions/sync-now.mts` | Manual sync — exposes `POST /api/sync` (deployed) or `POST /.netlify/functions/sync-now` (local dev) |
129+
130+
The roadmap page is server-side rendered and reads from the blob cache on each request. The CDN caches the rendered HTML for 12 hours; the sync functions purge that cache after each update.
131+
132+
For full details on the architecture, environment variables, local development setup, and how Deploy Previews interact with the shared blob store, see [`docs/roadmap-linear-sync.md`](docs/roadmap-linear-sync.md).
133+
102134
Thank You for Contributing! We appreciate your effort to write a blog post and share your expertise with the community!
103135

104136
## Writing a blog post

astro.config.mjs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,13 @@ import starlightLinksValidator from 'starlight-links-validator'
44
import starlightFullViewMode from 'starlight-fullview-mode'
55

66
import mdx from '@astrojs/mdx'
7+
import netlify from '@astrojs/netlify'
78
import { PUBLISHED_RFC_SIDEBAR_ITEMS } from './src/data/rfcs.ts'
89

910
// https://astro.build/config
1011
export default defineConfig({
12+
output: 'static',
13+
adapter: netlify(),
1114
site: 'https://interledger.org',
1215
base: '/developers',
1316
integrations: [

0 commit comments

Comments
 (0)