Giter Site home page Giter Site logo

maschzh / actix-blog-app Goto Github PK

View Code? Open in Web Editor NEW

This project forked from nemesiscodex/actix-blog-app

0.0 0.0 0.0 81 KB

Blog app backend made in actix and graphql (WIP)

Home Page: https://actix-blog-app.herokuapp.com/graphiql

Rust 95.47% TSQL 4.53%

actix-blog-app's Introduction

actix-blog-app tests

Blog made in actix

Requirements

  • Rust
  • Docker
  • docker-compose

Usage

# Copy example .env file
cp .env.example .env

# Run postgres
docker-compose up -d postgres

# Install diesel
cargo install diesel_cli --no-default-features --features postgres

# Run db migrations
DATABASE_URL=postgres://actix:actix@localhost:5432/actix diesel migration run

# Install LLVM/Clang compiler
# https://github.com/bcmyers/argonautica/tree/master/argonautica-rs#installation

# Run unit tests
cargo test

# Run the server (Add --release for an optimized build)
cargo run 

Test query:

{
  users {
    id
    username
    email
    bio 
    image 
    createdAt
    updatedAt
  }
}

Or with curl

curl -X POST -H "Content-Type: application/json" -d '{ "query": "{users {id username email bio image createdAt updatedAt}}" }' https://actix-blog-app.herokuapp.com/graphql -s | jq .

Will get you:

{
  "data": {
    "users": [
      {
        "id": "11c21a2b-e131-4b76-b32a-1872790defdb",
        "username": "user1",
        "email": "[email protected]",
        "bio": null,
        "image": null,
        "createdAt": 1584256602,
        "updatedAt": 1584256602
      }
    ]
  }
}

actix-blog-app's People

Contributors

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