This repository hosts a SvelteKit 5 blog project that integrates with the AT Protocol to fetch and display blog posts. The project uses Vercel's Incremental Static Regeneration (ISR) to ensure blog content remains fresh without requiring full redeployments.
[!IMPORTANT]
This repository is still under development. Basic functionalities are in place, but additional features are actively being worked on.
unpic
Image Optimization for optimized image delivery.marked
to render rich content.This project uses pnpm
. Install dependencies with:
pnpm install
Create a .env
file in the root of your project based on the provided .env.example
file:
cp .env.example .env
Edit .env
with the following environment variables:
ATP_SERVICE=https://bsky.social
ATP_IDENTIFIER=your-handle.bsky.social
ATP_PASSWORD=your-app-specific-password
ATP_SERVICE
: The URL of the AT Protocol service (default: https://bsky.social
).ATP_IDENTIFIER
: Your AT Protocol handle (e.g., afaikfyi.bsky.social
).ATP_PASSWORD
: Your app-specific password for authentication with the AT Protocol service.This project uses Vercel’s caching headers for ISR. Pages are cached for 5 minutes and revalidated in the background for up to 10 minutes. No additional setup is required for ISR if you deploy on Vercel, as the headers are managed in the code.
src/lib/atprotoClient.js
: Contains functions to authenticate and fetch blog posts from the AT Protocol service.src/routes/+page.server.js
: Fetches and caches the blog list page with ISR.src/routes/[slug]/+page.server.js
: Handles fetching a single blog post based on the slug with ISR.To start the development server:
pnpm dev
This command will launch the SvelteKit app at http://localhost:5173
by default.
This project is configured to work with Vercel. You can deploy it directly by linking your repository to Vercel.
ATP_SERVICE
, ATP_IDENTIFIER
, ATP_PASSWORD
) in the Vercel project settings under Environment Variables.This project uses Vercel’s ISR to automatically revalidate content. The ISR configuration is set directly in SvelteKit’s load functions using the config export with the following settings:
isr: {
expiration: 60, // 1-minute revalidation interval
},
};
This tells Vercel to revalidate the page every 60 seconds, ensuring fresh content while minimizing server load.
/
+page.server.js
fetches a list of blogs from the AT Protocol service and caches it with ISR.unpic
./[slug]
+page.server.js
in the [slug]
directory fetches a specific blog post based on its slug and caches it with ISR.marked
.unpic
for optimized delivery.pnpm
for faster, disk space-efficient package management.ATP_IDENTIFIER
and ATP_PASSWORD
are correct. If you’re having trouble logging in, try regenerating your app-specific password.Feel free to open issues and pull requests for improvements. Please ensure any contributions follow the coding standards and include relevant documentation updates.