{"id":23174156,"url":"https://github.com/dhth/usersnack-test-case","last_synced_at":"2025-10-08T17:54:42.688Z","repository":{"id":46846582,"uuid":"261038433","full_name":"dhth/usersnack-test-case","owner":"dhth","description":null,"archived":false,"fork":false,"pushed_at":"2021-09-22T18:58:39.000Z","size":672,"stargazers_count":1,"open_issues_count":2,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-02-10T08:51:26.675Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"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/dhth.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}},"created_at":"2020-05-03T23:11:45.000Z","updated_at":"2023-03-09T00:14:45.000Z","dependencies_parsed_at":"2022-08-21T04:10:34.386Z","dependency_job_id":null,"html_url":"https://github.com/dhth/usersnack-test-case","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dhth%2Fusersnack-test-case","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dhth%2Fusersnack-test-case/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dhth%2Fusersnack-test-case/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dhth%2Fusersnack-test-case/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/dhth","download_url":"https://codeload.github.com/dhth/usersnack-test-case/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247268468,"owners_count":20911143,"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":[],"created_at":"2024-12-18T05:19:27.583Z","updated_at":"2025-10-08T17:54:37.643Z","avatar_url":"https://github.com/dhth.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Usersnack\n\n## Tech Stack\n\n- **Django**: Backend\n- **Django Rest Framework**: addons for Django\n- **Postgres**: Database\n\n## Other tools\n- **Pytest**: testing framework\n- **Flake8**: Linter\n- **Black**: Formatter\n\n## Live app\nA live version of the service is running on Heroku here: [https://evening-scrubland-88960.herokuapp.com](https://evening-scrubland-88960.herokuapp.com/api/pizzas/). It might take a few seconds for the service to spin up after a period of inactivity.\n## Local setup\n\n- Change permissions on entrypoint.sh\n    ```bash\n    chmod +x backend/app/entrypoint.sh\n    ```\n- Run containers\n    ```\n    docker-compose up -d\n    ```\n\n## Endpoints\n\n- `/api/pizzas/`\n    \n    This endpoint is supposed to provide data for the Pizza list view.\n\n    ![](/imgs/pizza-list.png)\n\n    ```curl\n    curl --location --request GET 'http://127.0.0.1:8000/api/pizzas/'\n    ```\n- `/api/extras/`\n    \n    This endpoint is supposed to provide data for the extra dropdowns.\n\n    ![](/imgs/extra-dropdown.png)\n\n    ```curl\n    curl --location --request GET 'http://127.0.0.1:8000/api/extras/'\n    ```\n\n- `/api/createorder/`\n    \n    This endpoint is for creating a new order.\n\n    ```curl\n    curl --location --request POST 'http://127.0.0.1:8000/api/createorder/' \\\n    --header 'Content-Type: application/json' \\\n    --data-raw '{\n        \"base_pizza\": 1,\n        \"extras\": [\n            {\n                \"extra\": 15,\n                \"quantity\": 1\n            },\n            {\n                \"extra\": 16,\n                \"quantity\": 5\n            }\n        ],\n        \"user_name\": \"Dhruv\",\n        \"user_address\": \"Wien\"\n    }'\n    ```\n\n- `/api/orders/\u003cid\u003e/`\n    \n    This endpoint returns the details of a specific order, including component items, and total price.\n\n    ```curl\n    curl --location --request GET 'http://127.0.0.1:8000/api/orders/1'\n    ```\n\n- `/api/orders/`\n    \n    This endpoint returns all orders.\n\n    ```curl\n    curl --location --request GET 'http://127.0.0.1:8000/api/orders/'\n    ```\n\n## Postman\n\nPostman collection containing the above requests can be found under the [postman](postman) directory.\n\n\n## Tests\n\n```\ndocker-compose exec backend pytest tests\n```\n\n## To Do\n\n- Add Swagger documentation using [drf-yasg](https://github.com/axnsan12/drf-yasg).\n- Change `item_type` (in table `FoodItem`) to a relationship instead of CharField. (done to save time).","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdhth%2Fusersnack-test-case","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdhth%2Fusersnack-test-case","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdhth%2Fusersnack-test-case/lists"}