{"id":21314689,"url":"https://github.com/rohit1kumar/social-gram","last_synced_at":"2026-04-10T12:32:48.107Z","repository":{"id":147728066,"uuid":"507637806","full_name":"rohit1kumar/social-gram","owner":"rohit1kumar","description":"SocialGram - A Fully Dockerize Social Network API (ExpressJS+MongoDB+Nginx+Docker Compose)","archived":false,"fork":false,"pushed_at":"2023-03-12T06:36:52.000Z","size":272,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"dev","last_synced_at":"2025-08-21T07:53:45.434Z","etag":null,"topics":["docker","docker-compose","expressjs","mongodb","ngnix","nodejs-api","rest-api","social-media"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/rohit1kumar.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2022-06-26T17:17:11.000Z","updated_at":"2024-06-14T16:41:50.000Z","dependencies_parsed_at":"2023-05-05T00:47:27.738Z","dependency_job_id":null,"html_url":"https://github.com/rohit1kumar/social-gram","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/rohit1kumar/social-gram","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rohit1kumar%2Fsocial-gram","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rohit1kumar%2Fsocial-gram/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rohit1kumar%2Fsocial-gram/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rohit1kumar%2Fsocial-gram/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/rohit1kumar","download_url":"https://codeload.github.com/rohit1kumar/social-gram/tar.gz/refs/heads/dev","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rohit1kumar%2Fsocial-gram/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31642820,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-10T07:40:12.752Z","status":"ssl_error","status_checked_at":"2026-04-10T07:40:11.664Z","response_time":98,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["docker","docker-compose","expressjs","mongodb","ngnix","nodejs-api","rest-api","social-media"],"created_at":"2024-11-21T18:15:03.285Z","updated_at":"2026-04-10T12:32:48.099Z","avatar_url":"https://github.com/rohit1kumar.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Socialgram - A production grade social network\n\n## ExpressJS + MongoDB + Ngnix + Docker Compose\n\n\n## Introduction\nThis project is a production grade MVP of a social network.\nIn this project I've used ExpressJS for the backend, MongoDB for production database, Nginx for revrese proxy and load balancing.\nThen I have Dockerize my project into 3 containers. i.e nodeapp (ExpressJS), mongo (MongoDB), nginx (Nginx).\nAnd finally I've used Docker Compose for running multiple containers as a single service.\n## Infrastructre Diagram of Socialgram\n![Infrastructre Diagram of Socialgram](https://i.imgur.com/VGSOP7E.png)\n\n## Walkthrough of Socialgram API\n(Note: While creating the project my aim was to focus enterily in the Backend part and infra part) \\\n    The API has minimal features like:\nUser Authentication (Login, Signup, Logout) and\nAllows the user to create \u0026 remove a post with caption \u0026 image, Like \u0026 unlike a post, Follow \u0026 unfollow users, Get\nuser posts \u0026 profiles, Add \u0026 remove a comment, Update profile \u0026 password, etc.\\\n    Constructed an authentication system using JWT.\n\nTODO: will be adding frontend, along with caching\n\n\n## How to run this project\n### Clone the repository\n    git clone https://github.com/rohit1kumar/social-gram.git\n\n### Change the directory\n    cd social-gram\n### Add environment variables\n    PORT=3000\n    JWT_SECRET=\u003cJWT_SECRET\u003e\n    CLOUDINARY_NAME=\u003cCLOUDINARY_NAME\u003e\n    CLOUDINARY_API_KEY=\u003cCLOUDINARY_API_KEY\u003e\n    CLOUDINARY_API_SECRET=\u003cCLOUDINARY_API_SECRET\u003e\n\n*visit https://cloudinary.com/ click on 'Configure your SDK' to get cloudinary credentials*\n\n### Build and run the project in docker\n    docker-compose -f docker-compose.yml -f docker-compose.dev.yml up -d --build\n### Stop and remove the containers\n    docker-compose -f docker-compose.yml -f docker-compose.dev.yml down -v\n### Base URL\n    http://localhost:3000/api/v1\n## API Endpoints\n\n|  REQUEST  |  ENDPOINT         |  DESCRIPTION\n|    ---    |    ---            |     ---\n| POST      | /register         | Register user with name, email and password (or add avatar)\n| POST      | /login            | Login\n| GET       | /logout           | Logout\n| GET       | /follow/:id       | Follow a user by user's id\n| GET       | /me               | Get the loginned user profile\n| GET       | /my/posts         | Get loginned user's all posts\n| GET       | /userposts:id     | Get user's post by user's id\n| GET       | /user/:id         | Get user's profile\n| GET       | /users            | Find user by 'name' query string\n| PUT       | /update/password  | update password with oldPassword and newPassword\n| PUT       | /update/profile   | Update profile by name or email or avatar\n| GET       | /posts            | Get the post of following\n| POST      | /post/upload      | Create a post by caption \u0026 image\n| POST      | /post/:id         | Like \u0026 unlike a post by post's id (toggle)\n| POST      | /post/comment/:id | Comment on the post by post's id\n| DELETE    | /post/:id         | Delete a post by post's id\n| DELETE    | /post/comment/:id | Delete the comment of the post by comment's id\n\n\n### Use Postman to test the API endpoints\n[![Run in Postman](https://run.pstmn.io/button.svg)](https://app.getpostman.com/run-collection/20980024-b024e1ea-c8a8-4013-9879-39bc5bf971c4?action=collection%2Ffork\u0026collection-url=entityId%3D20980024-b024e1ea-c8a8-4013-9879-39bc5bf971c4%26entityType%3Dcollection%26workspaceId%3D1c687d97-092e-4c07-b900-d7384e10b729)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frohit1kumar%2Fsocial-gram","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Frohit1kumar%2Fsocial-gram","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frohit1kumar%2Fsocial-gram/lists"}