Skip to content

This repository is for the Appointy internship task, for pre-final year recruitment process 2021. The task was to develop a basic version of Instagram. We are only required to develop the API for the system. [Additional Constraints/Requirements] : The API should be developed using Go. MongoDB should be used for storage.

Notifications You must be signed in to change notification settings

techschneiderrr/posty

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Posty

Run Posty in Postman

posty cover

Modular service to add posts written in golang

Tasks

  • Create an User
  • Get a user using id
  • Create a Post
  • Get a post using id
  • List all posts of a user
  • Authentication without using JWT
  • Make the server thread safe
  • Add pagination to the list endpoint
  • Add unit tests
  • Clean Architecture

Instructions to run

Direct run

  • Pre-requisites:

    • Go
  • Installation:

git clone https://github.com/techschneiderrr/appointy-task.git
cd posty
go mod download
  • Execution

    • direct

      DB_URL=<encoded db url> go run api/main.go

      loading env because godotenv package could not be used

    • Execution using shell

      chmod +x runsample
      ./runsample
    • Run directly using docker!

      docker run -p 8080:8080 rush3003/posty:latest
  • Testing

    • direct

      DB_URL=<encoded db url> go test api/endpoint_test.go
    • Execution using shell

      chmod +x runsample
      ./runsample

Architecture

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

  • service acts as usecase layer

  • repository as repository layer

  • api contains all the necessary route handlings and backend supporting services(i.e. receiving requests and forwarding to proper handlers) it contains packages:

    • main: contains main.go.
    • presenter: contains structs for response conditions
    • 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
    • user: contains all the neccessary files for user business logic
    • post: contains all the neccessary files for post business logic
    • entities: necessary middle man structs for holding participants and meetings data from db and so forth
  • utils: contains all necessary files for helping functions

Other notable features

  • Authentication
    • Uses SHA256 hashing
    • Every post made has to be authenticated with the password of the user (similar to the case with pushing to github on an https remote)
  • packages

Documentation

Visit the postman docs here

About

This repository is for the Appointy internship task, for pre-final year recruitment process 2021. The task was to develop a basic version of Instagram. We are only required to develop the API for the system. [Additional Constraints/Requirements] : The API should be developed using Go. MongoDB should be used for storage.

Topics

Resources

Code of conduct

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published