{"id":21184479,"url":"https://github.com/hossein-falah/eatnow","last_synced_at":"2025-10-04T07:14:20.226Z","repository":{"id":262232312,"uuid":"886539369","full_name":"Hossein-Falah/EatNow","owner":"Hossein-Falah","description":" A smart platform for online food ordering that offers a fast, convenient, and enjoyable experience. With EatNow, users can explore an extensive menu ranging from fast food to homemade-style dishes, easily place their orders, and take advantage of special discounts and offers.","archived":false,"fork":false,"pushed_at":"2024-12-15T12:18:24.000Z","size":1029,"stargazers_count":7,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-07-10T04:06:27.974Z","etag":null,"topics":["bcrypt","express","graphql","jsonwebtoken","postgresql","socket-io","swagger","typescript"],"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/Hossein-Falah.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-11-11T06:46:36.000Z","updated_at":"2025-04-28T12:42:28.000Z","dependencies_parsed_at":"2024-12-05T11:18:39.913Z","dependency_job_id":null,"html_url":"https://github.com/Hossein-Falah/EatNow","commit_stats":null,"previous_names":["hossein-falah/eatnow"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/Hossein-Falah/EatNow","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Hossein-Falah%2FEatNow","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Hossein-Falah%2FEatNow/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Hossein-Falah%2FEatNow/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Hossein-Falah%2FEatNow/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Hossein-Falah","download_url":"https://codeload.github.com/Hossein-Falah/EatNow/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Hossein-Falah%2FEatNow/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":278279027,"owners_count":25960624,"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","status":"online","status_checked_at":"2025-10-04T02:00:05.491Z","response_time":63,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"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":["bcrypt","express","graphql","jsonwebtoken","postgresql","socket-io","swagger","typescript"],"created_at":"2024-11-20T18:09:01.549Z","updated_at":"2025-10-04T07:14:20.198Z","avatar_url":"https://github.com/Hossein-Falah.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# **EatNow**\n\n### **About**\nEatNow is a smart platform for online food ordering that provides users with a fast, convenient, and enjoyable experience. Users can browse a wide menu of fast food and home-cooked meals, easily place orders, and take advantage of discounts and special offers.\n\n---\n\n## **Technologies**\nThe project is developed using the following technologies:\n- **GraphQL**\n- **Express.js**\n- **TypeScript**\n- **Socket.IO**\n- **PostgreSQL**\n- **Swagger**\n- **Bcrypt**\n- **JSON Web Token (JWT)**\n\n---\n\n## Project Structure\n\nThe project is organized into multiple layers for better separation of concerns:\n\n```\n    src/ \n        |-- configs/ \n        | |-- db.config.ts # Database connection configuration \n        |-- constants/ \n        | |-- constants.ts # Application-wide constants\n        |-- errors/\n        | |-- customError.ts\n        |-- graphql/\n        | -- resolver/\n        |   |--blog.resolver.ts\n        |   |--category.resolver.ts\n        |   |--comment.resolver.ts\n        |   |--discount.resolver.ts\n        | -- types/\n        |   |--blog.types.ts\n        |   |--category.types.ts\n        |   |--comment.types.ts\n        |   |--discount.types.ts\n        |   |--response.types.ts\n        |   |--user.types.ts\n        | |-- graphql.context.ts\n        | |-- index.resolver.ts\n        |-- middlewares/ \n        | |-- guard/ \n        |   |-- admin.guard.ts\n        |   |-- authenticate.guard.ts\n        | |-- uploader.middleware.ts # File upload handling \n        |-- modules/\n        | |-- api/\n        |   |-- swagger.json\n        |   |-- swagger.routes.ts\n        | |-- auth/\n        |   |-- auth.controller.ts\n        |   |-- auth.routes.ts\n        |   |-- auth.service.ts\n        |   |-- auth.validation.ts\n        | |-- blog/\n        |   |-- blog.interface.ts\n        |   |-- blog.model.ts\n        |   |-- blog.validation.ts\n        | |-- category/\n        |   |-- category.controller.ts\n        |   |-- category.interface.ts\n        |   |-- category.model.ts\n        |   |-- category.routes.ts\n        |   |-- category.service.ts\n        |   |-- category.validation.ts\n        | |-- comment/\n        |   |-- comment.interface.ts\n        |   |-- comment.model.ts\n        | |-- discount/\n        |   |-- discount.interface.ts\n        |   |-- discount.model.ts\n        |   |-- discount.validation.ts\n        | |-- food/\n        |   |-- food.controller.ts\n        |   |-- food.interface.ts\n        |   |-- food.model.ts\n        |   |-- food.routes.ts\n        |   |-- food.service.ts\n        |   |-- food.validation.ts\n        | |-- order/\n        |   |-- order.controller.ts\n        |   |-- order.interface.ts\n        |   |-- order.model.ts\n        |   |-- order.routes.ts\n        |   |-- order.service.ts\n        |   |-- order.validation.ts\n        | |-- socket/\n        |   |-- socket.service.ts\n        | |-- support/\n        |   |-- conversation.model.ts\n        |   |-- location.model.ts\n        |   |-- message.model.ts\n        |   |-- order.routes.ts\n        |   |-- namespace.controller.ts\n        |   |-- namespace.service.ts\n        |   |-- room.controller.ts\n        |   |-- room.model.ts\n        |   |-- room.service.ts\n        |   |-- support.controller.ts\n        |   |-- support.interface.ts\n        |   |-- support.routes.ts\n        |   |-- support.service.ts\n        |   |-- support.validation.ts\n        | |-- user/\n        |   |-- support.controller.ts\n        |   |-- support.interface.ts\n        |   |-- support.model.ts\n        |   |-- support.routes.ts\n        |   |-- support.service.ts\n        |   |-- support.validation.ts\n        |-- routes/ # Define routes for each module \n        | |-- index.routes.ts \n        |-- types/\n        | |--index.ts\n        |-- utils/ # Utility functions \n        | |-- function.utils.ts \n        | |-- token.utils.ts # Token generation and verification \n        |-- app.ts\n        |-- server.ts # Server setup and entry point \n        |-- .env # Environment variables \n        |-- .gitignore # Files and folders to be ignored by Git \n        |-- package.json # Dependencies and scripts \n        |-- package-lock.json # Locked dependency versions\n        |-- tsconfig.json\n```\n\n## Image\n\n![screen shot](./screencapture.png)\n\n## **API Documentation**\n\n### **Authentication**\nThis section manages user registration, login, and authentication:\n\n| Method | Endpoint               | Description                 |\n|--------|------------------------|-----------------------------|\n| `POST` | `/auth/register`       | Register a new user         |\n| `POST` | `/auth/login`          | Login                       |\n| `POST` | `/auth/verify-otp`     | Verify OTP code             |\n| `POST` | `/auth/resend-otp`     | Resend OTP code             |\n| `POST` | `/auth/refresh-token`  | Refresh access token        |\n| `POST` | `/auth/logout`         | Logout                      |\n| `GET`  | `/auth/getMe`          | Get user information        |\n\n---\n\n### **Users**\nManage user information:\n\n| Method   | Endpoint                | Description                       |\n|----------|-------------------------|-----------------------------------|\n| `GET`    | `/users`                | Get all users                     |\n| `GET`    | `/users/{id}`           | Get user by specific ID           |\n| `PATCH`  | `/users/update/{id}`    | Update user information           |\n| `DELETE` | `/users/remove/{id}`    | Remove user                       |\n| `PUT`    | `/users/change-role/{id}` | Change user role                |\n\n---\n\n### **Food**\nManage the food menu:\n\n| Method   | Endpoint                | Description                       |\n|----------|-------------------------|-----------------------------------|\n| `GET`    | `/foods`                | Get the list of foods             |\n| `GET`    | `/foods/{id}`           | Get details of a specific food    |\n| `POST`   | `/foods/add-food`       | Add a new food item               |\n| `PATCH`  | `/foods/update/{id}`    | Update a specific food            |\n| `DELETE` | `/foods/remove/{id}`    | Remove food item                  |\n\n---\n\n### **Order**\nManage user orders:\n\n| Method   | Endpoint                   | Description                       |\n|----------|----------------------------|-----------------------------------|\n| `GET`    | `/orders/admin`            | Get all orders (admin)            |\n| `GET`    | `/orders/user`             | Get user orders                   |\n| `GET`    | `/orders/filter-by-status` | Filter orders by status           |\n| `GET`    | `/orders/{id}`             | Get details of a specific order   |\n| `POST`   | `/orders/create`           | Create a new order                |\n| `DELETE` | `/orders/delete/{id}`      | Delete an order                   |\n| `PUT`    | `/orders/change-status/{id}` | Change order status             |\n\n---\n\n### **Category**\nManage menu categories:\n\n| Method | Endpoint                | Description                       |\n|--------|-------------------------|-----------------------------------|\n| `POST` | `/categories/create`    | Create a new category             |\n\n---\n\n### **Support**\nManage the support section for communication between users and admins:\n\n| Method   | Endpoint                     | Description                       |\n|----------|------------------------------|-----------------------------------|\n| `GET`    | `/support/namespace`         | Get existing namespaces           |\n| `POST`   | `/support/namespace/create`  | Create a new namespace            |\n| `DELETE` | `/support/namespace/{id}`    | Delete a namespace                |\n| `GET`    | `/support/rooms`             | Get the list of support rooms     |\n| `POST`   | `/support/room/create`       | Create a new support room         |\n| `DELETE` | `/support/room/{id}`         | Delete a specific support room    |\n\n---\n\n# **GraphQL**\n\nThe project also exposes a GraphQL endpoint, which allows for more flexible queries and mutations. Here are the available GraphQL queries and mutations:\n\n## **Root Queries**\n\n* **getAllCategories** – Retrieve all food categories.\n* **getCategoryById(id: ID)** – Retrieve a specific category by ID.\n* **getAllCommentsForAdmin** – Get all comments for admin review.\n* **getAllComment** – Retrieve all comments.\n* **getCommentById(id: ID)** – Get a specific comment by ID.\n* **getAllBlogsForAdmin** – Retrieve all blogs for admin review.\n* **getAllBlogs** – Get a list of blogs.\n* **getBlogById(id: ID)** – Get a specific blog by ID.\n* **getAllDiscounts** – Retrieve all discounts.\n\n## **Root Mutations**\n\n* **removeCategoryById(id: ID)** – Remove a category by ID.\n* **createComment(comment: CommentInput)** – Create a new comment.\n* **removeCommentById(id: ID)** – Remove a comment by ID.\n* **acceptComment(id: ID)** – Accept a comment.\n* **rejectComment(id: ID)** – Reject a comment.\n* **answerComment(id: ID, answer: String)** – Answer a comment.\n* **createBlog(blog: BlogInput)** – Create a new blog.\n* **removeBlogById(id: ID)** – Remove a blog by ID.\n* **updateBlog(id: ID, blog: BlogInput)** – Update a specific blog.\n* **createDiscount(discount: DiscountInput)** – Create a new discount.\n* **deleteDiscount(id: ID)** – Delete a discount.\n* **updateDiscount(id: ID, discount: DiscountInput)** – Update a discount.\n* **changeDiscountStatus(id: ID, status: Boolean)** – Change the status of a discount.\n\nThe GraphQL endpoint is available at /graphql.\n\n## **Installation \u0026 Setup**\n\nTo set up the project, follow these steps:\n\n\n1. **Clone the repository:**\n   ```bash\n   git clone https://github.com/Hossein-Falah/EatNow.git\n   cd EatNow\n   ```\n\n2. **Install dependencies:**\n   ```bash\n   npm install\n   ```\n\n3. **Set up the database:**\n   - Ensure PostgreSQL is installed and configured.\n\n4. **Set environment variables:**\n   Create a .env file with appropriate values.\n\n   ```env\n   PORT=8000\n   DB_HOST=localhost\n   DB_USER=your_db_user\n   DB_PASS=your_db_password\n   JWT_SECRET=your_jwt_secret\n   ```\n\n5. **Run the project:**\n   ```bash\n   npm run dev\n   ```\n\n---\n\n## **Usage**\nOnce the project is running:\n- **API** documentation is available via Swagger UI at `/api-doc`.\n- **Socket.IO** is used for live communication between users and admins.\n- **GraphQL** can be accessed at `/graphql`.\n\n---\n\n## **Features**\n- **Registration and Authentication** with OTP\n- **Order Management** with status filtering\n- **Online Support** using Socket.IO\n- **Menu Management** with categories\n- **GraphQL** for flexible queries and mutations\n\n---\n\n## **License**\n\nThis project is licensed under the **MIT** License.\n\n---\n\n## **Contributing**\nWe welcome contributions to EatNow! To contribute, please follow these steps:\n\n- Fork the repository.\n- Create a new branch **(git checkout -b feature-branch)**.\n- Make your changes and commit them **(git commit -am 'Add new feature')**.\n- Push to your branch **(git push origin feature-branch)**.\n- Create a new Pull Request.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhossein-falah%2Featnow","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fhossein-falah%2Featnow","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhossein-falah%2Featnow/lists"}