{"id":20773501,"url":"https://github.com/codewithrajdeep/fastapi_server","last_synced_at":"2025-03-11T20:51:10.149Z","repository":{"id":261526440,"uuid":"884567445","full_name":"CodewithRajDeep/FastAPI_Server","owner":"CodewithRajDeep","description":null,"archived":false,"fork":false,"pushed_at":"2024-12-07T03:45:12.000Z","size":21,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-01-18T07:31:51.509Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Python","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/CodewithRajDeep.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-11-07T01:37:59.000Z","updated_at":"2024-12-07T03:45:16.000Z","dependencies_parsed_at":"2024-11-07T02:41:36.243Z","dependency_job_id":"585fd487-1ebb-4218-8fd7-6bdc10f27aca","html_url":"https://github.com/CodewithRajDeep/FastAPI_Server","commit_stats":null,"previous_names":["codewithrajdeep/fastapi_server"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/CodewithRajDeep%2FFastAPI_Server","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/CodewithRajDeep%2FFastAPI_Server/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/CodewithRajDeep%2FFastAPI_Server/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/CodewithRajDeep%2FFastAPI_Server/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/CodewithRajDeep","download_url":"https://codeload.github.com/CodewithRajDeep/FastAPI_Server/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243112189,"owners_count":20238181,"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":"2024-11-17T12:26:01.780Z","updated_at":"2025-03-11T20:51:10.106Z","avatar_url":"https://github.com/CodewithRajDeep.png","language":"Python","readme":"## Title: FastAPI RAG Server\n\n## \u003ca name=\"description\"\u003eDescription\u003c/a\u003e\nA lightweight FastAPI server implementing Retrieval-Augmented Generation (RAG) capabilities, utilizing ChromaDB for document storage and querying,\nwith sentence-transformers for embedding generation. The server supports document ingestion and query functionalities with non-blocking API endpoints\nand efficient concurrency handling.\n\n  \u003cdiv\u003e\n    \u003cimg src=\"https://img.shields.io/badge/GitHub-100000?style=for-the-badge\u0026logo=github\u0026logoColor=white\" alt=\"github\" /\u003e\n    \u003cimg src=\"https://img.shields.io/badge/Python-3776AB?style=for-the-badge\u0026logo=python\u0026logoColor=white\" alt=\"python\" /\u003e\n  \u003c/div\u003e\n\n\n\n## 📋 \u003ca name=\"table\"\u003eTable of Contents\u003c/a\u003e\n\n1. 🤖 [Introduction](#description)\n2. ⚙️ [Tech Stack](#tech-stack)\n3. 🔋 [Features](#features)\n4. 🤸 [Quick Start](#quick-start)\n5. 🕸️ [Setup .env variables](#snippet)\n6. 🦉[Work Demonstration](#work-demonstration)\n\n##  \u003ca name=\"work-demonstration\"\u003e 🦉Work Demonstration \u003c/a\u003e\n\u003cimg src=\"\" width=\"320\" height=\"240\" /\u003e\n\n## \u003ca name=\"tech-stack\"\u003e⚙️ Tech Stack\u003c/a\u003e\n\n- FastAPI\n- ChromaDB\n- Sentence-Transformers\n- Uvicorn\n- Pytest\n- \n## \u003ca name=\"features\"\u003e🔋 Features\u003c/a\u003e\n\n👉 **Document Ingestion:** Upload PDF, DOC, DOCX, or TXT files and store document embeddings in ChromaDB.\n👉 **Querying:** Retrieve documents based on semantic similarity to a query.\n👉 **Concurrency:**  Non-blocking endpoints with concurrent document handling.\n\n## \u003ca name=\"quick-start\"\u003e🤸 Getting Started \u003c/a\u003e\n1. Clone the repository\nbash\nCopy code\n```git clone https://github.com/yourusername/fastapi-rag-server.git\ncd fastapi-rag-server\n```\n2. Set up a virtual environment\nbash\n```\nCopy code\npython3 -m venv env\nsource env/bin/activate  # On Windows, use `env\\Scripts\\activate`\n```\n4. Install dependencies\nbash\n```\nCopy code\npip install -r requirements.txt\n```\nRequirements\nThe requirements.txt should contain:\n```\nplaintext\nCopy code\nfastapi\nuvicorn\nchromadb\nsentence-transformers\npypdf\npython-docx\ntextract\n```\nRunning the Server\n1. Start the FastAPI server\nUse Uvicorn to run the FastAPI server.\n\nbash\n```\nCopy code\nuvicorn main:app --host 0.0.0.0 --port 8000 --reload\nThe server will be available at http://localhost:8000.\n```\n2. API Endpoints\nIngest Document\nEndpoint: POST /ingest/\nDescription: Uploads a document (PDF, DOC, DOCX, TXT) and stores it in ChromaDB.\nParameters: file (UploadFile) - The document file to be ingested.\nExample:\nbash\nCopy code\n```\ncurl -X 'POST' \\\n  'http://localhost:8000/ingest/' \\\n  -H 'accept: application/json' \\\n  -H 'Content-Type: multipart/form-data' \\\n  -F 'file=@path_to_your_file.pdf'\n```\nQuery Documents\nEndpoint: GET /query/\nDescription: Queries documents based on semantic similarity to the provided text.\nParameters: query (str) - The query text.\n\nbash\nCopy code\n```\ncurl -X 'GET' \\\n  'http://localhost:8000/query/?query=your_query_text' \\\n  -H 'accept: application/py'\n```\n4. Testing\nAccess the interactive API docs at http://localhost:8000/docs or the redoc documentation at http://localhost:8000/redoc.\n\nContributing\nFork the repository\nCreate a new branch for your feature or bug fix:\nbash\nCopy code\ngit checkout -b feature-name\nCommit your changes:\nbash\nCopy code\ngit commit -m \"Add new feature\"\nPush to the branch:\nbash\nCopy code\ngit push origin feature-name\nCreate a pull request\n\n## Contribution Guidelines: \nGuidelines for contributing to the project.\n\n**Reporting Issues:**\n\nSearch for existing issues: Before creating a new issue, search the issue tracker to see if the problem has already been reported.\nProvide clear and concise information: When creating a new issue, please include as much detail as possible, such as:\nClear description of the problem\nSteps to reproduce the issue\nExpected behavior\nActual behavior\nScreenshots or logs (if applicable)\nUse issue templates: If available, use the provided issue templates to structure your report.\n\n**Submitting Pull Requests:**\n\nFork the repository: Create a fork of the project on your GitHub account.\nCreate a new branch: Create a new branch based on the main branch or a feature branch.\nMake changes: Implement your changes and commit them with clear commit messages.\nPush changes to your fork: Push your changes to your forked repository.\nOpen a Pull Request: Create a pull request from your branch to the main repository.\nProvide details: Clearly describe the changes you've made and the benefits they bring.\nAddress code review feedback: Be open to feedback and make necessary changes.\n\n**Testing:**\n\nWrite unit tests for any new features or bug fixes.\nEnsure existing tests  pass after your changes.\n\n## License\nIssued : Copyright (c)|| 2024 Deep Raj \n\n## Memes: \n\u003cimg src=\"https://i.gifer.com/origin/ea/ea04580a05ae61739fefe6b70f17a4c3.gif\" width=\"256\" height=\"256\"/\u003e\n\u003cimg src=\"https://i0.wp.com/www.animefeminist.com/wp-content/uploads/2018/06/type-happy-dog-motivate.gif?fit=309%2C233\u0026ssl=1\" width=\"256\" height=\"256\"/\u003e\n\u003cimg src=\"https://i0.wp.com/www.animefeminist.com/wp-content/uploads/2018/06/pitch-baseball-explode-nichijou.gif?resize=500%2C281\u0026ssl=1\" width=\"256\" height=\"256\"/\u003e\n\n\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcodewithrajdeep%2Ffastapi_server","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcodewithrajdeep%2Ffastapi_server","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcodewithrajdeep%2Ffastapi_server/lists"}