项目作者: aTechGuide

项目描述 :
Blogging Application
高级语言: JavaScript
项目地址: git://github.com/aTechGuide/graphql-blog-app.git
创建时间: 2019-10-02T03:29:03Z
项目社区:https://github.com/aTechGuide/graphql-blog-app

开源协议:MIT License

下载


Graphql Blog App

This app provides following functionality

  • Allows clients to SignUp and SignIn
  • Allows authenticated clients to Fetch their profile
  • Allows authenticated clients to create, update and delete their post
  • Allows client to fetch all the published posts and authenticated users to fetch all of their posts
  • Allows clients to comment on a post
  • Pagination Support
  • Sorting Support

Hosting

Hosted via Prisma Cloud and Heroku

Links

  • Production Instance Link
  • Local Instance Link

Tech Stack

  • GraphQL (using graphql-yoga)
  • Prisma
  • Prisma Cloud
  • JWT

Getting Started

  • Launch Prisma and database

    • Create a .env file under prisma folder with following environment variables
      1. POSTGRES_HOST=<postgres-hostname>
      2. POSTGRES_DATABASE=<postgres-database>
      3. POSTGRES_USER=<postgres-user>
      4. POSTGRES_PASSWORD=<postgres-password>
    • cd prisma
    • Starting Container: docker-compose up -d
    • Stopping Services: docker-compose stop
    • Killing Container: docker-compose kill
    • Removing Stopped Containers: docker-compose rm
  • Deploy the prisma Datamodel. From inside prisma folder run

    • Dev: prisma deploy -e ../config/dev.env
    • Test: prisma deploy -e ../config/test.env
    • Prod: prisma deploy -e ../config/prod.env
  • Install the node dependencies

    • npm install
  • Generate the Schema Dependencies

    • Run npm run get-schema
  • Run the App

    • DEV: npm run dev
    • TEST: npm run test

Reference