{"id":40517759,"url":"https://github.com/xbt-a4224j/invoice-manager","last_synced_at":"2026-01-20T20:38:05.631Z","repository":{"id":329604095,"uuid":"1119395727","full_name":"xbt-a4224j/invoice-manager","owner":"xbt-a4224j","description":"A simple invoice management system with inventory tracking\\","archived":false,"fork":false,"pushed_at":"2025-12-20T17:10:54.000Z","size":25,"stargazers_count":0,"open_issues_count":1,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-12-22T18:42:36.613Z","etag":null,"topics":["demo","ecommerce-application","etl","fastapi","python","streamlit"],"latest_commit_sha":null,"homepage":"","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/xbt-a4224j.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,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2025-12-19T07:53:48.000Z","updated_at":"2025-12-20T17:10:58.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/xbt-a4224j/invoice-manager","commit_stats":null,"previous_names":["xbt-a4224j/invoicedemo_dec19"],"tags_count":null,"template":false,"template_full_name":null,"purl":"pkg:github/xbt-a4224j/invoice-manager","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/xbt-a4224j%2Finvoice-manager","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/xbt-a4224j%2Finvoice-manager/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/xbt-a4224j%2Finvoice-manager/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/xbt-a4224j%2Finvoice-manager/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/xbt-a4224j","download_url":"https://codeload.github.com/xbt-a4224j/invoice-manager/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/xbt-a4224j%2Finvoice-manager/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28613313,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-20T18:56:40.769Z","status":"ssl_error","status_checked_at":"2026-01-20T18:54:26.653Z","response_time":117,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5: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":["demo","ecommerce-application","etl","fastapi","python","streamlit"],"created_at":"2026-01-20T20:38:05.575Z","updated_at":"2026-01-20T20:38:05.621Z","avatar_url":"https://github.com/xbt-a4224j.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Invoice Demo API\n\nA simple invoice management system with inventory tracking, built with FastAPI and Streamlit.\n\n\u003cimg width=\"1420\" height=\"505\" alt=\"Screenshot 2025-12-20 at 11 38 20 AM\" src=\"https://github.com/user-attachments/assets/7800c00a-9634-4238-8f22-fc2b9097a96e\" /\u003e\n\n\n-----\n\n\n\u003cimg width=\"1237\" height=\"710\" alt=\"Screenshot 2025-12-20 at 11 38 50 AM\" src=\"https://github.com/user-attachments/assets/1a27c75e-158a-448c-aefe-dc1c96b2140f\" /\u003e\n\n\n---\n\n## 🚀 Quick Start\n\n### 1. Install Dependencies\n```bash\npip install -r requirements.txt\n```\n\n### 2. Start the API Server\n```bash\nuvicorn app.main:app --reload\n```\nServer runs at: **http://localhost:8000**\n\n### 3. Access the UI\n\n**Option A: Streamlit UI (Recommended)**\n```bash\nstreamlit run ui.py\n```\nOpen browser to: **http://localhost:8501** or **http://localhost:8502**\n\n**Option B: Swagger UI (API Documentation)**\n\nOpen browser to: **http://localhost:8000/docs**\n\nInteractive API documentation with request/response examples and try-it-out functionality.\n\n---\n\n## Features\n\n- **Invoice Management**: Create draft invoices, add items, and finalize\n- **Inventory Tracking**: Automatic inventory decrement on invoice finalization\n- **Validation**: Prevents modifications to finalized invoices and insufficient inventory checks\n- **Admin Tools**: Database seeding and clearing via UI sidebar\n\n## Tech Stack\n\n- **Backend**: FastAPI, SQLAlchemy\n- **Frontend**: Streamlit\n- **Database**: SQLite (embedded, no separate service needed)\n\n## API Endpoints\n\n### Invoices\n- `POST /invoices` - Create new invoice\n- `GET /invoices` - List all invoices\n- `GET /invoices/{id}` - Get invoice with items\n- `POST /invoices/{id}/items` - Add item to invoice\n- `POST /invoices/{id}/finalize` - Finalize invoice (decrements inventory)\n\n### Inventory\n- `GET /inventory` - List inventory items\n- `POST /inventory` - Add inventory item\n\n### Admin\n- `POST /admin/clear-database` - Clear all data\n- `POST /admin/seed-database` - Load sample data\n\n## Project Structure\n\n```\n.\n├── app/\n│   ├── main.py          # FastAPI app and route handlers\n│   ├── models.py        # SQLAlchemy ORM models\n│   ├── schemas.py       # Pydantic request/response schemas\n│   ├── services.py      # Business logic layer\n│   └── db.py            # Database configuration\n├── migrations/\n│   ├── 001_init.sql     # Initial schema\n│   └── 002_seed.sql     # Sample data\n├── tests/\n│   └── test_api.py      # Integration tests\n├── ui.py                # Streamlit frontend\n└── invoice_demo.db      # SQLite database (auto-created)\n```\n\n## Database\n\nSQLite database is automatically created as `invoice_demo.db` on first run.\n\n### Seed Sample Data\n\nUse the Streamlit UI sidebar buttons:\n- **Clear**: Remove all data\n- **Seed**: Load sample inventory and invoices\n\nOr use API endpoints:\n```bash\ncurl -X POST http://localhost:8000/admin/seed-database\n```\n\n### Reset Database\n\n```bash\nrm invoice_demo.db\n# Restart the app to recreate it\n```\n\n## Testing\n\nRun integration tests:\n```bash\npytest tests/test_api.py -v\n```\n\n## Development\n\nThe API server runs with `--reload` flag, automatically restarting on code changes.\n\nCORS is configured to allow requests from:\n- http://localhost:8501 (Streamlit default)\n- http://localhost:8502 (Streamlit alternate)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fxbt-a4224j%2Finvoice-manager","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fxbt-a4224j%2Finvoice-manager","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fxbt-a4224j%2Finvoice-manager/lists"}