Simple instagram backend api built using golang and mongodb

Insta_api using golang and mongodb

Proper hashing algorithms have been implemented so that user password cannot be reverse engineered.

Features:
User can create a new account
User data is safe as hashing algorithms have been implemented
User can see user details using userid
User can post images with caption
Automatic time stamp will be generated
User can get all details of his posts
User can search for a particular post using its id
Proper pagination algorithms have been implemented to keep a check on the user data(Internet consumption while using the system). Used mutex to make the server thread safe Unit testing has been deployed to test the app.


To get started:
clone the repo
Change the current working directory to the location where you cloned the directory
Ensure you have golang installed(For this project, i have used 1.17)
Ensure mongodb is up and running(I have used the default port number 27017)


To run the application, type
# go run app.go

Now the server starts on port 3000
You can access it using Curl or postman

  1. Create an User <- URL should be ‘/users'
  2. Get a user using id <- URL should be ‘/users/’
  3. Create a Post <- URL should be ‘/posts'
  4. Get a post using id <- URL should be ‘/posts/’
  5. List all posts of a user <- URL should be ‘/posts/users/'

User creation
image
Updated Database
image As we can see, the password is properly hashed

Get user details using userid
image

image
image

get post according to id image

Used mutex to make the server thread safe

Similar Resources

OctoSQL is a query tool that allows you to join, analyse and transform data from multiple databases and file formats using SQL.

OctoSQL is a query tool that allows you to join, analyse and transform data from multiple databases and file formats using SQL.

OctoSQL OctoSQL is a query tool that allows you to join, analyse and transform data from multiple databases, streaming sources and file formats using

Dec 29, 2022

GoTSQL : A Better Way to Organize SQL codebase using Templates in Golang

GoTSQL - A Better Way to Organize SQL codebase using Templates in Golang Installation through Go Get command $ go get github.com/migopsrepos/gotsql In

Aug 17, 2022

Simple SQL escape and format for golang

sqlstring Simple SQL escape and format Escaping sql values //Format sql := sqlstring.Format("select * from users where name=? and age=? limit ?,?", "t

Sep 4, 2022

A Go rest API project that is following solid and common principles and is connected to local MySQL database.

A Go rest API project that is following solid and common principles and is connected to local MySQL database.

This is an intermediate-level go project that running with a project structure optimized RESTful API service in Go. API's of that project is designed based on solid and common principles and connected to the local MySQL database.

Dec 25, 2022

Use SQL to query host, DNS and exploit information using Shodan. Open source CLI. No DB required.

Shodan Plugin for Steampipe Query Shodan with SQL Use SQL to query host, DNS and exploit information using Shodan. For example: select * from shod

Nov 10, 2022

Query and Provision Cloud Infrastructure using an extensible SQL based grammar

Query and Provision Cloud Infrastructure using an extensible SQL based grammar

Deploy, Manage and Query Cloud Infrastructure using SQL [Documentation] [Developer Guide] Cloud infrastructure coding using SQL InfraQL allows you to

Oct 25, 2022

Manage SQL databases, users and grant using kubernetes manifests

SqlOperator Operate sql databases, users and grants. This is a WIP project and should not at all be used in production at this time. Feel free to vali

Nov 28, 2021

Distributed tracing using OpenTelemetry and ClickHouse

Distributed tracing backend using OpenTelemetry and ClickHouse Uptrace is a dist

Jan 2, 2023

Database - Example project of database realization using drivers and models

database Golang based database realization Description Example project of databa

Feb 10, 2022
WAL-G is an archival restoration tool for PostgreSQL, MySQL/MariaDB, and MS SQL Server (beta for MongoDB and Redis).

WAL-G is an archival restoration tool for PostgreSQL, MySQL/MariaDB, and MS SQL Server (beta for MongoDB and Redis).

Jan 1, 2023
The MongoDB driver for Go

The MongoDB driver for Go This fork has had a few improvements by ourselves as well as several PR's merged from the original mgo repo that are current

Dec 25, 2022
Bifrost ---- 面向生产环境的 MySQL 同步到Redis,MongoDB,ClickHouse,MySQL等服务的异构中间件
Bifrost ---- 面向生产环境的 MySQL 同步到Redis,MongoDB,ClickHouse,MySQL等服务的异构中间件

Bifrost ---- 面向生产环境的 MySQL 同步到Redis,ClickHouse等服务的异构中间件 English 漫威里的彩虹桥可以将 雷神 送到 阿斯加德 和 地球 而这个 Bifrost 可以将 你 MySQL 里的数据 全量 , 实时的同步到 : Redis MongoDB Cl

Dec 30, 2022
A truly Open Source MongoDB alternative

FerretDB FerretDB (previously MangoDB) was founded to become the de-facto open-source substitute to MongoDB. FerretDB is an open-source proxy, convert

Jan 2, 2023
An easy to use web authorization system integrated with MongoDB.

goth An easy to use web authorization system for MongoDB. Written 100% in Golang! Contributing Feel free to add an issue, and if you have a fix, creat

Feb 22, 2022
REST based Redis client built on top of Upstash REST API

An HTTP/REST based Redis client built on top of Upstash REST API.

Jul 31, 2022
Experimental implementation of a SQLite backend for go-mysql-server

go-mysql-sqlite-server This is an experimental implementation of a SQLite backend for go-mysql-server from DoltHub. The go-mysql-server is a "frontend

Dec 23, 2022
CRUD API example is written in Go using net/http package and MySQL database.
CRUD API example is written in Go using net/http package and MySQL database.

GoCrudBook CRUD API example is written in Go using net/http package and MySQL database. Requirements Go MySQL Code Editor Project Structure GoCrudBook

Dec 10, 2022
Database Access Layer for Golang - Testable, Extendable and Crafted Into a Clean and Elegant API

REL Modern Database Access Layer for Golang. REL is golang orm-ish database layer for layered architecture. It's testable and comes with its own test

Dec 29, 2022
SQL API is designed to be able to run queries on databases without any configuration by simple HTTP call.

SQL API SQL API is designed to be able to run queries on databases without any configuration by simple HTTP call. The request contains the DB credenti

Dec 2, 2022