cms-starter Svelte Themes

Cms Starter

Starter code for your website's content management system. Uses Fastify for backend and SvelteKit for frontend. Includes basic auth (JWT/cookies), CRUD for users table, and domain management to link your own website to the API.

CMS Starter

Svelte 5 Ready!

Startup your website's CMS easily! Includes basic auth using JWT & cookies, CRUD for users, and a setting to add/remove allowed hosts to link your websites.

Pre-requisite

  1. Docker/Docker Desktop

Pull the project

git clone https://github.com/silverlunah/cms-starter.git

Configure package.json

  1. Replace name and other stuff here to fit your project.

Development (Docker)

Start with Docker first to initialize DB. But during development, local is faster.

Starting the project using Docker

This is similar to how you will run the project in production.

npm run docker:up

Stopping the Docker containers

npm run docker:down

Restarting the Docker containers

npm run docker:restart

Development (Local)

Recommended during development.

Pre-requisuite

  1. Take down frontend and backend container if its still running in docker
  2. Leave MYSQL container running so you don't have to build the db by yourself.(Just a recommendation for easy setup but feel free to do what you want)

Starting the frontend and backend projects

This is using concurrently so you can just take down both processes using ctrl+c / cmd+c

npm run local:up

You might encounter an error if MySQL is not running or not matching the .env database string generated by this script. Check backend/.env to see the initial config. DB name by default is the name in package.json.

NOTE: This is just important for the first run so you could get the project working. If you want to use custom configurations, feel free to remove/modify these scripts from package.json and /scripts directory

Starting the backend project

npm run local:backend:up

Starting the frontend project

npm run local:frontend:up

Prisma

  1. When you modify a model or add a new one at schema.prisma
  2. Run:
npm run prisma:update:table
  1. For full database reset (You will lose all data):
npm run prisma:migrate:reset

Do Not Forget

  1. Add your main website's URL to allowed_hosts db

Initial Login

On first login, you can use:

Production Tips

  1. Remove mysql port in your production docker-compose.yml, this is so that your db is only accessible in your docker network
ports:
      - "3006:3006"
  1. You don't need to worry about prisma commands since production uses "deploy" instead of "dev"

Top categories

Loading Svelte Themes