zeus

module
v0.0.0-...-3cb4649 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 8, 2021 License: MIT

README

Zeus

Yet another meeting scheduler!

Features

  • Make new meetings with participants
  • Get meeting details from ID
  • Get all meetings of a particular participant
  • Get all meetings within a stipulated timeframe
  • Clean Architecture
  • Not including meetings which clash for a participant
  • Race condition free(Test from golang's default tool)
  • Unit tests
  • Pagination(with the get all meetings of a participant)

Instructions to run

  • Pre-requisites:

    • Go
    • MongoDB
  • Installation:

git clone https://github.com/feniljain/zeus.git
cd zeus
go get
  • Execution
go run api/main.go

Instructions to test

  • Testing
go test api/endpoints_test.go

Architecture

  • Insipration from: https://medium.com/gdg-vit/clean-architecture-the-right-way-d83b81ecac6

  • This project is built in Clean Architecture, it contains of two main modules(not packages), i.e. api and pkg.

  • Service acts as usecase layer

  • Repo as Repository layer

  • Impl as implementation layer

  • api contains all the necessary route handlings and backend supporting services(i.e. receiving requests and forwarding to proper handlers), it also initializes everything and does the important step of dependecy injection, it contains packages:

    • main: cotnains main.go and testing file.
    • views: contains response wrapper
    • handlers: contains all the necessaey handlers and linking with services, which in turn response using views.
  • pkg contains the business logic divided into couple of packages

    • pkg: contains centralized errors.go file defining all the necessary errors which will thrown from backend and pkg
    • meeting: contains all the neccessary files for meeting business logic
    • participant: contains all the neccessary files for participant business logic
    • entities: necessary middle man structs for holding participants and meetings data from db and so forth

Routes

  • Make new meetings with participants

     Route:  /meetings
     Method: POST
     Example Body:
    
{
   "title": "sefdkf",
   "starttime": "2009-01-02 15:04:05",
   "endtime": "2009-01-02 15:34:05",
   "participants": [
	{
		"name": "someone",
		"email": "someone@gmail.com",
		"rsvp": "Yes"
	},
	{
		"name": "someone1",
		"email": "someone1@gmail.com",
		"rsvp": "No"
	}
   ]
}
  • Get meeting details from ID

      Route:  /meetings/:id
      Method: GET
    
  • Get all meetings of a particular participant

      Route:
       - /meetings?participant=sw
       - /meetings?participant=sw&page=1
      Method: GET
    
  • Get all meetings within a stipulated timeframe

      Route:  /meetings?start=2005-01-02 15:04:05&end=2007-01-02 15:34:05
      Method: GET
    

Contributors

Fenil Jain

Your Name Here (Insert Your Image Link In Src

GitHub LinkedIn

Made with :heart: by Fenil Jain

Directories

Path Synopsis
api
pkg

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL