{"id":24993882,"url":"https://github.com/datarohit/gopher-social-backend","last_synced_at":"2026-04-07T08:32:11.399Z","repository":{"id":274165095,"uuid":"921850672","full_name":"DataRohit/Gopher-Social-Backend","owner":"DataRohit","description":"Gopher Social Backend is a high-performance API server for a social media platform tailored for Go enthusiasts. Built with Go and Gin Gonic, it offers user management, content creation, social interactions, and more, with a focus on scalability, security, and developer experience.","archived":false,"fork":false,"pushed_at":"2025-01-26T17:56:54.000Z","size":1084,"stargazers_count":1,"open_issues_count":0,"forks_count":1,"subscribers_count":1,"default_branch":"master","last_synced_at":"2026-01-25T17:16:06.411Z","etag":null,"topics":["aider","bcrypt","docker","docker-compose","gin-gonic","go-redis","golang","logrus","makefile","pgx-v5","postgresql","redis","swaggo"],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/DataRohit.png","metadata":{"files":{"readme":"readme.md","changelog":null,"contributing":null,"funding":null,"license":"license","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}},"created_at":"2025-01-24T18:27:45.000Z","updated_at":"2025-02-04T18:12:08.000Z","dependencies_parsed_at":"2025-01-25T11:25:58.084Z","dependency_job_id":"2bdc1144-12d1-4ce6-aa28-676326f9fcf4","html_url":"https://github.com/DataRohit/Gopher-Social-Backend","commit_stats":null,"previous_names":["datarohit/gopher-social-backend"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/DataRohit/Gopher-Social-Backend","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DataRohit%2FGopher-Social-Backend","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DataRohit%2FGopher-Social-Backend/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DataRohit%2FGopher-Social-Backend/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DataRohit%2FGopher-Social-Backend/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/DataRohit","download_url":"https://codeload.github.com/DataRohit/Gopher-Social-Backend/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DataRohit%2FGopher-Social-Backend/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31506562,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-07T03:10:19.677Z","status":"ssl_error","status_checked_at":"2026-04-07T03:10:13.982Z","response_time":105,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: 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":["aider","bcrypt","docker","docker-compose","gin-gonic","go-redis","golang","logrus","makefile","pgx-v5","postgresql","redis","swaggo"],"created_at":"2025-02-04T14:36:58.615Z","updated_at":"2026-04-07T08:32:11.347Z","avatar_url":"https://github.com/DataRohit.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Gopher Social Backend 🚀\n\n[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)\n\n## Description 📚\n\nGopher Social Backend is the API server for Gopher Social, a social media platform built for Gophers (Go enthusiasts!). This backend provides a robust and scalable foundation for a social networking experience, offering features for user management, content creation, social interactions, and more.\n\nThis API is built using Go, leveraging the Gin Gonic framework for high performance and efficiency. It's designed with best practices in mind, including:\n\n*   **Authentication \u0026 Authorization:** Secure JWT-based authentication and role-based authorization to protect your data and ensure only authorized users can perform specific actions.\n*   **Scalability:** Designed to handle a growing user base and increasing data volume with PostgreSQL and Redis integration.\n*   **Observability:** Comprehensive logging with Logrus, request tracing with Request IDs, and health check endpoints for monitoring and maintenance.\n*   **Developer Experience:**  Well-documented API using Swagger, making it easy for frontend and mobile developers to integrate with the backend.\n\n## Features ✅\n\n*   **User Authentication:**\n    *   User Registration with Email Verification\n    *   Login and Logout\n    *   Password Reset (Forgot Password Flow)\n    *   Account Activation and Resend Activation Link\n*   **User Profile Management:**\n    *   Update Profile Information (First Name, Last Name, Website, Social Links)\n    *   Retrieve Own Profile and User Profiles by Identifier\n*   **Social Interactions:**\n    *   Follow and Unfollow Users\n    *   Get Followers and Following Lists for Users\n*   **Post Management:**\n    *   Create, Update, and Delete Posts\n    *   Retrieve Posts by ID\n    *   List Posts for Logged-in User and by User Identifier\n*   **Post Likes \u0026 Dislikes:**\n    *   Like and Unlike Posts\n    *   Dislike and Undislike Posts\n    *   List Liked and Disliked Posts for Logged-in User and by User Identifier\n*   **Comment Management:**\n    *   Create, Update, and Delete Comments on Posts\n    *   Retrieve Comments by ID\n    *   List Comments for Logged-in User and by User Identifier for a Post\n*   **Comment Likes \u0026 Dislikes:**\n    *   Like and Unlike Comments\n    *   Dislike and Undislike Comments\n    *   List Liked and Disliked Comments for a Post by Logged-in User and by User Identifier\n*   **News Feed:**\n    *   Retrieve Latest Posts for a Personalized Feed\n    *   Get a Specific Post with its Comments\n*   **Moderation \u0026 Administration Actions:**\n    *   Timeout Users\n    *   Remove User Timeout\n    *   List Timed Out Users\n    *   Deactivate and Activate Users\n    *   Ban and Unban Users\n    *   Delete Comments and Posts (Moderator/Admin Roles)\n*   **Health Checks:**\n    *   Router Health\n    *   Redis Health\n    *   PostgreSQL Health\n*   **Middleware \u0026 Enhancements:**\n    *   Request Rate Limiting (using Redis)\n    *   Request Timeout Handling\n    *   CORS (Cross-Origin Resource Sharing) Support\n    *   Request Logging with Request IDs and Real IP detection\n    *   Panic Recovery\n\n## Technologies Used 🛠️\n\n*   [Go](https://go.dev/) - Programming Language\n*   [Gin Gonic](https://gin-gonic.com/) - Web Framework\n*   [PostgreSQL](https://www.postgresql.org/) - Relational Database\n*   [Redis](https://redis.io/) - In-memory Data Store (Caching, Rate Limiting)\n*   [pgx](https://github.com/jackc/pgx) - PostgreSQL Driver for Go\n*   [go-redis/redis](https://github.com/redis/go-redis) - Redis client for Go\n*   [logrus](https://github.com/sirupsen/logrus) - Structured Logger\n*   [golang-jwt/jwt](https://github.com/golang-jwt/jwt/v5) - JSON Web Tokens (JWT) for Authentication\n*   [golang.org/x/crypto/bcrypt](https://pkg.go.dev/golang.org/x/crypto/bcrypt) - Password Hashing\n*   [Docker](https://www.docker.com/) \u0026 [Docker Compose](https://docs.docker.com/compose/) - Containerization\n*   [Swaggo](https://github.com/swaggo/swag) - Swagger for API Documentation\n*   [Make](https://www.gnu.org/software/make/) - Build Automation Tool\n*   [aider](https://aider.chat/) - AI pair programming + `gemini-2.0-flash-thinking-exp-01-21` Large Language Model\n\n## Environment Variables ⚙️\n\nConfiguration is managed through environment variables. Example environment files are provided in the `.envs` directory:\n\n*   `.envs/.postgres.env.example`: PostgreSQL database configuration.\n*   `.envs/.server.env.example`: Server and application settings.\n\n**Required Environment Variables:**\n\n*   `SERVER_MODE`:  Set to `release` for production, defaults to `release`.\n*   `SERVER_PORT`:  Port for the server to listen on, defaults to `:8080`.\n*   `POSTGRES_HOST`: PostgreSQL host address, defaults to `localhost`.\n*   `POSTGRES_PORT`: PostgreSQL port, defaults to `5432`.\n*   `POSTGRES_USER`: PostgreSQL username, defaults to `postgres`.\n*   `POSTGRES_PASSWORD`: PostgreSQL password, defaults to `postgres`.\n*   `POSTGRES_DBNAME`: PostgreSQL database name, defaults to `gopher`.\n*   `POSTGRES_SSLMODE`: PostgreSQL SSL mode, defaults to `disable`.\n*   `REDIS_ADDR`: Redis server address, defaults to `localhost:6379`.\n*   `REDIS_PASSWORD`: Redis password (if any), defaults to empty.\n*   `REDIS_DB`: Redis database number, defaults to `0`.\n*   `JWT_ACCESS_SECRET`: Secret key for JWT access tokens.\n*   `JWT_REFRESH_SECRET`: Secret key for JWT refresh tokens.\n*   `JWT_RESET_SECRET`: Secret key for JWT password reset tokens.\n*   `JWT_ACTIVATION_SECRET`: Secret key for JWT activation tokens.\n*   `DATABASE_URL`: Database connection URL, if using URL configuration.\n*   `DOMAIN`: Base domain URL for activation and password reset links, defaults to `http://localhost:8080`.\n\nRefer to the example files for more details and other optional configurations.\n\n## Docker Setup 🐳\n\nTo get started with Docker, ensure you have Docker and Docker Compose installed.\n\n1.  **Clone the repository:**\n    ```bash\n    git clone \u003crepository-url\u003e\n    cd gopher-social-backend\n    ```\n\n2.  **Copy environment files and configure them:**\n    ```bash\n    cp .envs/.postgres.env.example .envs/.postgres.env\n    cp .envs/.server.env.example .envs/.server.env\n    # ... and modify the .env files with your desired settings ...\n    ```\n\n3.  **Build and start the Docker containers:**\n    ```bash\n    make docker-build\n    ```\n    This command will build the Docker image and start the services defined in `docker-compose.yml` in detached mode.\n\n4.  **Access the API:**\n    The API will be accessible at `http://localhost:8080`.\n\n5.  **Stop and clean up Docker containers:**\n    ```bash\n    make docker-clean\n    ```\n    This command will stop and remove the containers, images, volumes, and network associated with the project.\n\n## Makefile Commands 🛠️\n\nThe `Makefile` provides convenient commands for development and deployment:\n\n*   **`make help`**:  Displays a help message listing available commands.\n*   **`make docker-build`**: Builds and starts the Docker containers in detached mode.\n*   **`make docker-clean`**: Stops and cleans up Docker resources (containers, images, volumes, and build cache).\n*   **`make gen-docs`**: Generates Swagger API documentation.\n*   **`make migrate-create`**: Creates a new database migration file.\n*   **`make migrate-up`**: Applies all pending database migrations.\n*   **`make migrate-down`**: Rolls back database migrations (prompts for the number of steps).\n*   **`make migrate-clean`**: Drops all database objects created by migrations.\n\n## API Documentation 📚\n\nThe API documentation is generated using Swagger and is available at:\n\n[http://localhost:8080/swagger/index.html](http://localhost:8080/swagger/index.html)\n\nAfter starting the server, you can access the Swagger UI to explore the API endpoints, models, and try out requests.\n\nTo regenerate the documentation after making changes to the codebase, run:\n```bash\nmake gen-docs\n```\n![Swagger UI Demo](./assets/images/Swagger-UI-01-26-2025_11_21_PM.png)\n\n## Health Check Script 🩺\n\nThe `healthCheck.sh` script is used by Docker to verify the health of the application. It performs HTTP GET requests to the health check endpoints:\n\n* `/api/v1/health/router`\n* `/api/v1/health/redis`\n* `/api/v1/health/postgres`\n\nIf all checks pass, the script exits with code 0, otherwise with code 1, indicating an unhealthy state.\n\n## License 📝\n\nThis project is licensed under the MIT License - see the [LICENSE](license) file for details.\n\n## Contributing 🤝\n\nContributions are welcome! Please feel free to submit pull requests, report issues, or suggest new features to improve Gopher Social Backend.\n\n**Author:** Rohit Vilas Ingole ([rohit.vilas.ingole@gmail.com](mailto:rohit.vilas.ingole@gmail.com))\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdatarohit%2Fgopher-social-backend","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdatarohit%2Fgopher-social-backend","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdatarohit%2Fgopher-social-backend/lists"}