Giter VIP home page Giter VIP logo

northwind-rs's Introduction

northwind-rs

The Northwind application powered by Rust (actix-web, sqlx, jwt...)

Generated from actix-sqlx-boilerplate

Give a star ⭐

If you're using this repository for your samples, workshop, your project or whatever, please give a star ⭐. Thank you very much 👍

Up and running

Run server

$ docker-compose up
$ cargo run --bin northwind-actix

Then play around with restclient.http

SQLx

sqlx repository: Github

sqlx-cli

sqlx-cli repository: Github

$ cargo install sqlx-cli --no-default-features --features postgres

Offline mode

On windows 10

Make sure that you have docker-compose up running with at least postgresdb

$ cargo clean
$ cmd /c "set SQLX_OFFLINE=true && cargo sqlx prepare -- --manifest-path apps/actix/Cargo.toml --bin northwind-actix"

Make sure, we have sqlx-data.json updated. Then, we can build the buildpack below

The issue couldn't run cargo sqlx cli successfully at launchbadge/sqlx#788

Migrations

To create a migration:

$ sqlx migrate add -r <name>

Run migrations:

$ sqlx migrate run

Revet migrations:

$ sqlx migrate revert

Cargo watch

Usage:

$ cargo watch -x 'run --bin api'

Benchmark

Use Drill

$ drill --benchmark drill.yml --stats --quiet

Documentation

Run:

$ cargo doc --open --no-deps

Run with private items:

$ cargo doc --open --no-deps --document-private-items

Build Docker image with CNCF Buildpacks

$ pack build vietnamdevsgroup/northwind-rs -e SQLX_OFFLINE=true -e BP_CARGO_INSTALL_ARGS="--path=./apps/actix" 
-b docker.io/paketocommunity/rust

Un-comment section northwindrs in docker-compose.yaml file, then run:

$ docker-compose up

Troubleshooting

Inspect docker image

$ docker run -it --entrypoint /bin/bash vietnamdevsgroup/northwind-rs

Dive to see what inside docker image

$ docker pull wagoodman/dive:latest
$ docker run --rm -it -v /var/run/docker.sock:/var/run/docker.sock wagoodman/dive:latest vietnamdevsgroup/northwind-rs

northwind-rs's People

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  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.