STDD-template Svelte Themes

Stdd Template

This is a template for a simple "blog" application using SvelteKit, Tailwindcss, DaisyUI, and Containerized in Docker

MyBlog SvelteKit Template

A ready-to-go SvelteKit blog starter template integrating Supabase, Tailwind CSS (with Typography and Forms), DaisyUI, and Docker (with Docker Compose). It’s designed to help you quickly launch a production-ready blog with dynamic routes, markdown-style content formatting, and a seamless development workflow.

πŸ”‘ Key Features

  • SvelteKit: Server-side rendering (SSR) and filesystem-based routing for lightning-fast pages.

  • Supabase: Backend-as-a-Service for authentication and database (PostgreSQL) integration.

  • Tailwind CSS: Utility-first styling with:

    • @tailwindcss/typography for elegant prose formatting.
    • @tailwindcss/forms for consistent form element styles.
  • DaisyUI: Prebuilt Tailwind component library for buttons, cards, navbars, alerts, and themes.

  • Dynamic Routing: File-based routing with [id] folders for individual blog posts.

  • Docker & Docker Compose:

    • Dev Mode: Live-reload dev server on port 5173.
    • Prod Mode: SSR build on port 3000 with secure environment variable injection.
  • Environment Config: .env file for Supabase credentials (excluded from Git via .gitignore).

πŸš€ Quick Start

Prerequisites

  • Node.js >= v20
  • Docker & Docker Compose
  • A Supabase project with a BlogPost table (columns: id, Title, Desc, Body).

1. Clone the repo

git clone https://github.com/<your-username>/myblog-template.git
cd myblog-template

2. Configure environment

Copy the example env file and fill in your Supabase credentials:

cp .env.example .env
# Edit .env:
# VITE_SUPABASE_URL=https://xyz.supabase.co
# VITE_SUPABASE_ANON_KEY=your-anon-key

3. Development

Start the live-reload development server in Docker:

docker-compose up --build

4. Production Build

Build and run the SSR app in Docker:

docker-compose -f docker-compose.prod.yml up --build -d

πŸ“‚ Project Structure

myblog-template/
β”œβ”€β”€ src/
β”‚   β”œβ”€β”€ lib/
β”‚   β”‚   └── supabaseClient.js   # Supabase client setup
β”‚   └── routes/
β”‚       β”œβ”€β”€ +layout.svelte      # Global layout with navbar & footer
β”‚       β”œβ”€β”€ +page.svelte        # Home landing page
β”‚       └── blog/
β”‚           β”œβ”€β”€ +page.js        # Fetch list of posts
β”‚           β”œβ”€β”€ +page.svelte    # Render list of posts (cards)
β”‚           └── [id]/
β”‚               β”œβ”€β”€ +page.js    # Fetch single post
β”‚               └── +page.svelte# Post detail with `prose` styling
β”œβ”€β”€ app.css                     # Tailwind base, components, utilities
β”œβ”€β”€ tailwind.config.js          # Tailwind + DaisyUI + plugin config
β”œβ”€β”€ postcss.config.cjs          # PostCSS with Tailwind wrapper
β”œβ”€β”€ Dockerfile                  # Production Dockerfile
β”œβ”€β”€ Dockerfile.dev              # Dev Dockerfile with live reload
β”œβ”€β”€ docker-compose.yml          # Compose for dev
β”œβ”€β”€ docker-compose.prod.yml     # Compose for prod
β”œβ”€β”€ .env.example                # Example environment variables
└── README.md                   # This file

🀝 Contributing

  1. Fork the repository
  2. Create a feature branch (git checkout -b feature/my-feature)
  3. Commit your changes (git commit -m "Add my feature")
  4. Push to branch (git push origin feature/my-feature)
  5. Open a Pull Request

πŸ“œ License

MIT

Top categories

Loading Svelte Themes