{"id":24978599,"url":"https://github.com/sakhileln/e-commerce-api","last_synced_at":"2026-04-12T13:51:49.717Z","repository":{"id":275477689,"uuid":"926180804","full_name":"sakhileln/e-commerce-api","owner":"sakhileln","description":"A RESTful API for an e-commerce platform built with FastAPI. 💨🗲","archived":false,"fork":false,"pushed_at":"2025-03-03T22:15:34.000Z","size":843,"stargazers_count":0,"open_issues_count":31,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-03-03T23:24:12.185Z","etag":null,"topics":["docker","fastapi","github-actions","jwt","jwt-authentication","poetry","postgresql","pytest"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/sakhileln.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":"SECURITY.md","support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2025-02-02T18:34:27.000Z","updated_at":"2025-03-03T22:15:29.000Z","dependencies_parsed_at":"2025-02-02T20:19:06.267Z","dependency_job_id":"87858ab2-5396-4820-ab4d-f0963491f3d1","html_url":"https://github.com/sakhileln/e-commerce-api","commit_stats":null,"previous_names":["sakhileln/e-commerce-api"],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sakhileln%2Fe-commerce-api","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sakhileln%2Fe-commerce-api/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sakhileln%2Fe-commerce-api/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sakhileln%2Fe-commerce-api/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/sakhileln","download_url":"https://codeload.github.com/sakhileln/e-commerce-api/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":246164287,"owners_count":20733770,"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":["docker","fastapi","github-actions","jwt","jwt-authentication","poetry","postgresql","pytest"],"created_at":"2025-02-04T00:00:00.705Z","updated_at":"2026-04-12T13:51:49.711Z","avatar_url":"https://github.com/sakhileln.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# e-commerce api\nA RESTful API for an e-commerce platform built with [FastAPI](https://fastapi.tiangolo.com/) and [PostgreSQL](https://www.postgresql.org/). This project provides endpoints for user authentication, product catalog management, order processing, and more.\n\n## Table of Contents\n- [Features](#features)\n- [Architecture](#architecture)\n- [Prerequisites](#prerequisites)\n- [Installation](#installation)\n- [Usage](#usage)\n- [API Documentation](#api-documentation)\n- [Development](#development)\n- [Deployment](#deployment)\n- [Testing](#testing)\n- [Contributing](#contributing)\n- [License](#license)\n\n## Features\n- **User Authentication:** Secure signup, login, and JWT-based authorization with role-based access.\n- **Product Catalog:** CRUD endpoints for managing products, categories, and media uploads.\n- **Order Processing:** Endpoints for placing orders, managing carts, and integrating with payment gateways.\n- **Inventory \u0026 Shipping:** Inventory tracking and shipping calculation (with external API integration).\n- **Customer Engagement:** Product reviews, ratings, wishlists, and user order history.\n- **Deployment Ready:** Dockerized application with CI/CD integration for smooth deployments.\n- **Monitoring \u0026 Performance:** Basic logging and monitoring setup.\n\n## Architecture\n- **Backend Framework:** FastAPI  \n- **Database:** PostgreSQL  \n- **Authentication:** JWT (JSON Web Tokens)  \n- **Containerization:** Docker \u0026 docker-compose  \n- **CI/CD:** GitHub Actions for automated testing and deployment  \n\n## Prerequisites\nBefore running the application, ensure you have the following installed:\n- Python 3.8+\n- [PostgreSQL](https://www.postgresql.org/) (or Docker for running a PostgreSQL container)\n- [Docker](https://www.docker.com/) (optional, for containerization)\n- [Git](https://git-scm.com/)\n\n## Installation\n1. **Clone the Repository:**\n   ```bash\n   git clone https://github.com/sakhileln/e-commerce-api.git\n   cd e-commerce-api\n   ```\n2. **Set Up a Virtual Environment \u0026 Install Dependencies:**\n    Using `pip`:\n    ```bash\n    python -m venv venv\n    source venv/bin/activate  # On Windows use: venv\\Scripts\\activate\n    pip install --upgrade pip\n    pip install -r requirements.txt\n    ```\n - **Or using [Poetry](https://python-poetry.org/):**\n    ```bash\n    poetry install --no-root\n    ```\n3. **Configure Environment Variables:**\n    - Create a `.env` file at the project root with the following variables (adjust as needed):\n       ```bash\n       DATABASE_URL=postgresql://username:password@localhost:5432/ecommercedb\n       SECRET_KEY=your-secret-key\n       ALGORITHM=HS256\n       ACCESS_TOKEN_EXPIRE_MINUTES=30\n       ```\n4. **Database Setup:**\n    - If using a local PostgreSQL instance, create a new database (e.g., `ecommercedb`). If using Docker, see the Deployment section.\n\n## Usage\n1. **Run the Application:**\n    With Uvicorn, you can run the app as follows:\n    ```bash\n    uvicorn app.main:app --reload\n    ```\n    This will start the server on `http://127.0.0.1:8000`.\n2. **Access API Documentation:**\n    - FastAPI automatically generates interactive API documentation at:\n        - Swagger UI: `http://127.0.0.1:8000/docs`.\n        - Redoc: `http://127.0.0.1:8000/redoc`.\n\n## API Documentation\nAll endpoints are documented using the OpenAPI standard. Visit `/docs` or `/redoc` for detailed API documentation and interactive testing.\n\n## Development\n- Project Structure:\n    ```bash\n    e-commerce-api/\n    ├── app/\n    │   ├── main.py              # Entry point of the FastAPI application\n    │   ├── models/              # Database models (SQLAlchemy or similar ORM)\n    │   ├── schemas/             # Pydantic models for request and response bodies\n    │   ├── routes/              # API route definitions (auth, products, orders, etc.)\n    │   ├── core/                # Configuration, security, and utility functions\n    │   └── db/                  # Database connection and migrations\n    ├── tests/                   # Unit and integration tests\n    ├── .env                     # Environment variables\n    ├── requirements.txt         # Python dependencies (or pyproject.toml if using Poetry)\n    ├── Dockerfile               # Container configuration\n    ├── docker-compose.yml       # Multi-container setup (FastAPI + PostgreSQL)\n    └── README.md                # Project documentation\n    ```\n- **Running Tests:**\nTo run tests, use `pytest`:\n    ```bash\n    pytest\n    ```\n## Deployment\n- **Docker Deployment**\n    1. Build the Docker Image:\n       ```bash\n       docker build -t ecommerce-api .\n       ```\n    2. Run with Docker Compose:\n       - If a `docker-compose.yml` file is provided:\n          ```bash\n          docker-compose up --build\n          ```\n          This will start the FastAPI application and a PostgreSQL container.\n    3. Cloud Deployment:\n       - Configure your CI/CD pipeline (e.g., GitHub Actions) to build and deploy your Docker containers to your preferred cloud provider (AWS, GCP, DigitalOcean, etc.).\n\n## Testing\n\n## Contributing\nContributions are welcome! If you'd like to contribute. See the [CONTRIBUTING](CONTRIBUTING.md) file for details.\n1. Fork the repository.\n2. Create a new branch for your feature/bug fix:\n   ```bash\n   git checkout -b feature/YourFeature\n   ```\n3. Make your changes and test thoroughly.\n4. Submit a pull request explaining your changes.\n\n## License\nThis project is licensed under the `GNU GPL v3.0 License`. See the [LICENSE](LICENSE) file for details.\n\n## Acknowledgments\n- [Database schema design 101 for relational databases](https://planetscale.com/blog/schema-design-101-relational-databases)\n- [Security - First Steps](https://fastapi.tiangolo.com/tutorial/security/first-steps/)\n- [Get Current User](https://fastapi.tiangolo.com/tutorial/security/get-current-user/)\n- [Simple OAuth2 with Password and Bearer](https://fastapi.tiangolo.com/tutorial/security/simple-oauth2/)\n- [OAuth2 with Password (and hashing), Bearer with JWT tokens](https://fastapi.tiangolo.com/tutorial/security/oauth2-jwt/)\n- \n\n## Contact\nIf you have any questions or suggestions, feel free to open an issue in this repository or contact us directly.\n- Sakhile III  \n- [LinkedIn Profile](https://www.linkedin.com/in/sakhile-ndlazi)\n- [GitHub Profile](https://github.com/sakhileln)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsakhileln%2Fe-commerce-api","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsakhileln%2Fe-commerce-api","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsakhileln%2Fe-commerce-api/lists"}