TownHall is collaborative project for novice-to-intermediate Rust developers. We’re learning-by-doing together, in the making of a community platform modeled after the likes of Reddit space oriented and X (formerly Twitter) microblogging platform.
The project leader and default mentor for new contributors is @EstebanBorai. New mentors and mentees alike are always welcome!
# install just command runner
cargo install just
# clone this repository
git clone https://github.com/whizzes/townhall.git
# step into repository directory
cd ./townhall
# open a termital window and spin up Docker Containers
just dev
# create a new terminal window and run database migrations
just prepare
# execute the server (next time you just run this command)
cargo run serve
Note: As of today migrations runs when bootstrapping the server automatically
To read the documentation of the web here
Client traffic is handled by a GraphQL endpoint, domain logic is exposed through services which encapsulate access to the database logic. The CLI solution communicates directly to the services.
This project takes some inspiration on Domain Driven Design, but does not implements its concepts completely. Concepts like value object, model, repositories and services are present but are not 100% accurate to the original Domain Driven Design architecture.
The client and server solution is available in this repository.
Directory | Description |
---|---|
crates/cli |
CLI used to manage the Server instance. run database migrations and other developer tasks |
crates/client |
HTTP Client used as bridge library between client interface and application services |
crates/core |
Domain Logic, includes Models, Value Objects, Repositories and Services |
crates/entity |
Entities generated from database |
crates/migration |
Database migrations |
crates/server |
HTTP Server Logic, uses Axum and GraphQL |
crates/test |
E2E Tests for the GraphQL Server |
crates/types |
Plain types shared between different application layers |
crates/web |
Web UI, written in Leptos |
E2E Tests run by default on a different database, this allow us to have a database for development and another for testing, speeding up the development process.
The dedicated E2E Database will be builded along with other containers when running just dev
.
You can also execute a single E2E Test by specifying the name of the test
function along with the just e2e_tests
command:
just e2e_tests my_super_test_function_name
To run every test just execute:
just e2e_test
Teardown containers using just undev
.
Esteban Borai 💻 |
Michael Liendo 💻 |
David Arenas 💻 |
Cudi Lala 💻 |
Paly Zambrano 💻 |
Phosphorus-M 💻 |
David Rodríguez 💻 |
Licensed under the MIT License