All Projects → jamesjmeyer210 → actix_sqlx_mysql_user_crud

jamesjmeyer210 / actix_sqlx_mysql_user_crud

Licence: Unlicense license
A user crud written in Rust, designed to connect to a MySQL database with full integration test coverage.

Programming Languages

rust
11053 projects

Projects that are alternatives of or similar to actix sqlx mysql user crud

Quixote
CSS unit and integration testing
Stars: ✭ 788 (+910.26%)
Mutual labels:  integration-testing, test-driven-development
tide-basic-crud
Basic CRUD api using Rust / Tide / Sqlx / Postgresql
Stars: ✭ 27 (-65.38%)
Mutual labels:  crud, sqlx
Dntframeworkcore
Lightweight and Extensible Infrastructure for Building Web Applications - Web Application Framework
Stars: ✭ 208 (+166.67%)
Mutual labels:  crud, integration-testing
node-restafary
REST for CRUD file operations
Stars: ✭ 13 (-83.33%)
Mutual labels:  crud
osgi-testsuite
The OSGi Test Suite runs all JUnit tests in a given list of bundles
Stars: ✭ 15 (-80.77%)
Mutual labels:  integration-testing
Go-Clean-Architecture-REST-API
Golang Clean Architecture REST API example
Stars: ✭ 376 (+382.05%)
Mutual labels:  sqlx
louislam-crud
An easy-to-use CRUD library for you to create a back-end system or RESTful API in a few minutes.
Stars: ✭ 18 (-76.92%)
Mutual labels:  crud
ionic3-firebase-ngrx
Sample Ionic 3 application using ngrx with firebase (auth, crud and camera plugin)
Stars: ✭ 48 (-38.46%)
Mutual labels:  crud
showcase
A Full Stack Journey with Micro Services and Micro Front Ends. Using dapr, kubernetes, react module federation and web assembly,
Stars: ✭ 45 (-42.31%)
Mutual labels:  integration-testing
eat
Json based scenario testing tool(which can have test for functional and non-functional)
Stars: ✭ 41 (-47.44%)
Mutual labels:  test-driven-development
titan-starter-website
A Laravel Website and Admin starter project that helps you with the setup.
Stars: ✭ 51 (-34.62%)
Mutual labels:  crud
Actix-Blog
A personal blog powered by rust-lang and actix-web
Stars: ✭ 42 (-46.15%)
Mutual labels:  actix-web
.NET-Core-Learning-Journey
Some of the projects i made when starting to learn .NET Core
Stars: ✭ 37 (-52.56%)
Mutual labels:  crud
damas-core
JSON storage service. RESTful, CRUD, multi-user.
Stars: ✭ 50 (-35.9%)
Mutual labels:  crud
seaworthy
Test harness for Docker container images 🌊 🚢
Stars: ✭ 29 (-62.82%)
Mutual labels:  integration-testing
dagpi
Dagpi is a powerful and fast api that does image manipulation as well as serves datasets. It is fast and written in rust and python. Perfect for discord bots, social media apps, camera apps and more.
Stars: ✭ 25 (-67.95%)
Mutual labels:  actix-web
DjangoReactTodo
Build a simple CRUD Todo app with Django, React and Semantic UI
Stars: ✭ 23 (-70.51%)
Mutual labels:  crud
exactly
Exactly - tests a command line program by executing it in a temporary sandbox directory and inspecting its result.
Stars: ✭ 30 (-61.54%)
Mutual labels:  test-driven-development
avo
Ruby on Rails application building framework
Stars: ✭ 907 (+1062.82%)
Mutual labels:  crud
ui
Laravel Livewire & Bootstrap 5 UI & CRUD starter kit.
Stars: ✭ 82 (+5.13%)
Mutual labels:  crud

SQLX User CRUD

Purpose

This application demonstrates the how to implement a common design for CRUDs in, potentially, a system of microservices. The design pattern is akin to MVC (model, view, controller) minus the view. This type of application is commonly developed in languages like Java or C#, so the objective in its development has been to demonstrate a way to simply implement something familiar to C#'s DbContext that contains a DbSet<T> of each entity to be stored in the database.

Data Design

The database layout is simple, and illustrates a common relationship. The database there are 3 tables: (1) Users (2) Groups and (3) UsersToGroups. Groups and Users have a many-to-many relationship. This many-to-many relationship also exists in the Rust application where a User has a Vec<Group>.

Application Design

The application itself has been designed with a modular approach. It is common for Rust projects (specifically for the purpose of demonstration) to consolidate code into only a handful of files. Dividing this project into multiple modules, and many small files was intentional, as it makes the overall architecture clear.

The architecture is that of a trivial CRUD. There are two key layers: (1) the Controller and (2) the DAO (Data Access Object). The controller layer organizes the interaction between the DAO and the incoming/outgoing HTTP. Based on the various DAO responses, specific HTTP responses are provided.

Test Coverage

This application uses an integration testing style to provided test coverage for all methods. Note, not all method paths are fully tested. All expected paths of behavior are tested. In a more comprehensive system, there would be reason to test all permutations of behavior. These test serve as an example for what is sufficient test coverage for an initial application.

Setup

First, have MySQL installed and running.

Next, run the schema.sql script. On Linux, this can be done in the terminal:

sudo mysql -u root < schema.sql

When schema.sql has executed successfully, run the tests:

cargo test

After the tests have completed and all pass, startup the application:

cargo run

The following message should be printed to the terminal:

=== SQLX User CRUD ===
Using configuration file from config.json
Connected to database: mysql://sqlx_user_crud:rust_is_the_future@localhost/actix_user_crud
Listening on: 127.0.0.1:8000
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].