A very simple single-file PDS home page to list active users

add README

finxol.io cbf663b2 d12e9171

verified
Changed files
+65 -28
src
+38
README.md
···
···
+
# PDS Home
+
+
Very simple single-file PDS home page.
+
+
## Why?
+
+
By default, the PDS home page isn't very nice, especially on mobile.
+
It's fine as a default, but we can do better.
+
+
The approach here is to make it into a single glorious HTML file to avoid overriding too many routes on the PDS,
+
and make deployment as simple as possible.
+
+
There's still a build step involved because there's some dependencies involved (`atcute`),
+
and working with types and CSS/JS in separate files is so much nicer.
+
+
## How to use
+
+
Before you deploy, you may want to fork this repository to customise the welcome message and/or PDS owner listed.
+
+
- Install dependencies with `pnpm i`
+
+
- Build the file with `pnpm run build`
+
+
- Upload the `dist/index.html` file to static hosting.
+
+
The most straighforward solution is to host it on the same server as your PDS.
+
+
You can simply add this directive to your Caddyfile:
+
+
```Caddyfile
+
@home path /
+
handle @home {
+
root /<the directory where the file is>
+
file_server
+
}
+
```
+
+
You will now see a pretty little home page for your PDS!
+27 -26
package.json
···
{
-
"name": "pds-home",
-
"private": true,
-
"version": "0.0.0",
-
"type": "module",
-
"scripts": {
-
"dev": "vite",
-
"build": "tsc && vite build",
-
"preview": "vite preview"
-
},
-
"devDependencies": {
-
"typescript": "~5.9.3",
-
"vite": "npm:rolldown-vite@7.1.14",
-
"vite-plugin-singlefile": "^2.3.0"
-
},
-
"pnpm": {
-
"overrides": {
-
"vite": "npm:rolldown-vite@7.1.14"
}
-
},
-
"dependencies": {
-
"@atcute/atproto": "^3.1.4",
-
"@atcute/bluesky": "^3.2.3",
-
"@atcute/client": "^4.0.3",
-
"@atcute/identity": "^1.1.0",
-
"@atcute/identity-resolver": "^1.1.3",
-
"@atcute/lexicons": "^1.1.1"
-
}
}
···
{
+
"name": "pds-home",
+
"private": true,
+
"version": "0.0.0",
+
"type": "module",
+
"scripts": {
+
"dev": "vite",
+
"build": "tsc && vite build",
+
"preview": "vite preview",
+
"deploy": "pnpm build && scp -r dist/index.html akhaten:/srv/http/pds-home.html"
+
},
+
"devDependencies": {
+
"typescript": "~5.9.3",
+
"vite": "npm:rolldown-vite@7.1.14",
+
"vite-plugin-singlefile": "^2.3.0"
+
},
+
"pnpm": {
+
"overrides": {
+
"vite": "npm:rolldown-vite@7.1.14"
+
}
+
},
+
"dependencies": {
+
"@atcute/atproto": "^3.1.4",
+
"@atcute/bluesky": "^3.2.3",
+
"@atcute/client": "^4.0.3",
+
"@atcute/identity": "^1.1.0",
+
"@atcute/identity-resolver": "^1.1.3",
+
"@atcute/lexicons": "^1.1.1"
}
}
-2
src/atproto.ts
···
return
}
-
console.log(doc.value);
-
return doc.value.alsoKnownAs;
}
···
return
}
return doc.value.alsoKnownAs;
}