Go to file
matthieu42morin f833c9c206 vhjhhj 2024-07-03 10:10:15 +02:00
.vscode Init, Main page design choices 2023-11-06 11:02:38 +01:00
scripts FOR REFERENCE unfinished imageuploader script for automating image upload, may ditch that in the future 2024-03-31 05:40:43 +02:00
src vhjhhj 2024-07-03 10:10:15 +02:00
static funi error 2024-03-20 16:12:21 +01:00
tests vhjhhj 2024-07-03 10:10:15 +02:00
.dockerignore ignores add, fix 2024-03-16 03:53:01 +01:00
.eslintignore ignores add, fix 2024-03-16 03:53:01 +01:00
.eslintrc.cjs Init, Main page design choices 2023-11-06 11:02:38 +01:00
.gitignore ignores add, fix 2024-03-16 03:53:01 +01:00
.prettierignore ignores add, fix 2024-03-16 03:53:01 +01:00
.prettierrc Init, Main page design choices 2023-11-06 11:02:38 +01:00
README.md vhjhhj 2024-07-03 10:10:15 +02:00
mdsvex.config.js mdsvex 2024-03-24 14:40:56 +01:00
package.json vhjhhj 2024-07-03 10:10:15 +02:00
playwright.config.ts Init, Main page design choices 2023-11-06 11:02:38 +01:00
postcss.config.cjs Init, Main page design choices 2023-11-06 11:02:38 +01:00
svelte.config.js vhjhhj 2024-07-03 10:10:15 +02:00
tailwind.config.ts Init, Main page design choices 2023-11-06 11:02:38 +01:00
tsconfig.json CONTENT - structure, schema, config updates + file transfers 2024-04-05 14:29:56 +02:00
vite.config.ts vhjhhj 2024-07-03 10:10:15 +02:00

README.md

create-svelte

This is the repo of the website Kkosmetickysalon.cz, my mom's business, I also did the logos and branding, which are located either in /static or are on Cloudinary and are printed at multiple places in multiple formats. The texts are a work of mom, me and Google's Gemini( it's stupid for most complex tasks, but it's good at rewriting text and adding marketing emotions and so on, especially good at Czech unlike the other models)

Webapp stack

Sveltekit with advanced config

Sveltekit is simple, modern metaframework for svelte. The docs are great, love the decisions and features, don't need anything more or less for websites with moderate complexity and PWAs.

Skeleton UI library

This is perhaps the best UI library for sveltekit, their docs and their code is great

Tailwind + PostCSS + Fontawesome local

Utility css is quick to develop, easy to remember, readable little boilerplate needed. Postcss as a dependency and for conditional css. Fontawesome free for local icons as fonts.

Most importantly, SCREW CMS, use .md and json or yaml and parse them

Motivation

I have spent considerable amount of time researching and learning the bloatware, complex CMS systems and SaaS models, that are on the internet caused by the nocode movement and enough is enough. It takes a fraction of a time, if any to understand how json works, if you know it's a way to represent and structure content and understand key/value, then you're set. Introducing .md is a no brainer to any content writing.

  • it's dead simple and you literally almost just import it
  • You don't have to host strapi or a db on a minimum 4GB RAM server in the cloud for making a post once a month and have to maintain the bloat.
  • Static makes better SEO

Use case

I have a $content path (./src/content), where I have ./services/ and ./posts in the former I store individual service categories (and their respective items) in json files, in the latter I have posts, where I store .md files, which are subsequently processed by MDSveX and the html outputted from MDSveX is relayed to ./sluzby/[id]. It's very DRY, there are no lockins and it's reusable on a lot of platforms. Everything has a schema (e.g. ./sluzby/schema#) or a type or a generatable template. This implementation offers an option to create or edit json files a JSON editor according to a schema to help write new services in a GUI. The json data is validated by ajv with my script in ./tests/ValidateServices.js/ to match the type Service in $lib/types/service.d.ts

Cloudinary with some scripting

I automated checking for images in the content folder and uploading them to Cloudinary. I also have a script that generates a json file with all the images in the content folder and uploads them to Cloudinary. This json file is then used to get images as simple keys.

Features, Components and parts

SEO + Opengraph + frontmatter

my own implementation

LibreMaps

Screw Google Maps, I knew I wanted to use OSM, maybe Mapbox, because I had experience with it, but this was a great ready made, quality solution, repo is here.

Instagram feed

CSP, custom hooks, custom headers

Securing this app with the latest security features and web technologies. If you want to look at the CSP and other policies, look at the headers set in hooks.server.ts. I use Sentry as the endpoint. It took a lot of experimentation to get this right, it is a very strict policy so any new external service will not be allowed and the policies must be changed.

Service Worker, manifest

Why not? It's cool, build PWAs to screw with Apple.

Admin/DevOps Tools

A list of mostly 3rd party useful tools this project uses.

Gitea action CI/CD workflow

hCaptcha

For forms... I may remove this in favor of something else, because it could be a privacy and GDPR issue. Also screw Google and their reCaptcha.

Plausible self-hosted

That or coding some metrics and using some opinionated solution myself.

Sentry - runtime prod & dev analysis

Sentry is cool, I will probably not use 80% of their features, but when doing CSP and all sorts of reporting, this came in very handy. I don't really see an alternative with sveltekit. I want to spend as little time as possible on monitoring and maintenance and still ensure 100% reliability and performance.

Playwright - headless browser target testing

TODO, probably sometime, It can be useful with the service posts.

Dockerfile

Selfhosting this is the only way. I used ansible and terraform to get this thing in the air together with the analytics platform. It's on AWS for now.

Some notable references and minor features

Email obfuscation

Spammers are hopefully not so smart. I sveltyfied a SVG email obfuscation method (because JS bad) from https://rouninmedia.github.io/protecting-your-email-address-via-svg-instead-of-js/.

OpenGraph

My own implementation, extending the Service type to still adhere to one central source of info.

Fonts (look at ./static)

  • Playfair Display
  • Quicksand
  • Montferrat