Pages and blogs are dynamically created with Markdown or Joddit and they are server-side rendered then - for SEO and client-side for interaction. Option for only HTML without Javascript was added - header will work with language switcher
Set .env in main directory and in /server
-
adminEmail - email which can add/edit/remove pages and blogs
-
disqusSrc - optional to have comments from disqus
-
cookieSecret, cookieName, TOKEN_KEY - random string
-
works with Node.js v.18+
npm run build
cd server npm run dev
Server and Client run on the same port - it should check if the build exist and if yes, it will include SSR Sveltekit
if (fs.existsSync('../build/handler.js')) { const {handler} = await import('../build/handler.js'); app.use(handler); }
-
Use jsonwebtoken for the Authorization
-
Use express-session for the session management in Express
-
Use language switch with svelte-i18n
-
Pages and Blogs creation with marked
test - privatelibrary.eu
- build docker: docker build -t sveltekit-blog:0.5.1 . (docker build --platform linux/amd64 -t sveltekit-blog:0.5.1 .)
- from dockerhub: docker pull pararel/sveltekit-blog:0.5.1
- docker run -it -d -v $PWD/server/database:/usr/src/app/server/database --env-file $PWD/.env --network=host sveltekit-blog:0.5.1