Chat backend which serves REST APIs

chat_backend

Chat backend which serves REST APIs

Run server

1. make build //build the go modules

2. make run //run the go server

Once the server starts running, go to the postman, give the api endpoints in postman.

Postman

1. Create a new user api endpoint,

    localhost:8080/users -- use post method for this api

    //response

    {
        "ID": 7,
        "created_at": "2021-11-23T09:25:44.590575+05:30",
        "updated_at": "2021-11-23T09:25:44.590575+05:30",
        "name": "testuser7"
    }

2. Create a new chatroom,

    localhost:8080/chatrooms -- post

    //response

    {
        "ID": 4,
        "created_at": "2021-11-23T09:29:03.308708+05:30",
        "updated_at": "2021-11-23T09:29:03.308708+05:30",
        "room_name": "testchatroom4",
        "users": [
            {
                "ID": 1,
                "created_at": "2021-11-22T20:38:45.7013+05:30",
                "updated_at": "2021-11-22T20:38:45.7013+05:30",
                "name": "testuser1"
            },
            {
                "ID": 2,
                "created_at": "2021-11-22T20:38:59.696595+05:30",
                "updated_at": "2021-11-22T20:38:59.696595+05:30",
                "name": "testuser2"
            }
        ]

    }

3. List all the chatrooms,

    localhost:8080/chatrooms -- get method

    //response

            [
        {
            "ID": 1,
            "created_at": "2021-11-22T20:44:57.772457+05:30",
            "updated_at": "2021-11-22T20:44:57.772457+05:30",
            "room_name": "testchatroom1",
            "users": [
                {
                    "ID": 1,
                    "created_at": "2021-11-22T20:38:45.7013+05:30",
                    "updated_at": "2021-11-22T20:38:45.7013+05:30",
                    "name": "testuser1"
                },
                {
                    "ID": 2,
                    "created_at": "2021-11-22T20:38:59.696595+05:30",
                    "updated_at": "2021-11-22T20:38:59.696595+05:30",
                    "name": "testuser2"
                },
                {
                    "ID": 4,
                    "created_at": "2021-11-22T20:39:17.665711+05:30",
                    "updated_at": "2021-11-22T20:39:17.665711+05:30",
                    "name": "testuser4"
                }
            ]
        },
        {
            "ID": 4,
            "created_at": "2021-11-23T09:29:03.308708+05:30",
            "updated_at": "2021-11-23T09:29:03.308708+05:30",
            "room_name": "testchatroom4",
            "users": [
                {
                    "ID": 1,
                    "created_at": "2021-11-22T20:38:45.7013+05:30",
                    "updated_at": "2021-11-22T20:38:45.7013+05:30",
                    "name": "testuser1"
                },
                {
                    "ID": 2,
                    "created_at": "2021-11-22T20:38:59.696595+05:30",
                    "updated_at": "2021-11-22T20:38:59.696595+05:30",
                    "name": "testuser2"
                }
            ]
        }
    ]


4. Get a single record chatroom,

    localhost:8080/chatroom/1 -- get method

    // response

        {
            "ID": 1,
            "created_at": "2021-11-22T20:44:57.772457+05:30",
            "updated_at": "2021-11-22T20:44:57.772457+05:30",
            "room_name": "testchatroom1",
            "users": [
                {
                    "ID": 1,
                    "created_at": "2021-11-22T20:38:45.7013+05:30",
                    "updated_at": "2021-11-22T20:38:45.7013+05:30",
                    "name": "testuser1"
                },
                {
                    "ID": 2,
                    "created_at": "2021-11-22T20:38:59.696595+05:30",
                    "updated_at": "2021-11-22T20:38:59.696595+05:30",
                    "name": "testuser2"
                },
                {
                    "ID": 4,
                    "created_at": "2021-11-22T20:39:17.665711+05:30",
                    "updated_at": "2021-11-22T20:39:17.665711+05:30",
                    "name": "testuser4"
                }
            ]
        }

5. Update a chatroom record,

    localhost:8080/chatroom/4 -- put method

    //response

    {
        "ID": 4,
        "created_at": "2021-11-23T09:29:03.308708+05:30",
        "updated_at": "2021-11-23T09:35:13.765902+05:30",
        "room_name": "roamchatroom",
        "users": [
            {
                "ID": 1,
                "created_at": "2021-11-22T20:38:45.7013+05:30",
                "updated_at": "2021-11-22T20:38:45.7013+05:30",
                "name": "testuser1"
            },
            {
                "ID": 2,
                "created_at": "2021-11-22T20:38:59.696595+05:30",
                "updated_at": "2021-11-22T20:38:59.696595+05:30",
                "name": "testuser2"
            }
        ]
    }

Todo

Add validation
Owner
Vignesh kumar Dharmalingam
I am enthusiastic about learning new technologies and new concepts. I am a fast learner and easy to adopt new concepts and technologies.
Vignesh kumar Dharmalingam
Similar Resources

Gokkan is a dokkan (shop) backend written in Go

