{"id":23551672,"url":"https://github.com/utkarsh1504/fd-rest-api","last_synced_at":"2025-05-15T15:32:07.626Z","repository":{"id":230443456,"uuid":"779382233","full_name":"Utkarsh1504/fd-rest-api","owner":"Utkarsh1504","description":null,"archived":false,"fork":false,"pushed_at":"2024-03-29T18:56:00.000Z","size":30,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-02-17T12:18:04.889Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"TypeScript","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/Utkarsh1504.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}},"created_at":"2024-03-29T17:53:40.000Z","updated_at":"2024-03-29T17:56:12.000Z","dependencies_parsed_at":"2024-03-29T19:30:58.239Z","dependency_job_id":"80b7bb8a-351c-4cdc-be9e-b3dbb80d2071","html_url":"https://github.com/Utkarsh1504/fd-rest-api","commit_stats":null,"previous_names":["utkarsh1504/fd-rest-api"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Utkarsh1504%2Ffd-rest-api","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Utkarsh1504%2Ffd-rest-api/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Utkarsh1504%2Ffd-rest-api/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Utkarsh1504%2Ffd-rest-api/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Utkarsh1504","download_url":"https://codeload.github.com/Utkarsh1504/fd-rest-api/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254367600,"owners_count":22059538,"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-26T10:27:28.507Z","updated_at":"2025-05-15T15:32:07.519Z","avatar_url":"https://github.com/Utkarsh1504.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"\n# Food Delivery Backend REST API\n\n**NOTE:**  The API is deployed at [https://fd-rest-api.onrender.com/](https://fd-rest-api.onrender.com/)\n\n\n## Features Implemented:\n\n- Prisma ORM, PostgreSQL for database\n- Dynamic pricing module for calculating delivery costs.\n- REST API endpoints for dynamic pricing calculations.\n- Input validation using zod.\n- Used dummy data for testing using the seed.ts (for seeding)\n\n\n## Getting Started\n\n### Prerequisites\n\n- [Node.js](https://nodejs.org/en/download) (version 20.x or later recommended)\n- [PostgreSQL](https://www.postgresql.org/download/) (version 16.x or later recommended)\n- npm (included with Node.js)\n\n### Installation\n\n1. Clone the repository:\n   \n   ```bash\n   git clone https://github.com/Utkarsh1504/fd-rest-api\n   cd fd-rest-api\n   ```\n\n2. Install dependencies:\n   \n   ```bash\n   npm install\n   ```\n\n3. Set up the database:\n    - Create a PostgreSQL database. (render or neon)\n    - Create `.env` file \n    - Add the PostgreSQL URL in the `.env` file as `DATABASE_URL=`\n\n4. Run the server:\n   ```bash\n   npm run dev\n   ```\n\n## API Documentation\n\nThe API endpoints for calculating delivery costs are documented below:\n\n### Calculate Delivery Cost\n\n- **POST /api/calculate-price**\n- **Body**:\n  ```json\n  {\n    \"zone\": \"central\",\n    \"organization_id\": \"5\",\n    \"total_distance\": 12,\n    \"item_type\": \"perishable\"\n  }\n  ```\n- **Response**:\n  ```json\n  {\n    \"total_price\": 20.5\n  }\n  ```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Futkarsh1504%2Ffd-rest-api","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Futkarsh1504%2Ffd-rest-api","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Futkarsh1504%2Ffd-rest-api/lists"}