https://github.com/feniljain/zeus
Zeus: Yet another meeting scheduler!
https://github.com/feniljain/zeus
backend clean-architecture golang testing
Last synced: 5 months ago
JSON representation
Zeus: Yet another meeting scheduler!
- Host: GitHub
- URL: https://github.com/feniljain/zeus
- Owner: feniljain
- License: mit
- Created: 2020-10-18T04:22:25.000Z (over 5 years ago)
- Default Branch: main
- Last Pushed: 2021-10-08T15:56:55.000Z (over 4 years ago)
- Last Synced: 2024-06-21T17:50:10.766Z (about 2 years ago)
- Topics: backend, clean-architecture, golang, testing
- Language: Go
- Homepage:
- Size: 39.1 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
Zeus
Yet another meeting scheduler!
## Features
- [X] Make new meetings with participants
- [X] Get meeting details from ID
- [X] Get all meetings of a particular participant
- [X] Get all meetings within a stipulated timeframe
- [X] Clean Architecture
- [X] Not including meetings which clash for a participant
- [X] Race condition free(Test from golang's default tool)
- [X] Unit tests
- [X] Pagination(with the get all meetings of a participant)
## Instructions to run
* Pre-requisites:
- Go
- MongoDB
* Installation:
```bash
git clone https://github.com/feniljain/zeus.git
cd zeus
go get
```
* Execution
```bash
go run api/main.go
```
## Instructions to test
* Testing
```bash
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:
```bash
{
"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
Made with :heart: by Fenil Jain