Modern, production-ready SvelteKit 5 frontend for the Serverless Blog Platform. Built with Svelte Runes, Tailwind CSS v4, and TypeScript.
$state, $derived, $effect)# Clone repository
git clone https://github.com/Anivesh00/blog-post-frontend.git
cd blog-post-frontend
# Install dependencies
npm install
# Create .env file
cp .env.example .env
# Edit .env with your API endpoint
Create a .env file:
PUBLIC_API_BASE_URL=https://your-api-endpoint.com/dev
PUBLIC_S3_BUCKET_URL=https://your-bucket.s3.region.amazonaws.com
npm run dev
Open http://localhost:5173 in your browser.
npm run build
npm run preview
src/
āāā lib/
ā āāā api/ # API client & endpoint functions
ā āāā components/ # Reusable UI components
ā āāā stores/ # Svelte Runes state management
ā āāā utils/ # Utilities (formatting, validation, S3)
āāā routes/ # SvelteKit routes
āāā app.css # Global styles with CSS custom properties
āāā app.html # HTML template
.github/
āāā workflows/
āāā deploy.yml # GitHub Actions CI/CD pipeline
netlify.toml # Netlify configuration
.env.example # Environment variables template
# Go to https://app.netlify.com
# Click "Add new site" ā "Import an existing project"
# Select GitHub and authorize
# Choose this repository
In Netlify Dashboard ā Site settings ā Build & deploy ā Environment:
PUBLIC_API_BASE_URL = https://your-api-endpoint.com/dev
PUBLIC_S3_BUCKET_URL = https://your-bucket.s3.region.amazonaws.com
Go to your GitHub repo ā Settings ā Secrets ā New repository secret
Add these secrets:
NETLIFY_AUTH_TOKEN: Get from Netlify SettingsNETLIFY_SITE_ID: Found in Netlify Site settingsPUBLIC_API_BASE_URL: Your API endpointPUBLIC_S3_BUCKET_URL: Your S3 bucket URLAfter secrets are added:
main ā Automatic production deploymentdevelop ā Preview deploymentnpm run dev # Start dev server at localhost:5173
npm run build # Build for production
npm run preview # Preview production build
npm run lint # Run ESLint (if configured)
npm run format # Format code with Prettier (if configured)
GitHub Actions Workflow (.github/workflows/deploy.yml):
npm run dev -- --port 5174
rm -rf .svelte-kit node_modules/.vite
npm install && npm run dev
# Verify environment variables
echo $PUBLIC_API_BASE_URL
echo $PUBLIC_S3_BUCKET_URL
# Rebuild
npm run build
MIT License - use freely in your projects
Created for Serverless Blog Platform
Made with ā¤ļø using SvelteKit 5, Tailwind CSS & Netlify