A social media API to handle users and their posts, written from scratch in Golang

Initial Set-Up

To start the project on your own machine you'll need Golang instlled, along with mongoDB. Once you've insured these requirements are met, download or clone this repo on your own machine and execute the following commands in order:

go install 

One this command is successfully executed, you're ready to run the API.

Running the API

To start the process, input the following command in terminal:

go run . 

This runs all the components in the go package (packgake main case), make sure the terminal output shows the following:

Starting the application...

Now the API is running on your machine on the local port 12345, next lets move onto testing out newly implemented API!

Testing

We recommend you use Postman to input data into the dataset and compass to monitor your input data. Input data in the formats of the sturctures provided in posts.go and user.go in the repo for posts and users respectively.
To input data in user collection the link is: http://localhost/12345/user
To input data in post collection the link is: http://localhost/12345/post
To get user data out of user collection the link is: http://localhost/12345/user/{id} replace id by the user's ID you want.
To all data in user collection the link is: http://localhost/12345/users
To get post data out of user collection the link is: http://localhost/12345/posts/users/{id} replace id by the user's ID whose post you want to see.

However, we have also done the unit testing outselves! The results we recieved from doing so are given as follows:

image


image


image


image

Owner
Ayush Neekhar
CSE undergrad, aspiring dev!
Ayush Neekhar
Similar Resources

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

Go-gin-mongo-api - A backend RESTful API built using golang, gin and mongoDB

go-gin-mongo-API This is a RESTful backend API which is developed using the gola

Jul 19, 2022

A coinbase Golang API written in Go

A coinbase Golang API written in Go

Oct 29, 2021

REST API written in GO with PostgreSQL and Nginx Proxy + Certbot Let's Encrypt HTTPS certificates + Graphical Frontend in PHP. Deployed via docker-compose.

SSOA-PT REST APP Services Backend: REST API in Go Database: PostgreSQL Web Proxy: Nginx Let's Encrypt HTTPS certificates with certbot Frontend: PHP Ap

Mar 19, 2022

Fully serverless CAPTCHA API created with API Gateway, Lambda, Dynamodb and Go

Fully serverless CAPTCHA API created with API Gateway, Lambda, Dynamodb and Go

Fully serverless CAPTCHA API created with API Gateway, Lambda, Dynamodb and Go

Mar 4, 2022

Another - REST API Written In Go

REST API Written In Go This simple REST API was built to better understand how t

Feb 10, 2022

Rental-api - A RESTful-API that allows developers to connect to data about rental properties

Rentals-API is a RESTful-API that allows developers to connect to data about rental properties.

Jan 24, 2022

Ecommerce-api - Rest api of e-commerce web application

Ecommerce-api - Rest api of e-commerce web application

E-commerce Rest API Swagger documentation to test api Domain diagram

Jan 2, 2023

License-API - Basic license based authentication API with discord account integration

License-API Basic license based authentication API with discord account integrat

Feb 18, 2022
It is a clone of the CRUD operations on Instagram which can create, get, create posts and get the post along with pagination
It is a clone of the CRUD operations on Instagram which can create, get, create posts and get the post along with pagination

Instagram-API-Clone It is a basic version of a RESTful API based on Instagram where we can create user, get the users, create post and get post and ge

Jan 25, 2022
Simple Go BE to serve blog posts

Simple Go BE to serve blog posts

Jan 25, 2022
Simple Bank is a simple REST API that allows users to perform transferences with each other.

Simple Bank is a simple REST API that allows users to perform transferences with each other. ?? Technologies Golang Docker PostgreSQ

Feb 15, 2022
Users API Service
Users API Service

bookstore_users-api Users API Service Overview This application handles users. Project Structure This project was written in golang, designed to use M

Feb 12, 2022
Oct 1, 2021
Give developers an easy way to create and integrate bank processing into their own software products
Give developers an easy way to create and integrate bank processing into their own software products

Community ยท Blog moov-io/bankcron Moov's mission is to give developers an easy way to create and integrate bank processing into their own software pro

Sep 27, 2022
Birthdays is a web service that stores the birthday date of users and calculates the remaining days until the user's birthday.
Birthdays is a web service that stores the birthday date of users and calculates the remaining days until the user's birthday.

Birthdays is a web service that stores the birthday date of users and calculates the remaining days until the user's birthday. Features Metrics servic

May 2, 2022
GoTrue is a small open-source API written in Golang, that can act as a self-standing API service for handling user registration and authentication for Jamstack projects.
GoTrue is a small open-source API written in Golang, that can act as a self-standing API service for handling user registration and authentication for Jamstack projects.

GoTrue is a small open-source API written in Golang, that can act as a self-standing API service for handling user registration and authentication for Jamstack projects.

Dec 13, 2021
Go-todo-api - An example API project written Go and Fiber Framework

This is an example API project written Go and Fiber Framework. Test codes has been written for all controller functions. Environment variables are taken from config.yml.

Jan 24, 2022
A RESTful API written in Golang to store and retrieve ticket information.

Tickets-API A RESTful API written in Golang to store and retrieve ticket information. This is a RESTful API built on top of the gin-gonic/gin package

Jan 31, 2022