{"id":23128082,"url":"https://github.com/rehan-adi/softcore-backend","last_synced_at":"2026-04-06T21:35:54.727Z","repository":{"id":241533314,"uuid":"806054718","full_name":"rehan-adi/Softcore-Backend","owner":"rehan-adi","description":"This repository contains the backend for a social media application, featuring production-level code, RESTful APIs, robust security, authentication, payment gateway integration, and data validation.","archived":false,"fork":false,"pushed_at":"2024-12-13T16:26:01.000Z","size":1220,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2024-12-17T09:17:33.793Z","etag":null,"topics":["docker","docker-compose","express","mongodb","mongoose","nodejs","redis","redis-cache","rest-api","zod-validation"],"latest_commit_sha":null,"homepage":"","language":"TypeScript","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/rehan-adi.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}},"created_at":"2024-05-26T08:46:03.000Z","updated_at":"2024-12-13T16:26:05.000Z","dependencies_parsed_at":"2024-05-30T12:53:57.554Z","dependency_job_id":"efb25001-2ee8-4a83-841c-3412a7a3cd51","html_url":"https://github.com/rehan-adi/Softcore-Backend","commit_stats":null,"previous_names":["rehan-adi/blog_backend","rehan-adi/blog-backend","rehan-adi/softcore-backend"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rehan-adi%2FSoftcore-Backend","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rehan-adi%2FSoftcore-Backend/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rehan-adi%2FSoftcore-Backend/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rehan-adi%2FSoftcore-Backend/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/rehan-adi","download_url":"https://codeload.github.com/rehan-adi/Softcore-Backend/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247128738,"owners_count":20888234,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","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","express","mongodb","mongoose","nodejs","redis","redis-cache","rest-api","zod-validation"],"created_at":"2024-12-17T09:17:32.599Z","updated_at":"2026-04-06T21:35:54.686Z","avatar_url":"https://github.com/rehan-adi.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Softcore - Social Media Backend Application\n\n## Overview\nThis is the backend of a social media application, built with modern web technologies. It handles user authentication, post management, caching, and more.\n\n---\n\n## Features\n- **Authentication**: User Signup, signin, and logout.\n- **Post Management**: Create, update, delete, and retrieve posts.\n- **Commenting System**: Add and view comments on posts.\n- **Likes**: Like and unlike posts.\n- **Profiles**: User profile creation and management.\n- **Search Functionality**: Search for posts or users.\n- **Follow System**: Follow and unfollow users.\n- **Payment Integration**: Payment handling and processing.\n- **File Uploads**: Manage media uploads using a dedicated `/uploads` directory.\n- **Security Enhancements**:\n  - Helmet for setting secure HTTP headers.\n  - MongoSanitize to prevent NoSQL injection attacks.\n  - Rate limiting to prevent abuse.\n  - HPP to protect against HTTP parameter pollution.\n- **CORS**: Configured for secure cross-origin requests.\n- **Error Handling**: Centralized middleware for managing errors.\n- **Static File Serving**: Serve static files for user uploads.\n\n---\n\n## Tech Stack\n- **Node.js** with **Express**: Backend framework\n- **TypeScript**: Typed JavaScript for robust development\n- **MongoDB** with **Mongoose**: NoSQL database\n- **Redis Cloud**: Caching mechanism\n- **bcrypt**: For hashing passwords\n- **JWT**: Authentication\n- **Cloudinary**: For media uploads\n- **Docker**: Containerized setup (optional)\n- **Prettier**: Code formatting\n- **Postman**: API testing\n\n---\n\n## Prerequisites\nEnsure the following are installed on your system:\n- **Node.js** (v18 or later)\n- **pnpm** (Preferred package manager)\n- **MongoDB** (can use cloud)\n- **Redis Cloud** account\n- **Git**\n- **Docker** (optional, for containerized setup)\n\n---\n\n## Installation and Setup\n\n1. **Clone the repository**:\n   ```bash\n   git clone https://github.com/rehan-adi/Softcore-Backend\n   cd Softcore-Backend\n   ```\n\n2. **Install dependencies**:\n   ```bash\n   pnpm install\n   ```\n\n3. **Set up environment variables**:\n   Create a `.env` file in the root directory and add the following:\n   ```env\n   PORT=3333\n   MONGO_URI=\"your_mongodb_connection_string\"\n   appName=\"YourAppName\"\n   DB_NAME=\"your_database_name\"\n   CORS_ORIGIN=\"your_frontend_url\"\n   JWT_SECRET=\"your_secret_key\"\n\n   GOOGLE_CLIENT_ID=\"your_google_client_id\"\n   GOOGLE_CLIENT_SECRET=\"your_google_client_secret\"\n\n   CLOUDINARY_CLOUD_NAME=\"your_cloudinary_name\"\n   CLOUDINARY_API_KEY=\"your_cloudinary_api_key\"\n   CLOUDINARY_API_SECRET=\"your_cloudinary_api_secret\"\n\n   REDIS_URL=\"your_redis_cloud_url\"\n   ```\n\n4. **Start the server**:\n   ```bash\n   pnpm run dev\n   ```\n\n5. **Testing the APIs**:\n   Use [Postman](https://www.postman.com/) or an alternative tool to test the APIs. Import the provided `postman_collection.json` file for pre-configured requests.\n\n---\n\n## Directory Structure\n```\n.\n├── src\n│   ├── config\n│   ├── controllers\n│   ├── db\n│   ├── interfaces\n│   ├── lib\n│   ├── middlewares\n│   ├── models\n│   ├── routes\n│   ├── utils\n│   ├── validations\n│   ├── app.ts\n│   └── server.ts\n├── types\n├── uploads\n├── .dockerignore\n├── .env.sample\n├── .gitignore\n├── .prettierignore\n├── .prettierrc\n├── docker-compose.yml\n├── Dockerfile\n├── package.json\n├── pnpm-lock.yaml\n├── README.md\n└── tsconfig.json\n\n```\n\n---\n\n## Docker Setup (using Docker Compose)\n\nThis project is configured to run with Docker Compose for easy setup and management. Note: If you prefer to run the app directly without Docker, skip this section and proceed with the standard setup.\n\n### 1. Start the application\n\nTo build and start the application, run the following command:\n\n```bash\ndocker-compose up\n```\n\nThis will automatically build the images (if needed) and start the containers based on the configuration in the docker-compose.yml file.\n\n### 2. Stop the application\n\nTo stop the running containers, use the following command:\n\n```bash\ndocker-compose down\n```\n\nThis command will stop and remove all containers defined in the docker-compose.yml file. It will also remove the networks created by Docker Compose, but it will not delete your data volumes unless you explicitly specify --volumes\n\n---\n\n## Available Scripts\n- `pnpm run dev`: Starts the development server.\n- `pnpm run build`: Builds the production-ready code.\n- `pnpm run start`: Starts the built application.\n- `pnpm run format`: Formats the codebase using Prettier.\n\n---\n\n## License\nThis project is licensed under the [MIT License](LICENSE).\n\n---\n\n## Author\n- **[Rehan]**\n- GitHub: [rehan-adi](https://github.com/rehan-adi)\n- Twitter: [Rehan_Coder](https://x.com/Rehan_Coder)\n\n---\n\n## Contributing\nContributions are welcome! Please open an issue or submit a pull request for any improvements or features.\n\n---\n\n## Acknowledgements\n- [bcrypt](https://www.npmjs.com/package/bcrypt) for password hashing\n- [Express](https://expressjs.com/) for server setup\n- [Redis Cloud](https://redis.com/) for caching\n- [Cloudinary](https://cloudinary.com/) for media handling\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frehan-adi%2Fsoftcore-backend","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Frehan-adi%2Fsoftcore-backend","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frehan-adi%2Fsoftcore-backend/lists"}