YSvelGoK Svelte Themes

Ysvelgok

A High-Performance Svelte + Go + MongoDB Boilerplate Kit

⚡️ YSvelGoK: High-Performance Svelte + Go + MongoDB Kit

YSvelGoK (Yaxel's Svelte + Go Kit) is a robust, full-stack boilerplate designed for rapid application development. It combines the raw speed and stability of Go for the backend with the reactive simplicity of Svelte for the frontend, all powered by the flexible MongoDB database.

Core Component Stack

There are three core components to this project, ensuring separation of workload, and maintainability.

This project follows a Model View Controller (MVC) architecture pattern to maintain. Svelte serves as the view, and the API as both the model (enforcing structure) and controller.

💾 Database (MongoDB)

This layer utilizes MongoDB to provide a flexible and scalable data persistence solution.

  • Schemaless Simplicity: Data is securely stored without the need for an intricate, pre-defined schema. New fields are automatically serialized into MongoDB from the Go structs and deserialized back into the User structure.

⚙️ API

The backend, built with Go, acts as the central hub, providing high-performance routing, enforcing authorization, and handling core logic.

  • argon2: Used for password hashing. Argon2 is a memory-hard and time-hard algorithm that securely hashes passwords with a randomized salt, offering strong protection against brute-force and rainbow table attacks.
  • JWT: Provides stateless session management. Authorization status is determined by cryptographically verifying the token's signature, allowing the API to validate users without making an immediate database request for every secured route.

🖥️ Frontend

The user interface, powered by Svelte, delivers an eye-pleasing, reactive, and highly efficient user experience.

  • Svelte: Compiles UI components into highly optimized vanilla JavaScript, resulting in fast load times and minimal overhead.
  • tailwind: To easily create an eye-pleasing interface while optimizing load times by only compiling used classes.
  • Bun: The development environment is interpreted using Bun, a fast all-in-one JavaScript runtime and toolkit, ensuring optimal performance.

🚀 Getting Started (With Docker 🐋)

This set-up will be made with Docker compose, not only to streamline the deployment process, but to provide the blueprints to run this project in any OS.

1. Clone the repository

git clone https://github.com/yxl-prz/YSvelGoK
cd ./YSvelGoK

2. Edit neccesary environment variables

Rename .env.example to .env so Docker can read it once docker compose is executed.

cp ./.env.example ./.env
nano ./.env

3. ✈️ Deploy!

docker compose up -d

Top categories

Loading Svelte Themes