Skip to content

Commit 39f475b

Browse files
author
Fernando Gomes
authored
Merge pull request #3166 from PostHog/self-driving-sample-apps
feat(self-driving): five new sample apps across frameworks
2 parents de503ee + c619d7c commit 39f475b

66 files changed

Lines changed: 16290 additions & 0 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
node_modules
2+
dist/
3+
.astro/
4+
.env
5+
.env.*
6+
!.env.example
7+
.DS_Store
8+
*.log
Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
# Changelog Hub (Astro 5, SSR)
2+
3+
A server-rendered changelog site built with Astro 5 and the Node adapter. No analytics — this app
4+
is a clean target for the PostHog wizard.
5+
6+
## Features
7+
8+
- Release list rendered on the server, newest first
9+
- Release detail pages at `/releases/:slug`
10+
- 👍 reactions on a release, posted from a small inline client script
11+
- Email subscribe form backed by an API endpoint
12+
13+
## Tech stack
14+
15+
- Astro 5 (`output: 'server'`)
16+
- `@astrojs/node` standalone adapter
17+
- TypeScript
18+
- No UI framework — plain Astro components and inline scripts
19+
20+
## Getting started
21+
22+
```bash
23+
pnpm install
24+
pnpm dev
25+
```
26+
27+
Open http://localhost:4321.
28+
29+
## Routes
30+
31+
| Route | Description |
32+
|---|---|
33+
| `/` | Release list, reactions, subscribe form |
34+
| `/releases/[slug]` | Release detail with full notes |
35+
| `/about` | Static about page |
36+
| `POST /api/subscribe` | Subscribe an email — `{ "email": "you@example.com" }` |
37+
| `POST /api/releases/[slug]/react` | Add a reaction, returns the updated release |
38+
39+
## Project structure
40+
41+
```
42+
src/
43+
├── layouts/Layout.astro # Document shell and global styles
44+
├── lib/releases.ts # In-memory releases and subscribers
45+
└── pages/
46+
├── index.astro # Release list + client script
47+
├── about.astro
48+
├── releases/[slug].astro
49+
└── api/
50+
├── subscribe.ts
51+
└── releases/[slug]/react.ts
52+
```
53+
54+
## Notes
55+
56+
- Releases, reactions, and subscribers live in memory and reset on every server restart
57+
- Seeded with three releases
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
import { defineConfig } from 'astro/config';
2+
import node from '@astrojs/node';
3+
4+
export default defineConfig({
5+
output: 'server',
6+
adapter: node({
7+
mode: 'standalone',
8+
}),
9+
image: {
10+
service: { entrypoint: 'astro/assets/services/noop' },
11+
},
12+
});
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
{
2+
"name": "changelog-hub",
3+
"type": "module",
4+
"version": "1.0.0",
5+
"private": true,
6+
"scripts": {
7+
"dev": "astro dev",
8+
"build": "astro build",
9+
"preview": "astro preview"
10+
},
11+
"dependencies": {
12+
"@astrojs/node": "^9.0.0",
13+
"astro": "^5.0.0"
14+
}
15+
}

0 commit comments

Comments
 (0)