2021-05-24 03:21:03 -04:00
2021-05-19 00:24:32 -04:00
2021-05-23 13:43:50 -04:00
2021-05-24 03:19:33 -04:00
2021-05-22 07:59:45 -04:00
2021-05-24 03:12:48 -04:00
2021-05-24 03:07:08 -04:00
2021-05-24 03:07:08 -04:00
2021-05-17 20:33:08 -04:00
2021-05-22 08:18:17 -04:00
2021-05-22 03:49:18 -04:00

storyteller-web

This is our main user account monolith that we'll also bake other pieces into.

Local development

Database migrations

To reset the entire database (drop, migrate), run:

diesel database reset

To migrate at the current step and beyond:

diesel migration run

To undo migrations at the current step:

diesel migration redo

To save sqlx database state to cache file (necessary for builds):

SQLX_OFFLINE=true cargo sqlx prepare

Now that we have multiple binaries, it's required to include all the queries in the main binary so we can generate the cached queries as a single target. That's then executed with:

SQLX_OFFLINE=true cargo sqlx prepare -- --bin storyteller-web

Production

Database migrations

  1. Set DATABASE_URL in .env
  2. Run diesel migration run

Actix notes

json request

async fn handler(request: web::Json<Mytype>) -> impl Responder { "whatever" }

form-multipart request

async fn handler(request: web::Form<Mytype>) -> impl Responder { "whatever" }

route parameters

#[get("/{name}")]
async fn hello(name: web::Path<String>) -> impl Responder { format!("Hi {}", name) }

TODO

  • Make all "token" types correct
  • Use correct collation for all tables
  • Install indexes on all foreign keys
  • Make sure unique indexes are correct

Notes / TODOs:

Docker builds

The repository needs to be given read access to the base docker image:

https://github.com/orgs/storytold/packages/container/docker-base-images-rust-ssl/settings

Local Nginx Proxy

Set up a local nginx to proxy to the frontend and backend so cookie issues aren't annoying

Edit, /etc/nginx/sites-enabled/storyteller

server {
    listen 80; 
    server_name api.jungle.horse;
    location / { 
        proxy_set_header Host $host;
        proxy_pass http://127.0.0.1:12345;
        proxy_redirect off;
    }   
}
server {
    listen 80; 
    server_name jungle.horse;
    location / { 
        proxy_set_header Host $host;
        proxy_pass http://127.0.0.1:7000;
        proxy_redirect off;
    }   
}

S
Description
ArtCraft is an intentional crafting engine for artists, designers, and filmmakers
Readme 1.5 GiB
Languages
Rust 59.4%
TypeScript 39.3%
JavaScript 0.7%
Python 0.3%
CSS 0.2%
Other 0.1%