KkosmetickySalon/README.md

95 lines
4.8 KiB
Markdown
Raw Normal View History

2024-03-24 15:09:34 +00:00
# create-svelte
2023-11-06 10:02:38 +00:00
2024-03-20 15:14:17 +00:00
This is the repo of the website [Kkosmetickysalon.cz](https://kkosmetickysalon.cz), my mom's business, I also did the logos and branding, which are located in `/static`
2023-11-06 10:02:38 +00:00
2024-03-20 15:14:17 +00:00
## Webapp stack
2023-11-06 10:02:38 +00:00
2024-03-20 15:14:17 +00:00
### [Sveltekit with advanced config](https://kit.svelte.dev/docs/introduction)
2023-11-06 10:02:38 +00:00
2024-03-20 15:14:17 +00:00
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.
2023-11-06 10:02:38 +00:00
2024-03-20 15:14:17 +00:00
### [Skeleton UI library](https://skeleton.dev)
2023-11-06 10:02:38 +00:00
2024-03-20 15:14:17 +00:00
This is perhaps the best UI library for sveltekit, their docs and their code is great
2023-11-06 10:02:38 +00:00
2024-03-20 15:14:17 +00:00
### Tailwind + PostCSS + Fontawesome local
2023-11-06 10:02:38 +00:00
2024-03-20 15:14:17 +00:00
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.
2023-11-06 10:02:38 +00:00
2024-03-24 15:09:34 +00:00
### Most importantly, SCREW CMS, use .md and json or yaml and parse them
2023-11-06 10:02:38 +00:00
2024-03-20 15:14:17 +00:00
#### Motivation
2023-11-06 10:02:38 +00:00
2024-03-24 15:09:34 +00:00
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.
2023-11-06 10:02:38 +00:00
2024-03-20 15:14:17 +00:00
- it's dead simple and you literally almost just import it
2024-03-24 15:09:34 +00:00
- 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.
2024-03-20 15:14:17 +00:00
- Static makes better SEO
2023-11-06 10:02:38 +00:00
2024-03-20 15:14:17 +00:00
#### Use case
2023-11-06 10:02:38 +00:00
2024-03-20 15:14:17 +00:00
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.
2024-03-24 15:09:34 +00:00
This implementation offers an option to create or edit json files a [JSON editor](https://github.com/json-editor/json-editor) according to a schema to help write new services in a GUI.
The json data is validated by [ajv](https://ajv.js.org) with my script in `./tests/ValidateServices.js/` to match the type Service in `$lib/types/service.d.ts`
2024-03-20 15:14:17 +00:00
## Features, Components and parts
A list of mostly
### [LibreMaps](https://svelte-maplibre.vercel.app/)
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](https://github.com/dimfeld/svelte-maplibre).
### [Instagram feed](https://github.com/rodneylab/sveltekit-instagram-infinite-scroll)
### CSP, custom hooks, custom headers
2024-03-24 15:09:34 +00:00
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](#sentry---runtime-prod--dev-analysis) 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.
2024-03-20 15:14:17 +00:00
2024-03-24 15:09:34 +00:00
### Service Worker, manifest
2024-03-20 15:14:17 +00:00
2024-03-24 15:09:34 +00:00
Why not? It's cool, build PWAs to screw with Apple.
2024-03-20 15:14:17 +00:00
## Admin/DevOps Tools
A list of mostly 3rd party useful tools this project uses.
### Gitea action CI/CD workflow
### hCaptcha
2024-03-24 15:09:34 +00:00
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.
2024-03-20 15:14:17 +00:00
### Plausible self-hosted
That or coding some metrics and using some opinionated solution myself.
### Sentry - runtime prod & dev analysis
2024-03-24 15:09:34 +00:00
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.
2024-03-20 15:14:17 +00:00
### Playwright - headless browser target testing
TODO, probably sometime, It can be useful with the service posts.
### Dockerfile
2024-03-24 15:09:34 +00:00
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/](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