{"id":29935081,"url":"https://github.com/joacod/lawrence","last_synced_at":"2026-04-13T13:01:43.045Z","repository":{"id":306490713,"uuid":"999790081","full_name":"joacod/lawrence","owner":"joacod","description":"Backend for Lawrence AI, designed to automate and streamline the requirements‑engineering workflow for product owners and managers","archived":false,"fork":false,"pushed_at":"2025-07-31T18:28:30.000Z","size":269,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2026-01-16T05:30:54.439Z","etag":null,"topics":["ai","fastapi","langchain","ollama","python"],"latest_commit_sha":null,"homepage":"","language":"Python","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/joacod.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,"zenodo":null}},"created_at":"2025-06-10T19:41:10.000Z","updated_at":"2025-08-10T03:20:14.000Z","dependencies_parsed_at":"2025-07-26T02:21:35.241Z","dependency_job_id":"01520483-d4cb-4054-b6e0-6983bb6eb97f","html_url":"https://github.com/joacod/lawrence","commit_stats":null,"previous_names":["joacod/lawrence"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/joacod/lawrence","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/joacod%2Flawrence","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/joacod%2Flawrence/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/joacod%2Flawrence/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/joacod%2Flawrence/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/joacod","download_url":"https://codeload.github.com/joacod/lawrence/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/joacod%2Flawrence/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31753551,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-13T09:16:15.125Z","status":"ssl_error","status_checked_at":"2026-04-13T09:16:05.023Z","response_time":93,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: 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":["ai","fastapi","langchain","ollama","python"],"created_at":"2025-08-02T20:12:06.848Z","updated_at":"2026-04-13T13:01:43.034Z","avatar_url":"https://github.com/joacod.png","language":"Python","funding_links":["https://www.buymeacoffee.com/joacod"],"categories":[],"sub_categories":[],"readme":"\u003cdiv align=\"center\"\u003e\n\n# Lawrence Backend\n\n[![GitHub](https://img.shields.io/github/license/mashape/apistatus.svg)](https://github.com/joacod/lawrence/blob/main/LICENSE)\n\n[![Python](https://img.shields.io/badge/python-3670A0?style=for-the-badge\u0026logo=python\u0026logoColor=ffdd54)](https://www.python.org)\n[![FastAPI](https://img.shields.io/badge/FastAPI-005571?style=for-the-badge\u0026logo=fastapi)](https://fastapi.tiangolo.com/)\n\n\u003c/div\u003e\n\n## Introduction\n\nLawrence is a co‑pilot that automates the _requirements‑engineering_ workflow for software Product Owners and managers.\n\nIt uses AI to transform vague feature ideas into well‑structured specifications, and generates helpful documentation.\n\n\u003cp align=\"center\"\u003e\n  \u003cimg width=\"45%\" src=\"https://github.com/joacod/lawrence/blob/main/readme-pics/app-example.webp\" alt=\"App Thumbnail\"\u003e\n  \u003cimg width=\"45%\" src=\"https://github.com/joacod/lawrence/blob/main/readme-pics/feature-overview.webp\" alt=\"Feature Overview Thumbnail\"\u003e\n\u003c/p\u003e\n\n## Project Overview\n\nThis project provides a REST API that:\n\n- Accepts a software feature description.\n- Generates clarifying questions if the feature is vague.\n- Updates the feature details and pending questions.\n- Maintains conversation context for iterative refinement.\n- Generates a feature overview including:\n  - Feature description\n  - Acceptance criteria\n  - Backend tickets needed\n  - Frontend tickets needed\n- Endpoint to export the complete feature overview documentation as Markdown or PDF.\n\n## Lawrence Frontend\n\nThe frontend is a separate project that provides a user interface for interacting with the Lawrence backend. It allows users to submit feature descriptions, view generated questions, and manage feature specifications.\n\nYou can find the frontend project here: [Lawrence UI](https://github.com/joacod/lawrence-ui)\n\n## Prerequisites\n\n- **Python**: 3.12\n- **Ollama**: Installed and running with the follwing models:\n  - `mistral:latest` (Advanced 7B model with enhanced reasoning)\n  - `phi3:latest` (Lightweight 3B fast model for quick responses)\n\n## Setup Instructions\n\nFollow these steps to set up and run Lawrence locally.\n\n### 1. Create a Virtual Environment\n\n```bash\npython3.12 -m venv venv\n```\n\n**Expected output**: Creates an isolated Python environment in `/lawrence/venv`.\n\n### 2. Activate the Virtual Environment\n\nActivates the virtual environment, updating your shell to use the isolated Python.\n\n```bash\nsource venv/bin/activate\n```\n\n**Expected output**: Prompt changes to `(venv) user@machine:~/lawrence$`.\n\n### 3. Install Dependencies\n\n```bash\npip install -r requirements.txt\n```\n\n**What it does**: Installs project dependencies (FastAPI, LangChain, etc.) listed in `requirements.txt`.\n\n### 4. Run the Service\n\n```bash\npython -m src.main\n```\n\n**What it does**: Starts the FastAPI server on `http://localhost:8000`.\n\n## Testing\n\nLawrence uses a comprehensive testing framework to ensure code quality and reliability.\n\n### Testing Libraries\n\n- **pytest**: Main testing framework\n- **pytest-asyncio**: Async test support\n- **pytest-mock**: Mocking utilities\n- **pytest-cov**: Code coverage reporting\n- **httpx**: HTTP client for API testing\n- **factory-boy**: Test data factories\n\n### Running Tests\n\n#### Run All Tests with Coverage\n\n```bash\nPYTHONPATH=. python run_tests.py\n```\n\n**What it does**: Runs the complete test suite with coverage reporting.\n\n#### Run Only Unit Tests\n\n```bash\nPYTHONPATH=. python run_tests.py unit\n```\n\n**What it does**: Runs only unit tests for faster feedback during development.\n\n#### Run Only Integration Tests\n\n```bash\nPYTHONPATH=. python run_tests.py integration\n```\n\n**What it does**: Runs only integration tests to verify API endpoints and service interactions.\n\n#### Run Tests with Pytest Directly\n\n```bash\nPYTHONPATH=. pytest tests/ -v\n```\n\n**What it does**: Runs all tests with verbose output using pytest directly.\n\n#### Run Tests with Coverage Reports\n\n```bash\nPYTHONPATH=. pytest tests/ -v --cov=src --cov-report=term-missing --cov-report=html:htmlcov\n```\n\n**What it does**: Runs tests with detailed coverage reporting in terminal and HTML format.\n\n### Test Structure\n\n- **Unit Tests** (`tests/unit/`): Test individual functions and classes\n- **Integration Tests** (`tests/integration/`): Test API endpoints and service interactions\n- **Fixtures** (`tests/conftest.py`): Shared test data and mocks\n\n### Coverage Reports\n\nAfter running tests, coverage reports are generated in:\n\n- `htmlcov/`: HTML coverage report\n- `coverage.xml`: XML coverage report for CI tools\n\n## ☕️ Did you like the project?\n\nYou can collaborate with me giving a star ⭐️ to the project or\n\n[![\"Buy Me A Coffee\"](https://www.buymeacoffee.com/assets/img/custom_images/orange_img.png)](https://www.buymeacoffee.com/joacod)\n\nThanks! 😃\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjoacod%2Flawrence","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjoacod%2Flawrence","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjoacod%2Flawrence/lists"}