Giter VIP home page Giter VIP logo

rust-backend's Introduction

Rust Backend

This project is made for pure practice purposes, it represents a backend with database connectivity, migrations and a Rest API, with the possibility to virtualize it using Docker.

There is no application purpose for this repository, it is just to use the Rust macros in a real context and to identify and solve the difficulties.

With Actix as the web framework and Diesel as the ORM providing a DSL for the data model in SQL, we have a powerful stack with Deadpool taking care of connection pooling. Database access takes place synchronously. There is also diesel-async, but it is cumbersome to work with and moreover the sychnronicity of diesel is not a performance problem. At least not for most services, even Crates.io uses a full sync stack including diesel under the hood.

Together with Serde as a serialization library, the web server should easily manage several thousand requests/transactions per second in a "normal" usecase on "normal" hardware.

Start

You can build and start the application with db like this:

docker-compose up --build

NOTE Docker may not recognize the name of your architecture correctly, so there is an additional argument that can be specified, e.g. for Windows it is necessary to specify the following:

build:
  context: .
  args:
    - ARCH=x86_64

Metaprogramming (TODO)

the /meta folder is dedicated to metaprogramming.

The following should be checked for suitability

  • Proc macros
    • Attribute-like macros
    • Function-like macros
    • Custom #[derive] macros
  • Declarative macros

For intuitive usage the /meta Rust projects are structured as followed:

  • /meta bundle trait/macros
  • /meta/trait defining the traits which are implemented by macro
  • /meta/derive containing macro implementations

rust-backend's People

Watchers

Dan Häßler avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.