DEV Community πŸ‘©β€πŸ’»πŸ‘¨β€πŸ’»

Cover image for Mongogram - Social media backend api using golang and mongodb
Harsh Mangalam
Harsh Mangalam

Posted on

Mongogram - Social media backend api using golang and mongodb

What I built

I have build an open source social media backend api server using Golang, Gofiber and Mongodb native driver.

Category Submission:

Think Outside the JS Box

App Link

https://github.com/harshmangalam/mongogram-api

Description

Mongogram backend api build using mongodb driver and golang.
I have utilize gofiber which is based of fasthttp - fastest http server written in go and alternative to go http. I have implemented these features in mongogram

  • Authentication
    • Login
    • Signup
  • Accounts
    • Change password
    • Deactivate account
    • Update profile
    • Reset password
  • Media

    • upload media in gridfs
    • Fetch media from gridfs
  • Search

    • Atlas search
    • Fetch recent searches
    • Clear specific recent search
    • Empty recent searches
  • Post

    • Create new post
    • Fetch post lists
    • Fetch post details
  • User

    • Follow user
    • Unfollow user
    • Fetch user lists
    • Fetch current user
    • Fetch user profile

Link to Source Code

GitHub logo harshmangalam / mongogram-api

A social media rest api build with gofiber and mongodb

Medusa Medusa

Mongogram

Social media backend api build with golang and mongodb

Features

  • Authentication

    • Login
    • Signup
  • Accounts

    • Change password
    • Deactivate account
    • Update profile
    • Reset password
  • Media

    • upload media in gridfs
    • Fetch media from gridfs
  • Search

    • Atlas search
    • Fetch recent searches
    • Clear specific recent search
    • Empty recent searches
  • Post

    • Create new post
    • Fetch post lists
    • Fetch post details
  • User

    • Follow user
    • Unfollow user
    • Fetch user lists
    • Fetch current user
    • Fetch user profile

Permissive License

MIT
https://github.com/harshmangalam/mongogram-api/blob/main/LICENSE

Background

Golang is getting popularity now a days in web and serverless. Many of the serverless , network related tools and libraries are developed using golang. Even ecosystem of go is getting mature day by day and with great open source developer community support on stackoverflow and DEV community. You can find wide variety of open source project and documentation related to go.
To develop any backend api we utilize language specific framework from where you expect better developer experience go have many backend framework that you can utilize to create api ie. Gorilla mux, Echo, Gofiber, Gokit etc...
Many database provide native drive support like Mongodb, Sqlite, Redis etc...
Golang have great concurrency support using channels and can scale to millions with little effort.

How I built it

I have utilize Mongodb Cloud to store documents related to users data and posts.
I have added search support for users profile in mongogram using mongodb atlas search.
I have utlize mongodb gridfs to store media chunks and files metadata.
Mongodb provide native go driver which have great support for vast majority of latest mongodb api.

Additional Resources/Info

https://www.mongodb.com/
https://www.mongodb.com/docs/drivers/go/current/
https://university.mongodb.com/
https://gofiber.io/
https://github.com/valyala/fasthttp
https://github.com/gofiber/fiber
https://awesome-go.com/database-drivers/

Top comments (0)

πŸ‘‹ Hey, my name is Noah and I’m the one who set up this ad. My job is to get you to join DEV, so if you fancy doing me a favor, I’d love for you to create an account.

If you found DEV from searching around, here are a couple of our most popular articles on DEV: