adi-kmt / bitespeed_backend

Bitespeed backend task

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Bitespeed Backend Task

Implemented using go-fiber, postgres and sqlc.

Application Structure

  • The first db/ contains all the SQL queries with /migration/ including the db migration and /queries/ having all the required SQL queries used in this application.

  • cmd/ contains the entry point of the application

  • pkg/ contains the application code which is further divided into /controllers/, /services/ and /repositories/ as per the MVC pattern.

    • Some other packages are used for utilities like finding the unique elements in a slice, implementing a simplistic DI mechanism, etc

First run

docker compose up

Make sure that golang-migrate is installed.

Then run

make db-migrate

Endpoints

/identify

POST Request with body

{
    "email": "email@sample.com",
    "phoneNumber": "8070695"
}

with response

{
    "contact": {
        "primaryContactId": 1,
        "emails": [
            "sample@email.com",
            "email@sample.com "
        ],
        "phoneNumbers": [
            "8070695",
            "8070690"
        ],
        "secondaryContactNumbers": [
            2
        ]
    }
}

About

Bitespeed backend task


Languages

Language:Go 94.5%Language:Dockerfile 4.1%Language:Makefile 1.4%