Gokkan is an online shop backend service written in Go. Setup Requirements # or docker-compose up make up Gokkan requires postgresql as databas

Sep 28, 2021

The source code for workshop Scalable architecture using Redis as backend database using Golang + Redis

The source code for workshop Scalable architecture using Redis as backend database using Golang + Redis

Sep 23, 2022

Build a TodoList with Go Design and implement a backend RESTful service in golang with CRUD

May we ask Igor to do a little project in leu of sample code? If there is a hire, the hours spent should be invoiced, so please keep track of that. Th

May 5, 2022

Buff Up Backend Challenge For Go

Buff Up Backend Challenge As part of the recruitment process we would like to complete the following backend challenge. We use this backend challenge

Nov 21, 2021

Blog backend system based on GO

个人博客后端文档 简介 相关功能 v0.1 用户登录、注册 文章发布、查看、评论、点赞 粉丝相关(关注) v0.2 排行榜(文章发布数量、粉丝) v0.3 流量统计 技术栈 语言选用go 大致技术栈选用: kratos + redis + jwt + gorm 项目地址 todo 项目结构

Nov 26, 2021

Blog backend based on go implementation

个人博客后端文档 简介 相关功能 v0.1 用户登录、注册 文章发布、查看、评论、点赞 粉丝相关(关注) v0.2 排行榜(文章发布数量、粉丝) v0.3 流量统计 技术栈 语言选用go 大致技术栈选用: kratos + redis + jwt + gorm 项目地址 todo 项目结构

Dec 4, 2021

An implementation of a backend blog microservice written in go.

Blog This is an implementation of the backend of a blog service written in Go 1.17 created with a microservice architecture in mind. Currently impleme

Dec 9, 2021

Go backend for the Vue-Go personal digital library application

Motivation Create a backend that connects to a cloud storage, so to store and retrieve my personal books. Barebone application State “DONE” from “NEXT

Dec 23, 2021

Backend developer with gin framework (Golang)

Backend developer with golang Install Packages : $ go get -u github.com/gin-gonic/gin $ Building from source Install a Go compiler. Install Goland ide

Nov 21, 2022
A Golang REST API to handle users and posts for a simple instagram backend. Uses MongoDB as the database. Tested using golang-testing and Postman.
A Golang REST API to handle users and posts for a simple instagram backend. Uses MongoDB as the database. Tested using golang-testing and Postman.

A Golang REST API to handle users and posts for a simple instagram backend. Uses MongoDB as the database. Tested using golang-testing and Postman.

Oct 10, 2021
Demo application to implement a REST api backend service for an android app using the Go aah framework.

aah-recycleview-backend This tutorial is based on the aah framework to implement a REST API form of CRUD application services, taking "IN-MEMORY" stor

Jan 28, 2022
Go (Golang) API REST with Gin FrameworkGo (Golang) API REST with Gin Framework

go-rest-api-aml-service Go (Golang) API REST with Gin Framework 1. Project Description Build REST APIs to support AML service with the support of exte

Nov 21, 2021
an online REST renting book platform which you can authenticate, order, reserve a book in your account.
an online REST renting book platform which you can authenticate, order, reserve a book in your account.

BOOK MAN an online REST renting book platform which you can authenticate, order, reserve a book in your account. it's a microservices project with hig

Jul 22, 2022
This is application for Book Keeping which implements fully-fledged REST API

This is application for Book Keeping which implements fully-fledged REST API #We are using Gorilla Mux

Dec 28, 2021
Create a Protocol Buffers (Protobuf) plugin, which is executed with the protoc compileCreate a Protocol Buffers (Protobuf) plugin, which is executed with the protoc compile

Interview Assignment Overview You assignment is to create a Protocol Buffers (Protobuf) plugin, which is executed with the protoc compiler. In this ex

Nov 19, 2021
A real-time serverless chat application with Go and Vue 3
A real-time serverless chat application with Go and Vue 3

sls-chat-app A real-time serverless chat application with Go and Vue 3. For the

Jul 17, 2022
A code generator that turns plain old Go services into RPC-enabled (micro)services with robust HTTP APIs.

Frodo Frodo is a code generator and runtime library that helps you write RPC-enabled (micro) services and APIs. It parses the interfaces/structs/comme

Dec 16, 2022
GraphJin - Build APIs in 5 minutes with GraphQL. An instant GraphQL to SQL compiler.
GraphJin - Build APIs in 5 minutes with GraphQL. An instant GraphQL to SQL compiler.

GraphJin gives you a high performance GraphQL API without you having to write any code. GraphQL is automagically compiled into an efficient SQL query. Use it either as a library or a standalone service.

Dec 29, 2022
Plenti Static Site Generator with Go backend and Svelte frontend
Plenti Static Site Generator with Go backend and Svelte frontend

Plenti Static Site Generator with Go backend and Svelte frontend Website: https://plenti.co Requirements ❗ You must have NodeJS version 13 or newer As

Jan 2, 2023