{"id":29417820,"url":"https://github.com/yashh-mane/swagger-upload-service","last_synced_at":"2026-04-14T05:31:28.294Z","repository":{"id":303972970,"uuid":"1017272921","full_name":"yashh-mane/swagger-upload-service","owner":"yashh-mane","description":"Node.js microservice with JWT auth \u0026 role-based access for uploading and validating Swagger (YAML/JSON). ✅ Admin-only upload (file or text) with validation ✅ Dockerized with GitLab CI/CD: builds, pushes to Docker Hub \u0026 deploys on EC2","archived":false,"fork":false,"pushed_at":"2025-07-10T12:11:32.000Z","size":25,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-07-10T19:45:48.017Z","etag":null,"topics":["api","authentication","containerization","cors","docker","express","git","javascri","javascript","jwt","middleware","mongodb","mongoose","multer","nodejs","rest","swagger","yaml"],"latest_commit_sha":null,"homepage":"http://localhost:9000","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/yashh-mane.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":"2025-07-10T09:30:12.000Z","updated_at":"2025-07-10T12:14:42.000Z","dependencies_parsed_at":"2025-07-10T19:45:52.691Z","dependency_job_id":"19312f60-c7f2-4cf2-b0f7-bdf1b5a4bac7","html_url":"https://github.com/yashh-mane/swagger-upload-service","commit_stats":null,"previous_names":["yashh-mane/swagger-upload-service"],"tags_count":null,"template":false,"template_full_name":null,"purl":"pkg:github/yashh-mane/swagger-upload-service","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yashh-mane%2Fswagger-upload-service","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yashh-mane%2Fswagger-upload-service/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yashh-mane%2Fswagger-upload-service/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yashh-mane%2Fswagger-upload-service/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/yashh-mane","download_url":"https://codeload.github.com/yashh-mane/swagger-upload-service/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yashh-mane%2Fswagger-upload-service/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31784251,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-14T02:24:21.117Z","status":"ssl_error","status_checked_at":"2026-04-14T02:24:20.627Z","response_time":153,"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":["api","authentication","containerization","cors","docker","express","git","javascri","javascript","jwt","middleware","mongodb","mongoose","multer","nodejs","rest","swagger","yaml"],"created_at":"2025-07-11T22:12:16.958Z","updated_at":"2026-04-14T05:31:28.279Z","avatar_url":"https://github.com/yashh-mane.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"🚀 Swagger Upload Service\n\nA Node.js-based microservice that allows users to upload and validate Swagger (OpenAPI) specifications in JSON or YAML format.\nIt includes user authentication, role-based authorization, file uploads, and a CI/CD pipeline that builds and deploys the app automatically to an EC2 instance using GitLab CI/CD.\n\n📋 Features\n✅ User registration \u0026 login with JWT-based authentication.\n✅ Role-based access control (user and admin).\n✅ Admins can upload Swagger files (YAML/JSON) or paste raw text.\n✅ Validates Swagger content and provides meaningful feedback.\n✅ REST APIs built with Express.js.\n✅ Data persistence with MongoDB \u0026 Mongoose.\n✅ Password hashing with bcrypt.\n✅ File uploads handled by multer.\n✅ YAML parsing with js-yaml.\n✅ CORS enabled for front-end integration.\n✅ Environment variables managed via dotenv.\n\n🐳 CI/CD \u0026 Deployment\nThis project comes with a GitLab CI/CD pipeline that:\n1️⃣ Builds the Node.js application into a Docker image.\n2️⃣ Tags the image with the current commit SHA.\n3️⃣ Pushes the Docker image to Docker Hub.\n4️⃣ Pulls the image from Docker Hub on an EC2 instance.\n5️⃣ Runs the container on EC2, exposing the API to the public.\n\n🛠️ Tech Stack \u0026 Libraries\nNode.js (v21)\nExpress.js\nMongoDB + Mongoose\nJWT for authentication\nbcrypt for password hashing\nmulter for file uploads\njs-yaml for YAML validation\ndotenv for environment variables\nCORS for cross-origin requests\nDocker for containerization\nGitLab CI/CD for automated build \u0026 deployment\nDocker Hub for image registry\nAWS EC2 for hosting the application\n\n🗃️ CI/CD Pipeline Overview\n\n✅ When you push to the main branch:\nBuild stage\nUses Docker-in-Docker to build the app as an image.\nLogs in to Docker Hub.\nTags and pushes the image to Docker Hub.\nDeploy stage\nRuns on a GitLab runner already installed on the EC2 instance.\nPulls the image from Docker Hub.\nRemoves any existing container.\nRuns the new container on EC2.\n\nThe EC2 runner is registered with GitLab and listens for jobs tagged with ec2-runner.\n\n\n📦 API Endpoints\n\n| Method | Endpoint                    | Description                     |\n| ------ | --------------------------- | ------------------------------- |\n| POST   | `/api/auth/register`        | Register a user                 |\n| POST   | `/api/auth/login`           | Login \u0026 get JWT                 |\n| POST   | `/api/admin/upload-swagger` | Admin-only: Upload Swagger spec |\n\n🔗 Notes\nEnsure your EC2 instance has a GitLab runner installed \u0026 registered with the tag ec2-runner.\nEnsure your Docker Hub credentials (DOCKER_USERNAME \u0026 DOCKER_PASSWORD) are set in GitLab CI/CD variables.\nThe pipeline runs on main branch.","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fyashh-mane%2Fswagger-upload-service","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fyashh-mane%2Fswagger-upload-service","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fyashh-mane%2Fswagger-upload-service/lists"}