Skip to content

SilkRose/Census-Consensus

Repository files navigation

Census Consensus

Census Consensus is Silk Rose's 2026 April Fools event. The site is live here, and the story can be read here.

Dependencies setup

You need:

  • a rust compiler toolchain installed via rustup
    • Installation: https://rustup.rs
    • Once installed, running any rust command in this directory will cause rustc to automatically install (if needed) and run the right version of the tool (it will tell you when it is installing something).
  • a postgres instance set up and available
  • sqlx-cli
    • Installation: cargo install --locked sqlx-cli
    • You only need the postgres and a TLS library feature to use sqlx for this project, so you may optionally add --no-default-features --features postgres,rustls to the install command
    • If you wish to limit the amount of binaries installed, you may choose to only install either the cargo-sqlx or sqlx commands with --bin cargo-sqlx or --bin sqlx, respectively. You'd then invoke the CLI with cargo sqlx or sqlx

Project setup

Before compiling the project for the first time, you will need to use the sqlx cli to run migrations on the database, so that sqlx can typecheck and infer types during the compilation process. The command is cargo sqlx migrate run. See below for information on setting the required DATABASE_URL environment variable for connecting to the database.

For environment variables, you may use a .env file in the root of the project directory to configure them.

Environment variables

  • DATABASE_URL: postgres connection URL, in the format of postgres://<username>:<password>@<hostname>:<port>/<databasename>
    • ex. postgres://postgres:root@localhost:5432/aprilfools, with username "postgres", password "root", hostname "localhost", port "5432", database name "aprilfools"
  • ADMIN_ID: The Fimfiction user ID of the person running the event. They will be fetched from the API and automatically made an admin on startup.
  • BEARER_TOKEN: Fimfiction API token to control and update the story.
  • FIMFIC_CLIENT_ID: The client ID of the Fimfiction App used for registering users for the site.
  • FIMFIC_CLIENT_SECRET: The client secret for authentication during user token generation.
  • FIMFIC_OAUTH_REDIRECT_URL: The URL to redirect users to after Fimfiction app authorization. This must be present in the App's settings on Fimfiction.
  • CREATE_DEV_SESSION: (Optional) Creates a development session with a link that when opened sets them to a new session for the admin set above.

About

Census Consensus is Silk Rose's 2026 April Fools event.

Topics

Resources

License

Stars

Watchers

Forks

Contributors