Main service structure - lanit-tercom-school/studit GitHub Wiki

Introduction

Main-service is the facade for few microservices in StudIT project. It was developed for flexibility of interaction backend with clients. We are using Golang GraphQL library as an implementation of GraphQL technology. Fronted must communicate only with main-service!

Sructure

  • conf
    • conf.json - Config file in JSON format. Contains URLs of other microservices, HTTP port, JWT secret for token parsing.
    • configuration.go - Golang file for parsing config.json
  • docker-conf - Contains the same configuration files as in conf folder, but these configs are used on the production server.
  • handler
    • handler.go - Custom HTTP Handler for parsing graphql request and variables.
  • helpers
    • helpers.go - Some utils for logging and making requests to other microservices.
  • mutations - Contains GraphQL Mutations
  • objects - Contains models and GraphQL Object types
  • queries - Contains GraphQL Queries
  • root
    • mutations.go - Definitions of all GraphQL mutations (Like routers in Beego)
    • queries.go - Definitions of all GraphQL queries (Like routers in Beego)
  • main.go - Standard entry point of the golang app. Launches custom HTTP Handler (handler.go).