1
0
Fork
You've already forked silverfish
0
forked from conjured/silverfish
rust-based droplet implementation
  • Rust 70.4%
  • CSS 14.5%
  • TypeScript 8.5%
  • HTML 3%
  • JavaScript 2.7%
  • Other 0.9%
2025年08月05日 23:34:28 -07:00
.cargo initial commit 2025年08月01日 00:08:19 -07:00
config add support for http sessions ( #37 ) 2025年08月06日 08:29:10 +02:00
crates/silverfish-config quick opts fix 2025年08月05日 23:34:28 -07:00
migrations Set up models stuff and compile-time query validation ( #36 ) 2025年08月06日 05:48:58 +02:00
src add support for http sessions ( #37 ) 2025年08月06日 08:29:10 +02:00
src-frontend set up templating and frontend stuff 2025年08月04日 00:10:04 -07:00
static set up templating and frontend stuff 2025年08月04日 00:10:04 -07:00
.env Set up models stuff and compile-time query validation ( #36 ) 2025年08月06日 05:48:58 +02:00
.gitignore Set up models stuff and compile-time query validation ( #36 ) 2025年08月06日 05:48:58 +02:00
.rustfmt.toml initial commit 2025年08月01日 00:08:19 -07:00
askama.toml set up templating and frontend stuff 2025年08月04日 00:10:04 -07:00
build.rs Set up models stuff and compile-time query validation ( #36 ) 2025年08月06日 05:48:58 +02:00
Cargo.lock add support for http sessions ( #37 ) 2025年08月06日 08:29:10 +02:00
Cargo.toml add support for http sessions ( #37 ) 2025年08月06日 08:29:10 +02:00
Justfile Adding powershell, fixed weird cargo serve issues 2025年08月05日 12:02:59 -07:00
README.md set up templating and frontend stuff 2025年08月04日 00:10:04 -07:00
rust-toolchain.toml environment-specific configuration process and @include directive 2025年08月03日 03:08:25 -07:00

silverfish

new kid on the block

Requirements

  • Rust 1.88.0 or later w/ Cargo (use rustup)
  • Node.js 20 or later
  • (optional) watchexec
  • (optional) just

Getting Started

  1. (optional) Copy config/dev.secret.example.kdl to config/dev.secret.kdl and edit as desired.
  2. just db-setup to create the database and migrate it.
  3. just dev to start the server/watcher with all frontend stuff installed and built.
  4. Visit https://localhost:4000 or wherever you configured your dev server to listen.

See Justfile for other tasks to run.

Architecture

  • config - configuration files. Per-environment. You can change environments with the --config-env option. Configurations are layered between config file -> environment variables (prefixed with SF_CONFIG_) -> CLI options. Config files use KDL. Some editors still only support v1, but we use v2.
  • crates/silverfish-config - crate for handling configuration layering stuff.
  • migrations - database migrations. These are statically compiled into the binary.
  • src - Rust source (including backend-rendered views)
    • commands - CLI commands
    • web - Classic MVC style.
      • controllers - Route handlers.
      • templates - HTML templates for the site.
        • components - reusable/includable components.
        • layouts - toplevel layouts used by other templates.
      • views - Rust side of templates, using askama. Statically compiled and verified.
      • router - All routes are defined here for the entire site, nested as needed.
      • state - App state.
    • workers - Unused for now. Will be where apalis workers live.
    • db.rs - Database pool stuff.
    • error.rs - Big honking error enum. Eventually, all errors we ? should go in here and we should stop using miette::Report outside of main.rs.
    • lib.rs - Config flags and init logic are all set up here, including config loading, overall logging, and cli/subcommand setup.
    • main.rs - Tiny busybody.
  • src-frontend - JS/CSS stuff goes here. Uses TypeScript + esbuild and is all set up. TypeScript/JavaScript should be kept to an absolute minimum.
  • static - Static frontend files. src-frontend files get compiled into a .gitignored static/assets dir.
  • Justfile - Task runner.