{"id":22737953,"url":"https://github.com/bojana-petroska/plated-server","last_synced_at":"2026-04-11T13:10:07.279Z","repository":{"id":258189682,"uuid":"864422347","full_name":"bojana-petroska/Plated-Server","owner":"bojana-petroska","description":"Plated-Server handles the backend operations for a food ordering platform, including restaurant management, user authentication, and order processing. The API enables users to browse menus, manage carts, and place orders, send and receive notifications through web-sockets.","archived":false,"fork":false,"pushed_at":"2025-03-05T08:29:57.000Z","size":6449,"stargazers_count":0,"open_issues_count":1,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-03-05T09:33:48.088Z","etag":null,"topics":["api-documentation","aws","docker","ecommerce","postgresql","rest-api","typeorm","web-sockets"],"latest_commit_sha":null,"homepage":"","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/bojana-petroska.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":"2024-09-28T07:11:38.000Z","updated_at":"2025-03-05T08:30:00.000Z","dependencies_parsed_at":"2024-11-26T08:22:57.658Z","dependency_job_id":"9499bc45-a96f-4f95-a918-9a6184cd7139","html_url":"https://github.com/bojana-petroska/Plated-Server","commit_stats":null,"previous_names":["bojana-petroska/plated-server"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bojana-petroska%2FPlated-Server","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bojana-petroska%2FPlated-Server/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bojana-petroska%2FPlated-Server/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bojana-petroska%2FPlated-Server/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/bojana-petroska","download_url":"https://codeload.github.com/bojana-petroska/Plated-Server/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":246270981,"owners_count":20750501,"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":["api-documentation","aws","docker","ecommerce","postgresql","rest-api","typeorm","web-sockets"],"created_at":"2024-12-10T22:18:45.836Z","updated_at":"2025-12-30T23:17:26.366Z","avatar_url":"https://github.com/bojana-petroska.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Food Ordering Online System\n\n## Overview\n\nThis is a **Food Ordering System** that enables users to order food from registered restaurants, track order statuses in real-time, and make payments. Restaurants can manage their menus and orders, while couriers can update delivery statuses. The app aims to streamline the food delivery experience using real-time updates via WebSockets.\n\nThis repository focuses on the **backend implementation** of the system, including the API development, business logic, and WebSocket integration.\n\n---\n\n## Features\n\n### User\n- **Registration \u0026 Login**: Users can create accounts and log in using email and password.\n- **Profile Management**: Users can update upload a profile image (made with S3 Bucket), update profile details such as address and phone number.\n- **Order History**: Users can view their past orders along with detailed status updates and re-order again.\n- **Notifications**: Real-time notifications for order status updates via WebSockets.\n\n### Restaurant\n- **Restaurant Registration**: Restaurants can register with required business details.\n- **Profile Management**: Restaurants can manage opening hours, delivery radius, and contact information.\n- **Menu Management**: Restaurants can add, update, and delete menu items.\n- **Order Management**: Restaurants can manage incoming orders and communicate with couriers in real-time via WebSockets.\n\n### Courier\n- **Courier Registration**: Couriers can register and update their availability for delivery assignments.\n- **Real-Time Delivery Updates**: Couriers can provide real-time status updates for ongoing deliveries via WebSockets.\n\n### Order and Payment\n- **Order Creation \u0026 Management**: Users can place and modify orders. Restaurants manage the order status.\n- **Payment Processing**: Handle payments and store payment history.\n\n---\n\n## Technologies Used\n\n- **Backend**: Node.js, Express, TypeScript\n- **Database**: PostgreSQL with TypeORM\n- **JWT**: Used for securing user \u0026 restaurant authentication and authorization.\n- **WebSockets**: Socket.IO\n- **Deployment**: Docker, AWS\n\nThis repository contains only the **server-side** code.\n\n---\n\n## Table Structure\n\nThe project uses a relational database. Below are the key tables:\n\n- **Users**: Stores user information (name, email, password, profile details).\n- **Restaurants**: Stores restaurant details (name, contact, location, menu, etc.).\n- **MenuItems**: Represents the food items that belong to restaurants.\n- **Orders**: Contains information about orders placed by users.\n- **OrderItems**: Stores individual items in each order.\n- **Carts**: Temporarily holds items before an order is placed.\n- **Couriers**: Stores courier information and status updates.\n- **Payments**: Handles payment information for orders.\n- **Reviews**: Stores user-submitted reviews for menu items.\n- **Notifications**: Logs notifications related to order updates and status changes.\n\n---\n\n## API Endpoints\n\n[Endpoints visualized](https://miro.com/app/board/uXjVLPdpN10=/)\n\n### User\n- **POST** `/users/signup`: Register a new user.\n- **POST** `/users/signin`: User login.\n- **GET** `/users`: Get all users.\n- **GET** `/users/profile`: Get authenticated user profile details.\n- **GET** `/users/:id`: Get details of a specific user.\n- **POST** `/users`: Create a new user.\n- **PUT** `/users/:id`: Update user details.\n- **DELETE** `/users/:id`: Delete a user.\n\n### Restaurant\n- **POST** `/restaurants/signup`: Register a new restaurant.\n- **POST** `/restaurants/signin`: Restaurant login.\n- **GET** `/restaurants`: Get all restaurants.\n- **GET** `/restaurants/:id`: Get restaurant details.\n- **POST** `/restaurants`: Create a new restaurant.\n- **PUT** `/restaurants/:id`: Update restaurant profile.\n- **DELETE** `/restaurants/:id`: Delete a restaurant.\n\n### Menu Item\n- **GET** `/restaurants/:restaurantId/menu`: Get all menu items for a restaurant.\n- **GET** `/restaurants/:restaurantId/menu/:menuItemId`: Get details of a specific menu item.\n- **POST** `/restaurants/:restaurantId/menu`: Create a new menu item.\n- **PUT** `/restaurants/:restaurantId/menu/:menuItemId`: Update an existing menu item.\n\n### Order\n- **POST** `/users/:userId/orders`: Create a new order.\n- **PUT** `/users/:userId/orders/:orderId`: Update an existing order.\n- **DELETE** `/users/:userId/orders/:orderId`: Cancel an order.\n- **GET** `/users/:userId/orders/:orderId`: Get details of a specific order.\n- **PUT** `/restaurants/orders/:orderId/status`: Update the status of an order (restaurant view).\n\n### Courier\n- **POST** `/couriers/register`: Register a new courier.\n- **PUT** `/couriers/status`: Update courier availability.\n- **GET** `/couriers/orders`: Get all assigned orders.\n- **DELETE** `/couriers/:courierId`: Delete a courier.\n\n### Notification\n- **GET** `/notifications`: Get all notifications.\n- **POST** `/notifications`: Create a new notification.\n\n### Payment\n- **GET** `/payments`: Get payment details.\n- **POST** `/payments`: Create a new payment.\n\n---\n\n## WebSockets Implementation\n\n### Real-Time Updates\n\nWebSockets (using Socket.IO) are used to provide real-time communication between the server, couriers, and users. Key features include:\n\n- **Order Status Updates**: When a restaurant changes the order status, users receive immediate updates.\n- **Courier Updates**: Couriers notify users when the order is picked up or on the way.\n- **User Notifications**: Users are notified in real-time about changes in their orders, such as when food is ready for pickup or out for delivery.\n\n---\n\n## Business Logic Overview\n\n### User\n\n1. **Registration**: Users provide a name, email, and password (hashed) to create an account.\n2. **Login**: Users log in using email and password.\n3. **Profile Management**: Users can update their details, such as address and phone number.\n4. **Order History**: Users can view their past orders and current order statuses.\n5. **Notifications**: Real-time notifications for order confirmations and delivery statuses.\n\n### Restaurant\n\n1. **Registration**: Restaurants can register with basic business details like name, email, address, etc.\n2. **Profile Management**: Restaurants can manage delivery zones, contact information, and hours of operation.\n3. **Menu Management**: Restaurants manage their food items, adding or removing them as needed.\n4. **Order Management**: Restaurants handle incoming orders, updating statuses (e.g., preparing, ready for delivery) via the dashboard.\n\n### Menu Item\n\n1. **Menu Management**: Each menu item must belong to a restaurant. Fields include name, description, price, and availability.\n2. **Review Management**: Users can leave reviews with ratings, and restaurants can view this feedback.\n\n### Courier\n\n1. **Registration**: Couriers can sign up using their name, email, and phone number.\n2. **Availability Management**: Couriers update their availability to accept delivery tasks.\n3. **Order Assignment**: Couriers are assigned orders by restaurants and receive notifications for new deliveries.\n4. **Real-Time Updates**: Couriers notify users about the current status of the delivery via WebSockets.\n\n### Order\n\n1. **Order Creation**: Users select items and place orders, linking them to a restaurant.\n2. **Order Management**: Users can update or cancel their orders. Restaurants can track and update order statuses.\n3. **Order Status**: Changes in order status trigger real-time notifications to the users, handled via WebSockets.\n\n### Payment\n\n1. **Payment Processing**: Users can finalize orders with integrated payment options.\n2. **Payment Status**: Payments are tracked and stored in the system, including transaction history.\n3. **Failure Handling**: If a payment fails, users are notified and given the option to retry.\n\n### Review\n\n1. **Review Submission**: Users can review menu items they've ordered.\n2. **Review Management**: Restaurants can view feedback to improve menu offerings and service quality.\n\n---\n\n## Future Improvements\n\n- Implement reviews.\n- Improve admin dashboard features for better restaurant management.\n- Add automated testing for all endpoints and logic.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbojana-petroska%2Fplated-server","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbojana-petroska%2Fplated-server","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbojana-petroska%2Fplated-server/lists"}