{"id":16550142,"url":"https://github.com/renanmav/backend-delivery","last_synced_at":"2025-03-04T15:25:46.692Z","repository":{"id":154080872,"uuid":"190603623","full_name":"renanmav/backend-delivery","owner":"renanmav","description":"REST API for pizza delivery built with NodeJS and AdonisJS","archived":false,"fork":false,"pushed_at":"2019-06-20T01:18:17.000Z","size":393,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-01-14T19:16:50.894Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"JavaScript","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/renanmav.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}},"created_at":"2019-06-06T15:17:58.000Z","updated_at":"2020-04-12T21:05:25.000Z","dependencies_parsed_at":null,"dependency_job_id":"db5ff900-dea9-45da-84b6-d7ea734c0875","html_url":"https://github.com/renanmav/backend-delivery","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/renanmav%2Fbackend-delivery","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/renanmav%2Fbackend-delivery/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/renanmav%2Fbackend-delivery/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/renanmav%2Fbackend-delivery/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/renanmav","download_url":"https://codeload.github.com/renanmav/backend-delivery/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":241870413,"owners_count":20034273,"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-10-11T19:33:03.800Z","updated_at":"2025-03-04T15:25:46.667Z","avatar_url":"https://github.com/renanmav.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Don Juan Pizza Delivery API\n\nThis is the REST API for the delivery app and website of Don Juan pizzeria.\n\n## Setup\n\nUse the `docker-compose` command to start containers.\n\n```bash\ndocker-compose up -d --build\n```\n\n## Entity Relationship Diagram\n\n![ERD](https://i.imgur.com/UUiLPtB.jpg)\n\n- **Size** is a strong entity since it labels the price\n- Only admin users can perform PUT and DELETE requests\n- Objects owners are mapped by `user_id` column\n\n## Some observations\n\n- `.env` pre-configurated, feel free to change it.\n- Route for upload (POST on `/files`) accepts either `id` or `name` query params.\n- Insomnia workspace is available [here](https://gist.githubusercontent.com/renanmav/d6612d258e9fa1a0d9a4568af5a92da3/raw/f9a947f3058b45b30abfcefcdb44db2b7a8b0b1e/insomnia-backend-pizza.json).\n\n## Routes\n\n| Route | Verb(s) | Middleware | Description |\n| ------------- | ------------- | ------------- | ------------- |\n| / | GET | - | Returns a JSON if the API is online |\n| /users | POST | val:User | Create a User |\n| /sessions | POST | - | Auth and returns a JWT token |\n| /sessions | GET | auth | Check the current user logged in |\n| /files | GET | - | Show a specific file |\n| /files | POST | val:File, auth, is_admin | Upload a file if it's image or pdf |\n| /types | GET | - | Index types of products |\n| /types/:id | GET | - | Show a specific type |\n| /types | POST | val:Type, auth, is_admin | Store a type in database |\n| /types/:id | PUT, PATCH | auth, is_admin | Update a specific type |\n| /types/:id | DELETE | auth, is_admin | Delete a specific type |\n| /types/:type_id/products | GET | - | Index all products of a specific type |\n| /products/:id | GET | - | Show a specific product |\n| /types/:type_id/products | POST | val:Product, auth, is_admin | Store a product related to an specific type in database |\n| /products/:id | PUT, PATCH | auth, is_admin | Update a specific product |\n| /products/:id | DELETE | auth, is_admin | Delete a specific product |\n| /products/:product_id/sizes | GET | - | Index all sizes of a specific product |\n| /size/:id | GET | - | Show a specific size |\n| /products/:product_id/sizes | POST | val:Size, auth, is_admin | Store a size related to an specific product in database |\n| /sizes/:id | PUT, PATCH | auth, is_admin | Update a specific size |\n| /sizes/:id | DELETE | auth, is_admin | Delete a specific size |\n| /users/orders | GET | auth | Index all orders of current user logged in |\n| /orders/:id | GET | auth | Show a specific order if belongs to current user logged in (if `is_admin=false`) |\n| /orders | GET | auth, is_admin | Index all orders |\n| /orders | POST | auth | Store a order related to an specific user in database |\n| /orders/:id | PUT, PATCH | auth, is_admin | Update a specific order |\n| /orders/:id | DELETE | auth, is_admin | Delete a specific order |\n\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frenanmav%2Fbackend-delivery","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Frenanmav%2Fbackend-delivery","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frenanmav%2Fbackend-delivery/lists"}