{"id":23077040,"url":"https://github.com/prodbygodfather/coffee-shop-api","last_synced_at":"2026-02-25T19:34:14.948Z","repository":{"id":268125127,"uuid":"903392783","full_name":"ProdByGodfather/coffee-shop-api","owner":"ProdByGodfather","description":"Backend of a simple coffee shop application (shopping cart, user and cafe model) with fastapi and AbarORM technologies","archived":false,"fork":false,"pushed_at":"2025-01-12T06:48:55.000Z","size":37,"stargazers_count":1,"open_issues_count":0,"forks_count":1,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-10-28T09:44:38.426Z","etag":null,"topics":["abarorm","fastapi","jwt-authentication"],"latest_commit_sha":null,"homepage":"https://coffee-shop-api-1.onrender.com/docs","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/ProdByGodfather.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":"2024-12-14T13:44:36.000Z","updated_at":"2025-04-08T11:05:09.000Z","dependencies_parsed_at":"2025-04-30T10:42:27.973Z","dependency_job_id":"5dfe71af-3aac-46a4-b21a-d54b479e560e","html_url":"https://github.com/ProdByGodfather/coffee-shop-api","commit_stats":null,"previous_names":["prodbygodfather/coffee-shop-api"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/ProdByGodfather/coffee-shop-api","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ProdByGodfather%2Fcoffee-shop-api","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ProdByGodfather%2Fcoffee-shop-api/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ProdByGodfather%2Fcoffee-shop-api/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ProdByGodfather%2Fcoffee-shop-api/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ProdByGodfather","download_url":"https://codeload.github.com/ProdByGodfather/coffee-shop-api/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ProdByGodfather%2Fcoffee-shop-api/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29836310,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-25T19:08:47.527Z","status":"ssl_error","status_checked_at":"2026-02-25T18:59:04.705Z","response_time":61,"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":["abarorm","fastapi","jwt-authentication"],"created_at":"2024-12-16T10:00:13.567Z","updated_at":"2026-02-25T19:34:14.917Z","avatar_url":"https://github.com/ProdByGodfather.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Coffee Shop Backend Project\n\nThis is a **FastAPI** project that serves as the backend for a coffee shop application. The project includes account management, token-based authentication using **JWT**, and CRUD operations for coffee and cart management. The [**AbarORM**](https://prodbygodfather.github.io/abarorm/) library is used as the ORM with **SQLite** as the database.\n\nThis project has only educational and evaluation value and probably does not work as a powerful and complete project.\n\n---\n\n\n## Features\n\n### Authentication and Authorization\n- **JWT Token-based Authentication**:\n  - Login and register functionality for users.\n  - Token creation for secure access to protected endpoints.\n- **Access Levels**:\n  - **Superuser**: Can create, update, and delete coffee items.\n  - **Regular User**: Can browse coffee items and add them to their cart.\n\n### Coffee Management\n- CRUD operations for coffee items:\n  - **Create**: Superusers can add new coffee items.\n  - **Read**: All users can view the list of available coffee items.\n  - **Update**: Superusers can edit existing coffee items.\n  - **Delete**: Superusers can remove coffee items.\n\n### Cart Management\n- Users can add coffee items to their cart.\n- Users can view and manage items in their cart.\n\n### Database\n- **SQLite** as the database.\n- **AbarORM** for ORM functionality, simplifying database operations.\n\n---\n\n## Setup and Installation\n\n### Prerequisites\n- Python 3.8 or higher\n\n### Installation Steps\n1. Clone the repository:\n   ```bash\n   git clone git@github.com:ProdByGodfather/coffee-shop-api.git\n   cd coffee-shop-api\n   ```\n\n2. Create a virtual environment and activate it:\n   ```bash\n   python -m venv .venv\n   source .venv/bin/activate   # On Windows: .venv\\Scripts\\activate\n   ```\n\n3. Install the required dependencies:\n   ```bash\n   pip install -r requirements.txt\n   ```\n\n4. Start the FastAPI server:\n   ```bash\n   python main.py\n   ```\n\n5. Open your browser and navigate to:\n   - **API Documentation**: [http://127.0.0.1:8765/docs](http://127.0.0.1:8000/docs)\n   - **ReDoc Documentation**: [http://127.0.0.1:8765/redoc](http://127.0.0.1:8000/redoc)\n\n---\n\n\n## Environment Variables\n\nThe following environment variables can be configured in a `.env` file:\n\n| Variable       | Description                | Default Value |\n|----------------|----------------------------|---------------|\n| `UPLOAD_DIR`   | Upload Folder for images   | `uploads`     |\n| `USERNAME`     | Default Superuser Username | `godfather`   |\n| `PASSWORD`     | Default Superuser Password | `123`         |\n| `DB_NAME`      | Database Name              | `coffee.db`   |\n| `HOST`         | Project executive host     | `localhost`   |\n| `DB_PATH`      | Project executive port     | `8765`        |\n\n---\n\n## Dependencies\n\nThe project relies on the following libraries:\n- **FastAPI**: Web framework for building APIs.\n- **AbarORM**: ORM for database management.\n- **SQLite**: Lightweight database solution.\n- **Pydantic**: Data validation and settings management.\n\nInstall all dependencies using the `requirements.txt` file.\n\n---\n\n## Project Structure\n\n```\n.\n├── account\n│   ├── models.py        # Database models for account management\n│   ├── schemas.py       # Pydantic schemas for account-related data validation\n│   └── views.py         # Account-related API endpoints\n├── cart\n│   ├── models.py        # Database models for the cart\n│   ├── schemas.py       # Pydantic schemas for cart-related data validation\n│   └── views.py         # Cart-related API endpoints\n├── coffee\n│   ├── models.py        # Database models for coffee items\n│   ├── schemas.py       # Pydantic schemas for coffee-related data validation\n│   └── views.py         # Coffee-related API endpoints\n├── coffee.db            # SQLite database file\n├── config\n│   ├── db.py            # Database configuration\n│   ├── events.py        # Application event handlers (e.g., startup/shutdown)\n│   ├── settings.py      # Application settings and configurations\n│   └── urls.py          # URL routing for the project\n├── extensions\n│   └── password_hasher.py  # Utility for hashing passwords\n├── main.py              # Main entry point of the application\n├── requirements.txt     # Python dependencies\n├── token_config\n│   ├── config.py        # JWT configuration\n│   ├── creator.py       # JWT token creation utilities\n│   ├── urls.py          # URL routing for token-related endpoints\n│   └── views/main.py    # Token-related API endpoints\n└── uploads              # Directory for image uploads\n```\n\n---\n\n## License\n\nThis project is licensed under the MIT License. See the LICENSE file for details.\n\n---\n\n## Contributing\n\nContributions are welcome! Feel free to submit a pull request or open an issue to discuss changes.\n\n---\n\n## Author\n\n[**Dokey (دکتر)**](https://github.com/ProdByGodfather/)\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fprodbygodfather%2Fcoffee-shop-api","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fprodbygodfather%2Fcoffee-shop-api","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fprodbygodfather%2Fcoffee-shop-api/lists"}