Git Product home page Git Product logo

graphy's Introduction

Graphy

A Rust GraphQL server starter project.

Quick start

Clone repo with project-name:

git clone [email protected]:WillSquire/Graphy.git \
  project-name \
  --depth=1 \
  --branch=master

Create /secrets directory in project root with these files and their values:

  • db_user.txt
  • db_password.txt
  • db_name.txt
  • hash_salt.txt
  • token_secret.txt

Run the stack on Docker:

docker-compose up

Manual

Config

Any sensitive data is passed at runtime either by value or file args.

By value:

cargo run -- \
  --db-user="..." \
  --db-password="..." \
  --db-name="..." \
  --db-server="..." \ # Optional
  --hash-salt="..." \
  --token-secret="..."

By file:

cargo run -- \
  --db-user-file="../secrets/db_user.txt" \
  --db-password-file="../secrets/db_password.txt" \
  --db-name-file="../secrets/db_name.txt" \
  --hash-salt-file="../secrets/hash_salt.txt" \
  --token-secret-file="../secrets/token_secret.txt"

Note these are passed at runtime to avoid retrieval through decompilers. It's recommend that these are passed by file if using Docker via secrets. The Dockerfile does this already.

Project specific arguments are located with that feature (i.e. not in Config).

For development

Start PostgreSQL (Dockerized):

docker-compose up db

Start API server (locally):

cargo run -- --db-name-file="../secrets/db_name.txt" --db-password-file="../secrets/db_password.txt" --db-user-file="../secrets/db_user.txt"

Initialise database (Diesel CLI):

docker run --rm -v "$(pwd)":/app --network="<project_name>_default" willsquire/diesel-cli --database-url="postgres://<db_user>:<db_password>@db/<db_name>" setup

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.