svelte-strapi-template Svelte Themes

Svelte Strapi Template

Strapi + SvelteKit Website Template

A modern full-stack website boilerplate using Strapi as a headless CMS and SvelteKit as the frontend framework.


๐Ÿš€ Getting Started

Follow these steps to get your local environment up and running.

1. Clone the repository

git clone https://github.com/your-username/your-repo.git
cd your-repo

2. Set environment variables

Both the Strapi backend and SvelteKit frontend require their own .env files.

You have two options:

chmod +x create-envs.sh
./create-envs.sh

This script will:

  • Prompt you for required environment values
  • Generate .env files for both /strapi and /app

Option B: Set manually from samples

  1. Copy the sample files:
cp strapi/.env.sample strapi/.env
cp app/.env.sample app/.env
  1. Open each file and fill in the values:
    • strapi/.env: Contains database, secret keys, and S3 configuration
    • app/.env: Contains public URLs and GraphQL endpoint

3. Run the applications

Each app has its own package.json. Run the following from the root or their directories.

Run Strapi (CMS)

cd strapi
npm install
npm run develop

Run SvelteKit (Frontend)

cd ../app
npm install
npm run dev

๐Ÿงฐ Tech Stack

  • Strapi โ€” Headless CMS for managing content
  • SvelteKit โ€” Frontend framework for building modern web apps
  • PostgreSQL โ€” Primary database
  • S3-Compatible Storage โ€” For media asset storage

๐Ÿ“ Project Structure

.
โ”œโ”€โ”€ app/            # SvelteKit frontend
โ”‚   โ””โ”€โ”€ .env        # Frontend env config
โ”œโ”€โ”€ strapi/         # Strapi backend (CMS)
โ”‚   โ””โ”€โ”€ .env        # Backend env config
โ”œโ”€โ”€ create-envs.sh  # Script to generate .env files
โ””โ”€โ”€ README.md

๐Ÿงช Useful Commands

Command Description
npm run develop (Strapi) Run CMS in development mode
npm run dev (SvelteKit) Start the frontend dev server
nvm use Use Node.js version from .nvmrc

Top categories

Loading Svelte Themes