{"id":22151058,"url":"https://github.com/francislagares/github-org-finder","last_synced_at":"2026-04-09T11:42:07.160Z","repository":{"id":246929841,"uuid":"823763895","full_name":"francislagares/github-org-finder","owner":"francislagares","description":"A Clean Architecture Fullstack MERN application where user enters a github ORG name in text input and retrieve a list or repositories belonging to this ORG.","archived":false,"fork":false,"pushed_at":"2025-01-25T12:22:28.000Z","size":1440,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-01-25T13:18:51.739Z","etag":null,"topics":["clean-architecture","express","mern","mern-stack","mongodb","mongoose","next15","nodejs","react-query","react-table","react19","shadcn-ui"],"latest_commit_sha":null,"homepage":"","language":"TypeScript","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/francislagares.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":"2024-07-03T17:00:34.000Z","updated_at":"2025-01-25T12:21:43.000Z","dependencies_parsed_at":"2024-07-22T23:19:38.962Z","dependency_job_id":"3e655208-98a9-4f4f-b15c-3692bcaedb7d","html_url":"https://github.com/francislagares/github-org-finder","commit_stats":null,"previous_names":["francislagares/github-org-finder"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/francislagares%2Fgithub-org-finder","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/francislagares%2Fgithub-org-finder/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/francislagares%2Fgithub-org-finder/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/francislagares%2Fgithub-org-finder/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/francislagares","download_url":"https://codeload.github.com/francislagares/github-org-finder/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":245276093,"owners_count":20588895,"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":["clean-architecture","express","mern","mern-stack","mongodb","mongoose","next15","nodejs","react-query","react-table","react19","shadcn-ui"],"created_at":"2024-12-02T00:29:57.453Z","updated_at":"2025-12-30T23:27:08.512Z","avatar_url":"https://github.com/francislagares.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"![Image](https://res.cloudinary.com/jobber-app/image/upload/v1684787771/github-banners/mern_tvu7kz.webp)\n\n# Node.js API - GitHub Repositories Explorer\n\n![GitHub Workflow Status](https://img.shields.io/github/actions/workflow/status/francislagares/github-org-finder/ci.yaml?style=for-the-badge)\n\n![Image](https://res.cloudinary.com/jobber-app/image/upload/v1733915642/Screenshot_From_2024-12-11_12-10-49_wthrkp.png)\n\nThis project is a Node.js-based API for exploring GitHub organization repositories. The API supports both local and Dockerized environments. Follow the instructions below to set up and run the project.\n\n---\n\n## **Prerequisites**\n\nBefore you begin, make sure you have the following installed:\n\n1. **Node.js** (recommended version: 23 or later).\n2. **pnpm** (preferred package manager for this project).\n3. **Docker** and **Docker Compose**.\n4. A GitHub personal access token for API authentication.\n\n---\n\n# Setup Instructions\n\n## 1. Running Locally\n\nTo run the API locally:\n\n1. Clone the repository and install dependencies.\n\n```sh\n# clone repository\ngit clone git@github.com:francislagares/github-org-finder.git\n\n# cd into\ncd github-org-finder\n\n# install required dependencies\npnpm install\n```\n\n\u003cbr /\u003e\n\n## **Environment Variables**\n\nThe API requires the following environment variables. Configure these in a `.env` or `.env.development.local` file in the api directory.\n\n```env\nGITHUB_SECRET=your_github_secret\nREDIS_HOST=localhost\nDATABASE_URL=mongodb://localhost:27017/repos_db\nCORS_ORIGIN=http://localhost:5173\n```\n\n## 2. Running with PM2\n\nTo run the API using pm2:\n\n1. Create a `.env.development.local` file in the api directory with the following Docker environment variables.\n\n```env\nGITHUB_SECRET=your_github_secret\nREDIS_HOST=localhost\nDATABASE_URL=mongodb://localhost:27017/repos_db\nCORS_ORIGIN=http://localhost:5173\n```\n\n### Local environment\n1. Run the following command:\n\n```sh\npnpm pm2:dev\n```\n\n### Production environment\n\n1. Run the following command:\n\n```sh\npnpm build:api\n```\n\n2. Start the PM2 Daemon:\n\n```sh\npnpm pm2:prod\n```\n\n### Side Notes\n\nYou need to stop and clean the instance of pm2 before switching environment. Or just change ports in ecosystem.config.js file.\n\n### Stop the PM2 Daemon\n\n```sh\npnpm pm2:stop\n```\n### Clean PM2 instance\n\n```sh\npnpm pm2:clean\n```\n\n\n## 3. Running with Docker\n\nTo run the API using Docker:\n\n1. Ensure Docker and Docker Compose are installed and running on your system.\n\n2. Create a `.env` or `.env.development.local` file in the api directory with the following Docker environment variables.\n\n```env\nGITHUB_SECRET=your_github_secret\nREDIS_HOST=redis\nDATABASE_URL=mongodb://mongodb:27017/repos_db\nCORS_ORIGIN=http://localhost:5173\n```\n\n3. Build and start the Docker containers:\n\n```sh\ndocker-compose up --build\n```\n\n4. Verify the API is running by accessing http://localhost:4000/api/v1/health\n\n## API Endpoints\n\n### **Health Check**\n\n- **URL:** `/health`\n- **Method:** `GET`\n- **Description:** Checks if the API is running.\n\n### **Fetch Repositories**\n\n- **URL:** `/api/v1/orgs/:orgName/repos`\n- **Method:** `GET`\n- **Query Parameters:**\n  - `page` (optional): Page number for pagination (default is `1`).\n  - `limit` (optional): Limit number for repositories (default is `10`).\n- **Description:** Retrieves repositories for a given GitHub organization.\n\n### **Save Repositories to Database**\n\n- **URL:** `/api/v1/repos/save`\n- **Method:** `POST`\n- **Description:** Saves repositories to the MongoDB database.\n\n### **Delete Repository**\n\n- **URL:** `/api/v1/repos/:id`\n- **Method:** `DELETE`\n- **Description:** Deletes a repository from the MongoDB database by its ID.\n\n## Query the API in Swagger\n\nThis project provides an API that you can interact with using Swagger, an interactive API documentation tool. To query the API correctly, you need to configure your environment with the GITHUB_SECRET token, which is required to access certain routes of the API.\n\n### 2. Access Swagger\n\nOnce the `GITHUB_SECRET` variable is configured, you can access Swagger to explore and query the API.\n\n- **Swagger URL**: [http://localhost:4000/api-docs](http://localhost:4000/api-docs) _(adjust the port if needed)_.\n\n### 3. Authenticate with GitHub Secret\n\nWhen accessing the API documentation via Swagger, you need to authenticate using the `GITHUB_SECRET` token. This is done via an HTTP header for routes that require authentication.\n\n#### Add the token in Swagger\n\n1. Open the Swagger page in your browser.\n2. At the top, you'll find an \"Authorize\" button.\n3. Click on \"Authorize\".\n4. In the authentication field, enter your actual GITHUB_SECRET token for the `Authorization` header like so:\n\n```\nghp_12345abcdef6789test\n```\n\n(Replace ghp_12345abcdef6789 with your actual GITHUB_SECRET token).\n\n5. Click \"Authorize\" to confirm.\n\nNow you will be able to make authenticated requests to the API routes that require the GITHUB_SECRET token.\n\n## Current Project Status\n\nWhile the API is already functional the client side is still in development and additional features are being developed and refined. \u003cbr /\u003e Please check the client folder for the latest updates.\n\n## Author\n\n- [Francis Lagares](https://www.linkedin.com/in/francislagares)\n- [Portfolio](https://francislagares.vercel.app/)\n\n## All contributions are welcome\n\nContributions are more than welcomed.\n\nFeel free to open issues for asking questions, suggesting features or other things!\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffrancislagares%2Fgithub-org-finder","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ffrancislagares%2Fgithub-org-finder","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffrancislagares%2Fgithub-org-finder/lists"}