Files
squid 765688a302
Frontend CI / build (push) Successful in 1m18s
Backend CI / build (push) Successful in 8h2m21s
BLOG-308 Fix deployment failed (#309)
### 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>
2026-09-24 05:14:05 +08:00

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:

  1. Install pre-commit:

    pip install pre-commit
    
  2. 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:

  1. Install sqlx CLI: cargo install sqlx-cli
  2. Run database migrations: sqlx migrate run
  3. Prepare SQL schema: cargo sqlx prepare --workspace
  4. Run the server: RUST_LOG=debug cargo run

Frontend Setup

For detailed frontend development setup, see frontend/README.md.

Quick start:

  1. Navigate to frontend directory: cd frontend
  2. Install dependencies: bun install
  3. Start development server: bun run dev
  4. Build for production: bun run build

Full Project Setup

To set up the entire project:

  1. Clone the repository
  2. Set up pre-commit hooks (see above)
  3. Set up backend (see backend/README.md)
  4. Set up frontend (see frontend/README.md)
  5. Start both servers for full-stack development

MCP Server Setup

To configure and run the MCP (Model Context Protocol) servers for AI-assisted development:

  1. Install Go: Ensure Go is installed on your system to run Go-based MCP servers (such as the Gitea MCP server).

  2. Install Bun: Ensure Bun is installed on your system to run Svelte-based MCP servers (such as the Svelte MCP server via bunx).

  3. Install crates.io MCP: Install cratesio-mcp using Cargo:

    cargo install cratesio-mcp
    
  4. 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.