{"id":28497862,"url":"https://github.com/degisew/commerce_cart","last_synced_at":"2026-04-04T21:32:21.267Z","repository":{"id":295996435,"uuid":"990652604","full_name":"degisew/commerce_cart","owner":"degisew","description":"A simple shopping cart application built with Django. It allows users to view their cart, adjust quantities and total price dynamically, place an order if stock is available, see order history, and manage inventory via Django Admin.","archived":false,"fork":false,"pushed_at":"2025-05-28T12:36:11.000Z","size":83,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"development","last_synced_at":"2025-07-03T13:50:36.495Z","etag":null,"topics":["bootstrap5","css3","django","docker","docker-compose","html5","javascript","python3"],"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/degisew.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-05-26T12:36:21.000Z","updated_at":"2025-05-28T12:39:27.000Z","dependencies_parsed_at":"2025-05-28T13:35:55.325Z","dependency_job_id":"5165daad-239c-4b23-bf2e-99f54c021903","html_url":"https://github.com/degisew/commerce_cart","commit_stats":null,"previous_names":["degisew/commerce_cart"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/degisew/commerce_cart","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/degisew%2Fcommerce_cart","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/degisew%2Fcommerce_cart/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/degisew%2Fcommerce_cart/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/degisew%2Fcommerce_cart/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/degisew","download_url":"https://codeload.github.com/degisew/commerce_cart/tar.gz/refs/heads/development","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/degisew%2Fcommerce_cart/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31415110,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-04T20:09:54.854Z","status":"ssl_error","status_checked_at":"2026-04-04T20:09:44.350Z","response_time":60,"last_error":"SSL_read: 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":["bootstrap5","css3","django","docker","docker-compose","html5","javascript","python3"],"created_at":"2025-06-08T13:06:51.613Z","updated_at":"2026-04-04T21:32:21.255Z","avatar_url":"https://github.com/degisew.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# commerce_cart\n\nA simple shopping cart application built with Django. It allows users to view their cart, adjust quantities and total price dynamically, place an order if stock is available, see order history, and manage inventory via Django Admin.\n\n## Prerequisites\n\nEnsure the following tools are installed on your machine before proceeding:\n\n- [Docker](https://www.docker.com/)\n- [Docker Compose](https://docs.docker.com/compose/)\n- [Git](https://git-scm.com/)\n\n## Getting Started\n\nFollow these instructions to get the project up and running on your local machine.\n\n### 1. Clone the Repository\n\n```bash\ngit clone git@github.com:degisew/commerce_cart.git\ncd commerce_cart\n```\n\n### 2. Create a `.env` File\n\nCreate a `.env` file in the `root` of your project directory. This file will contain environment variables for the database and pgAdmin4. Here's an example `.env` file:\n\n```bash\n# pgAdmin4\nPGADMIN_DEFAULT_EMAIL=admin@example.com\nPGADMIN_DEFAULT_PASSWORD=\u003cyour-pgadmin-password\u003e\n```\n\nMake sure to replace `\u003cyour-pgadmin-password\u003e` with strong, secure values.\n\n### 3. Build and Run the Containers\n\nUse Docker Compose to build and spin up the containers:\n\n```bash\ndocker compose up --build\n```\n\nThis command will build and run the containers for:\n\n- **PostgreSQL** (as the database backend)\n- **pgAdmin4** (to manage the PostgreSQL database)\n- **Django application** (the API server)\n\n### 4. Apply Migrations\n\nRun the following command to apply database migrations.\n\n```bash\ndocker compose exec api python manage.py migrate\n```\n\n### 5. Seed Lookup, and Product data from fixtures\n\nFor easy test, I've prepared seed data inside each apps in fixtures folder. Run the following to populate the Database.\n\n```bash\ndocker compose exec api python manage.py loaddata lookup.json # to populate lookup table\n\ndocker compose exec api python manage.py loaddata products.json # to populate product table\n```\n\n### 6. Access the Services\n\n- **Django API**: Open your browser and navigate to [http://localhost:8000](http://localhost:8000) to access the Django API.\n\n- **pgAdmin4**: Go to [http://localhost:8001](http://localhost:8001) to access pgAdmin4. Use the credentials from your `.env` file to log in.\n\n  - **Email**: `PGADMIN_DEFAULT_EMAIL` from the `.env` file (e.g., `admin@example.com`)\n  - **Password**: `PGADMIN_DEFAULT_PASSWORD` from the `.env` file\n\n### 7. Run Tests\n\nTest is configured with pytest and to see, run the following command in your terminal.\n\n```bash\ndocker compose exec api pytest\n```\n\n### 8. Managing PostgreSQL in pgAdmin\n\nOnce you're logged in to pgAdmin4, follow these steps to add the PostgreSQL server:\n\n1. Click on \"Add New Server\".\n2. Under the **General** tab, set a name for the server (e.g., `commerce_cart DB`).\n3. Under the **Connection** tab, enter the following details:\n   - **Host**: `db` (this is the service name defined in the `docker-compose.yml` file)\n   - **Port**: `5432`\n   - **Username**: `POSTGRES_USER` from the `.env` file (e.g., `XgkJUcqxEw`)\n   - **Password**: `POSTGRES_PASSWORD` from the `.env` file\n\nClick **Save** to add the server, and you should now be able to manage the `commerce_cart` database from pgAdmin.\n\n## Project Structure\n\n```bash\n├── commerce_cart/        # Project Folder\n├── config/               # Project Configurations\n│     └── settings/       # Project settings for dev,test, and prod environment\n├── docker\n│     └── dev/\n│          └── Dockerfile # Django API Dockerfile for development environment\n├── docs/                 # Documentation files\n├── .env                  # Environment variables (you will create this)\n├── compose.yaml          # Docker Compose configuration file\n└── README.md             # This README file\n```\n\n## Useful Docker Commands\n\nHere are some helpful commands to manage the Docker environment:\n\n- **Stop all running containers**:\n\n  ```bash\n  docker-compose down\n  ```\n\n- **Rebuild and restart containers**:\n\n  ```bash\n  docker-compose up --build\n  ```\n\n- **Check logs for a specific service**:\n\n  ```bash\n  docker-compose logs \u003cservice-name\u003e\n  ```\n\n  For example:\n\n  ```bash\n  docker-compose logs api\n  ```\n\n- **Access a running container**:\n\n  ```bash\n  docker exec -it \u003ccontainer_name\u003e /bin/bash\n  ```\n\n  For example, to access the Django API container:\n\n  ```bash\n  docker exec -it \u003capi-container-name\u003e /bin/bash\n  ```\n\n## Troubleshooting\n\n- **Django server not reachable**: Ensure the Django app is running on `0.0.0.0` and bound to port 8000 (this is handled by the Docker setup).\n- **Database connection errors**: Verify that the database credentials in the `.env` file are correct, and that the PostgreSQL service is up and healthy.\n\n## Volumes\n\nThe `docker-compose.yml` file defines two Docker volumes:\n\n- `commerce_cart_dev_db_data`: Stores the PostgreSQL database data.\n- `commerce_cart_dev_pgadmin_data`: Stores pgAdmin4 configuration data.\n\nThese volumes ensure that your data persists across container restarts.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdegisew%2Fcommerce_cart","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdegisew%2Fcommerce_cart","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdegisew%2Fcommerce_cart/lists"}