All Projects → jonathanhecl → golang-graphql-mongodb

jonathanhecl / golang-graphql-mongodb

Licence: MIT License
Golang+GraphQL+MongoDB

Programming Languages

go
31211 projects - #10 most used programming language
HTML
75241 projects
javascript
184084 projects - #8 most used programming language

Projects that are alternatives of or similar to golang-graphql-mongodb

graphql-server-typescript
GraphQL + MongoDB express server with JWT authorization (in Typescript!)
Stars: ✭ 48 (+54.84%)
Mutual labels:  graphql-server, bcrypt
graphql-example
Intuitive GraphQL Resolver Example - Application example using RawModel.js as GraphQL rootValue on steroids.
Stars: ✭ 25 (-19.35%)
Mutual labels:  graphql-server
TradingMachine
TradingMachine is a mini-trading system simulation, whose components (market data and order feeds, FIX acceptor and initiator, back-end for filled orders) interact by queues and topics.
Stars: ✭ 26 (-16.13%)
Mutual labels:  server-side
cms
🛠️ Simple smart CMS for Nette and Vue.js
Stars: ✭ 12 (-61.29%)
Mutual labels:  cms-backend
Perl6-GraphQL
Perl 6 implementation of GraphQL
Stars: ✭ 19 (-38.71%)
Mutual labels:  graphql-server
nfw
A jsonapi boilerplate for @nfw-core with mikro-orm
Stars: ✭ 23 (-25.81%)
Mutual labels:  bcrypt
fullstack-graphql-angular
Simple Fullstack GraphQL Application with Angular CLI + Redux. API built with Typescript + Express + GraphQL + Sequelize (supports MySQL, Postgres, Sqlite and MSSQL). WebApp built with Angular CLI + Redux + Async Middleware to access the API.
Stars: ✭ 67 (+116.13%)
Mutual labels:  graphql-server
showroom
Universal development and automated test environment for web components
Stars: ✭ 89 (+187.1%)
Mutual labels:  server-side
CapoServer
GraphQL server for CapoMap application
Stars: ✭ 19 (-38.71%)
Mutual labels:  graphql-server
webapi
Go HTTP service component for automatic route registration and compilation constraint checking.
Stars: ✭ 24 (-22.58%)
Mutual labels:  server-side
now-course
Proyecto para el curso de Now.sh en Platzi
Stars: ✭ 19 (-38.71%)
Mutual labels:  graphql-server
graphql-pynamodb
Graphene PynamoDB Integration
Stars: ✭ 63 (+103.23%)
Mutual labels:  graphql-server
nestjs-prisma-starter
Starter template for NestJS 😻 includes GraphQL with Prisma Client, Passport-JWT authentication, Swagger Api and Docker
Stars: ✭ 1,107 (+3470.97%)
Mutual labels:  bcrypt
FlashPaper
One-time encrypted password/secret sharing
Stars: ✭ 85 (+174.19%)
Mutual labels:  bcrypt
HotelManagementSystem
Hotel Management System created with Restify and Angular 9
Stars: ✭ 23 (-25.81%)
Mutual labels:  server-side
server-next
😎 The next generation of RESTful API service and more for Mix Space, powered by @nestjs.
Stars: ✭ 43 (+38.71%)
Mutual labels:  cms-backend
Gitzilla
A resume builder for your GitHub profile.
Stars: ✭ 60 (+93.55%)
Mutual labels:  graphql-server
web-haskell-graphql-postgres-boilerplate
Modern webserver in Haskell: Graphql + Postgresql + Authentication + DB migration + Dotenv and more
Stars: ✭ 114 (+267.74%)
Mutual labels:  graphql-server
graphql-dotnet-relay
Relay support for graphql-dotnet
Stars: ✭ 13 (-58.06%)
Mutual labels:  graphql-server
neo4j-graphql-py
A GraphQL to Cypher query execution layer for Neo4j and Python GraphQL implementations.
Stars: ✭ 14 (-54.84%)
Mutual labels:  graphql-server

Golang+GraphQL+MongoDB Server 1.0.0

