Skip to content

colinbankier/realworld-gotham

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

22 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

RealWorld Example App

Rust/Gotham codebase containing real world examples (CRUD, auth, advanced patterns, etc) that adheres to the RealWorld spec and API.

WIP - this repo is as yet incomplete and still being implemented

This codebase was created to demonstrate a fully fledged fullstack application built with Rust/Gotham including CRUD operations, authentication, routing, pagination, and more.

This project attempts to acheive the following:

  • Separate domain logic from web logic. The conduit module contains domain logic and the web module has logic for dealing with http stuff and json request/response formats.
  • Async queries with diesel. Diesel doesn't directly support async, but we can still build an async application around it using tokio_threadpool::blocking. The db module provides a Repo abstraction to encapsulate this.
  • Parallel database tests. Tests use isolated test transactions so database tests can be run in parallel.

For more information on how to this works with other frontends/backends, head over to the RealWorld repo.

Getting started

Ensure postgres is installed and running. Ensure user 'realworld-gotham' exists and can create databases.

sudo -u postgres psql -c "CREATE USER \"realworld-gotham\" WITH ENCRYPTED PASSWORD 'password';"
sudo -u postgres psql -c "ALTER USER \"realworld-gotham\" CREATEDB;"

Ensure diesel cli is installed, see [http://diesel.rs/guides/getting-started/]

Run tests

Run tests, including DB integration tests

cargo make test

Run the app

Setup database using diesel cli

diesel database setup

Run the app (with logging output)

RUST_LOG=realworld_gotham=debug cargo run

About

Realworld.io example app using gotham

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published