{"id":26916854,"url":"https://github.com/codewithalihamza/humble-superhero-backend","last_synced_at":"2025-06-11T14:10:15.182Z","repository":{"id":276361116,"uuid":"929050055","full_name":"codewithalihamza/humble-superhero-backend","owner":"codewithalihamza","description":null,"archived":false,"fork":false,"pushed_at":"2025-02-07T19:20:01.000Z","size":9,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"develop","last_synced_at":"2025-02-07T19:26:59.829Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"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/codewithalihamza.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":"2025-02-07T18:03:13.000Z","updated_at":"2025-02-07T19:20:04.000Z","dependencies_parsed_at":"2025-02-07T19:37:02.619Z","dependency_job_id":null,"html_url":"https://github.com/codewithalihamza/humble-superhero-backend","commit_stats":null,"previous_names":["codewithalihamza/humble-superhero-backend"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/codewithalihamza%2Fhumble-superhero-backend","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/codewithalihamza%2Fhumble-superhero-backend/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/codewithalihamza%2Fhumble-superhero-backend/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/codewithalihamza%2Fhumble-superhero-backend/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/codewithalihamza","download_url":"https://codeload.github.com/codewithalihamza/humble-superhero-backend/tar.gz/refs/heads/develop","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":246706247,"owners_count":20820784,"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":[],"created_at":"2025-04-01T19:49:56.732Z","updated_at":"2025-04-01T19:49:57.345Z","avatar_url":"https://github.com/codewithalihamza.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"## **📜 README for Backend (NestJS API)**\n```md\n# 🦸‍♂️ Humble Superhero API (Backend)\n\nThis is the backend for the **Humble Superhero API**, built using **NestJS**. It allows users to add superheroes with a humility score and fetch them sorted by their humility.\n\n---\n\n## 🚀 Features\n\n- **Add Superheroes:** API to add a superhero with a name, superpower, and humility score.\n- **Fetch Superheroes:** API returns superheroes sorted by humility score.\n- **Validation:** Ensures humility score is a number between **1 and 10**.\n- **Simple In-Memory Database:** Stores data temporarily in an array.\n\n---\n\n## 🛠️ Tech Stack\n\n- **NestJS** - A progressive Node.js framework.\n- **Node.js \u0026 TypeScript** - For backend development.\n- **Jest** - For testing.\n\n---\n\n## 🔧 Installation \u0026 Running the Project\n\n1. **Clone the Repository:**\n   ```sh\n   https://github.com/codewithalihamza/humble-superhero-backend.git\n   ```\n\n2. **Install NestJS in the Existing Directory:**\n   ```sh\n   npm install\n   ```\n\n3. **Start the API:**\n   ```sh\n   npm run start\n   ```\n\n---\n\n## 📌 API Endpoints\n\n### **1️⃣ Add a New Superhero**\n**`POST /superheroes`**  \n📩 **Request Body:**\n```json\n{\n  \"name\": \"Captain Kindness\",\n  \"superpower\": \"Inspires humility\",\n  \"humilityScore\": 9\n}\n```\n📤 **Response:**\n```json\n{\n  \"id\": 1,\n  \"name\": \"Captain Kindness\",\n  \"superpower\": \"Inspires humility\",\n  \"humilityScore\": 9\n}\n```\n\n---\n\n### **2️⃣ Get All Superheroes (Sorted by Humility)**\n**`GET /superheroes`**  \n📤 **Response:**\n```json\n[\n  {\n    \"id\": 1,\n    \"name\": \"Captain Kindness\",\n    \"superpower\": \"Inspires humility\",\n    \"humilityScore\": 9\n  },\n  {\n    \"id\": 2,\n    \"name\": \"The Modest Marvel\",\n    \"superpower\": \"Lowers ego levels\",\n    \"humilityScore\": 8\n  }\n]\n```\n\n---\n\n## ✅ **Technical Skills**\n- **Code Quality:** Modular NestJS structure for scalability.\n- **Validation:** Uses DTOs and validation for better data integrity.\n- **Testing:** Basic Jest test included.\n\n---\n\n## 🤝 **Team Player Attitude**\n\u003e If working with a teammate, I would:\n1. **Use Git Branches:** Feature branches (`feature/add-superhero`, `feature/tests`).\n2. **PR Reviews:** Ensure best practices before merging.\n3. **Task Division:** Backend \u0026 frontend teams work in parallel.\n4. **Communication:** Use Slack or others for updates.\n5. **Testing \u0026 Deployment:** Automate API tests before deployment.\n\n---\n\n## 🧠 **If I Had More Time...**\nIf I had more time, I would:\n1. **Use a Database:** PostgreSQL or MongoDB instead of an in-memory array.\n2. **Add Authentication:** Secure the API with JWT authentication.\n3. **Rate Limiting:** Prevent spam requests using rate-limiting middleware.\n4. **Deploy the API:** Host on **Heroku** or **Vercel**.\n\n---\n\n## 🎤 **Humility and Communication**\n- **Code is well-documented** with clear comments.\n- **README provides easy setup instructions.**\n- **Project is structured for easy collaboration.**\n\n---","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcodewithalihamza%2Fhumble-superhero-backend","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcodewithalihamza%2Fhumble-superhero-backend","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcodewithalihamza%2Fhumble-superhero-backend/lists"}