Uses the following packages:

  • go.mongodb.org/mongo-driver/mongo - MongoDB Driver API
  • github.com/graphql-go/graphql - GraphQL
  • github.com/dgrijalva/jwt-go - JSON Web Tokens (JWT)
  • golang.org/x/crypto/bcrypt - Package bcrypt

Features!

  • Authorization Header
  • SignUp/SignIn users
  • Users Profiles
  • List recipes
  • Recipe pages
  • Add/Edit/Delete recipes
  • Like/Unlike recipes

Config.go file

var config = configModel{
	mongoUri:    "mongodb://admin:admin@localhost:37812/react-recipes", 		   // Mongo Uri 
	mongoDb:     "react-recipes",                                                  // DB name
	tokenSecret: "secret",                                                         // Secret to use in Tokens
	tokenExp:    "1h",                                                             // Expiration of Token
	serveUri:    ":4444",                                                          // Serve
}

Models

Recipe

key type
_id ID
name string
imageUrl string
category string
description string
instructions string
createdDate unixtime
likes int
username string

User

key type
_id ID
username string
password string
email string
joinDate unixtime
favorites array[Recipe]

GraphQL

getAllRecipes

{
  getAllRecipes {
    ...MinimalRecipe
  }
}

fragment MinimalRecipe on Recipe {
  _id
  name
  imageUrl
  category
}

searchRecipes

query ($searchTerm: String) {
  searchRecipes(searchTerm: $searchTerm) {
    _id
    name
    likes
  }
}

getRecipe

query ($_id: ID!) {
  getRecipe(_id: $_id) {
    ...CompleteRecipe
  }
}

fragment CompleteRecipe on Recipe {
  _id
  name
  imageUrl
  category
  description
  instructions
  createdDate
  likes
  username
}

signupUser

mutation ($username: String!, $email: String!, $password: String!) {
  signupUser(username: $username, email: $email, password: $password) {
    token
  }
}

signinUser

mutation ($username: String!, $password: String!) {
  signinUser(username: $username, password: $password) {
    token
  }
}

getCurrentUser (require authorization header)

{
  getCurrentUser {
    username
    joinDate
    email
    favorites {
      _id
      name
    }
  }
}

addRecipe (require authorization header)

username not used, obtained by Token Authorization.

mutation ($name: String!, $imageUrl: String!, $category: String!, $description: String!, $instructions: String!, $username: String) {
  addRecipe(name: $name, imageUrl: $imageUrl, category: $category, description: $description, instructions: $instructions, username: $username) {
    ...MinimalRecipe
  }
}

fragment MinimalRecipe on Recipe {
  _id
  name
  imageUrl
  category
}

updateUserRecipe (require authorization header)

mutation ($_id: ID!, $name: String!, $imageUrl: String!, $category: String!, $description: String!, $instructions: String!) {
  updateUserRecipe(_id: $_id, name: $name, imageUrl: $imageUrl, category: $category, description: $description, instructions: $instructions) {
    ...CompleteRecipe
  }
}

fragment CompleteRecipe on Recipe {
  _id
  name
  imageUrl
  category
  description
  instructions
  createdDate
  likes
  username
}

getUserRecipe (require authorization header)

query ($username: String!) {
  getUserRecipes(username: $username) {
    ...CompleteRecipe
  }
}

fragment CompleteRecipe on Recipe {
  _id
  name
  imageUrl
  category
  description
  instructions
  createdDate
  likes
  username
}

likeRecipe (require authorization header)

username not used, obtained by Token Authorization.

mutation ($_id: ID!, $username: String!) {
  likeRecipe(_id: $_id, username: $username) {
    ...LikeRecipe
  }
}

fragment LikeRecipe on Recipe {
  _id
  likes
}

unlikeRecipe (require authorization header)

username not used, obtained by Token Authorization.

mutation ($_id: ID!, $username: String!) {
  unlikeRecipe(_id: $_id, username: $username) {
    ...LikeRecipe
  }
}

fragment LikeRecipe on Recipe {
  _id
  likes
}

deleteUserRecipe (require authorization header)

mutation ($_id: ID!) {
  deleteUserRecipe(_id: $_id) {
    _id
  }
}

License

MIT

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].