GithubHelp home page GithubHelp logo

aot-backend's Introduction

aot-backend

Setup

  1. Install Rust

  2. Install rustfmt and clippy:

    rustup component add rustfmt clippy
  3. Clone and change directory into this repo

  4. Install pre-commit hooks

    • Install Python and pip
    • Install pre-commit package:
    pip install pre-commit
    pre-commit install
  5. Run:

    cp .env.example .env

    and fill the env variables

With Docker

  1. Install Docker and Docker Compose

  2. Start the services:

    docker-compose up
  3. To generate migrations or run any command on the rust container, prefix it with docker-compose exec server like so:

    docker-compose exec server diesel migration generate <migration-name>

Bare metal

  1. Install PostgreSQL

  2. Install diesel_cli:

    cargo install diesel_cli --no-default-features --features postgres
  3. Install cargo-watch for hot reload (optional):

    cargo install cargo-watch
  4. To run migrations,

    diesel migration run
  5. Run:

    cargo watch -i logs -x run

    to start the server with hot reload, otherwise

    cargo run

Seed the dummy data using:

psql -U aot --set ON_ERROR_STOP=on < dummy_data.sql

For docker, prefix the above command with docker-compose exec -T db

Deployment

  1. Run:

    cp .env.example .env

    and fill the env variables

  2. Start the services:

    ./prod-run.sh up

    and build the images again with

    ./prod-run.sh up build
  3. Down the services:

    ./prod-run.sh down
  4. Logs for the services:

    ./prod-run.sh logs

You can attach to containers with:

docker attach <container-name>

aot-backend's People

Contributors

sarvesh-03 avatar sakthi-prasath avatar novice0192 avatar guruprasanna02 avatar pradeep-707 avatar anandavenkatesh-a avatar sanjayrk0206 avatar donwick32 avatar saloni-rakholiya avatar itskhadeer 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.