### Description - Use `GITEA_TOKEN` instead of tokens set by ourselves. ### Package Changes None ### Screenshots None ### Reference None ### Checklist - [x] A milestone is set - [ ] The related issues has been linked to this branch Reviewed-on: #309 Co-authored-by: SquidSpirit <squid@squidspirit.com>
4.9 KiB
Blog
Description
- Frontend: SvelteKit with Tailwind CSS
- Backend: Rust actix-web
Despite SvelteKit being a full-stack framework, I still decided to adopt a separate front-end and back-end architecture for this blog project. I believe that this separation makes the project cleaner, reduces coupling, and aligns with modern development practices. Furthermore, I wanted to practice developing a purely back-end API.
As for the more detailed development approach, I plan to use Clean Architecture for the overall structure. Of course, such a small project may not necessarily require such complex design patterns, but I want to give myself an opportunity to practice them.
These will allow me to become more proficient in these modern development practices and leave a lot of flexibility and room for adjustments in the future.
For more information about the development process, you can check out the project board. As for the details of the architecture and convention, you can find them in the wiki.
Build & Development Setup
Prerequisites
- Bun - Package manager and runtime for frontend
- Rust - For backend development
- Podman (Optional) - For containerized deployment
Pre-commit Setup
This project uses pre-commit hooks to ensure code quality. To set up pre-commit:
-
Install pre-commit:
pip install pre-commit -
Install the git hook scripts:
pre-commit install
The pre-commit configuration will automatically run:
- Backend Rust code checking
- Frontend linting
- SQL schema preparation
Backend Setup
For detailed backend development setup, see backend/README.md.
Quick start:
- Install sqlx CLI:
cargo install sqlx-cli - Run database migrations:
sqlx migrate run - Prepare SQL schema:
cargo sqlx prepare --workspace - Run the server:
RUST_LOG=debug cargo run
Frontend Setup
For detailed frontend development setup, see frontend/README.md.
Quick start:
- Navigate to frontend directory:
cd frontend - Install dependencies:
bun install - Start development server:
bun run dev - Build for production:
bun run build
Full Project Setup
To set up the entire project:
- Clone the repository
- Set up pre-commit hooks (see above)
- Set up backend (see backend/README.md)
- Set up frontend (see frontend/README.md)
- Start both servers for full-stack development
MCP Server Setup
To configure and run the MCP (Model Context Protocol) servers for AI-assisted development:
-
Install Go: Ensure Go is installed on your system to run Go-based MCP servers (such as the Gitea MCP server).
-
Install Bun: Ensure Bun is installed on your system to run Svelte-based MCP servers (such as the Svelte MCP server via
bunx). -
Install crates.io MCP: Install
cratesio-mcpusing Cargo:cargo install cratesio-mcp -
Configure Environment Variables: Export your Gitea access token:
export GITEA_ACCESS_TOKEN="your_gitea_access_token_here"
Deployment
Self-hosting uses the Kubernetes manifests in manifest/README.md.
CI configuration
Publishing a release runs the
Deployment workflow, which builds and
pushes the frontend and backend images and attaches a zip of manifest/ to the
release. It reads the Actions variables and secrets below, set at the
repository or owner level (Settings → Actions).
Variables
| Name | Example | Used for |
|---|---|---|
REGISTRY |
registry.squidspirit.com |
Registry host for the login step, build cache and image tags. |
REGISTRY_USERNAME |
squid |
Registry account for the login step. |
IMAGE_REPO_FRONTEND |
squid/blog-frontend |
Frontend image name under REGISTRY. |
IMAGE_REPO_BACKEND |
squid/blog-backend |
Backend image name under REGISTRY. |
Secrets
| Name | Required | Used for |
|---|---|---|
REGISTRY_PASSWORD |
Yes | Password or token for REGISTRY_USERNAME. |
SENTRY_AUTH_TOKEN |
No | Uploads frontend source maps to Sentry; the frontend still builds without it. |
Attaching the manifest to the release uses the GITEA_TOKEN that Gitea provides
to every job, so no separate token secret is required.
License
The source code is licensed under the Apache License 2.0. You are free to use, modify, and redistribute the code, including for your own blog.
The project's name and branding ("SquidSpirit" / "魚之魷魂", the logo, and personal content) are not covered by the code license. See TRADEMARK.md for the trademark policy — in short, if you deploy a modified copy, replace the branding with your own.