A delivery application connecting buyers, sellers, and dispatchers.
- Introduction
- Features
- Technologies Used
- Getting Started
- Environment Variables
- Project Structure
- API Endpoints
- Unittesting
- Code of Conduct
- Contributing
- License
Deliver App is a delivery application that connects buyers, sellers, and dispatchers. It provides a platform for users to manage orders, products, payments, and more through a GraphQL API.
- User authentication and authorization
- Product management
- Order management
- Payment processing
- Rate limiting
- Logging
- GraphQL API with Apollo Server
- Node.js
- Express.js
- Apollo Server
- GraphQL
- MongoDB
- Mongoose
- dotenv
- bcrypt
- cors
- body-parser
- express-rate-limit
- graphql-shield
- graphql-rate-limit
- Node.js (v14 or higher)
- MongoDB
- Docker (optional, for containerized deployment)
- Redis server
- Clone the repository:
git clone https://github.com/dominic-source/Express_food_delivery_backend.git
cd Express_food_delivery_backend
- Install dependencies using pnpm:
pnpm install
- Set permissions for database_mongo folder, this will preserve our database data
chmod 777 -R ./database_mongo
- Run docker compose to start mongodb
docker compose up -d
-
Ensure that redis server is installed and start it
-
Open a new terminal and start consumer precess
cd utils
node consumer.js
- Start the application, ensure you are in the root folder of the project
pnpm start
- The server will start on the port specified in the environment variables (default is 5000).
DELIVER_MONGODB_HOST=localhost
DELIVER_MONGODB_DB=example_db
DELIVER_MONGODB_USER=example_user
DELIVER_MONGODB_PWD=example_pwd
DELIVER_MONGODB_PORT=port_number
DELIVER_MONGODB_URL="example uri"
DELIVER_URL=http://localhost:3000
SECRET_KEY=secret_key
FRONTEND_URL="http://localhost:3000"
├── app.js
├── autocommit.py
├── CODE_OF_CONDUCT.md
├── compose.yaml
├── configPayment.json
├── controllers
│ └── userControllers.js
├── create_files.sh
├── database_mongo
├── graphqlSchema
│ └── typeDefs.js
├── LICENSE.md
├── logs
│ ├── error.log
│ └── request.log
├── middlewares
│ └── logMiddleware.js
├── migrate-mongo-config.js
├── migrations
│ └── 20240910161125-first-migration.js
├── models
│ ├── category.js
│ ├── location.js
│ ├── orderItem.js
│ ├── order.js
│ ├── payment.js
│ ├── product.js
│ └── user.js
├── mongodb.env
├── node_modules
├── package.json
├── package-lock.json
├── pnpm-lock.yaml
├── README.md
├── resolver
│ ├── orders.resolver.js
│ ├── payment.resolver.js
│ ├── products.resolver.js
│ ├── resolvers.js
│ └── user&category.resolver.js
├── routes
│ └── index.js
├── setup_env.sh
├── static
│ └── uploads
│ └── 1714152413914-341049797-toUploadFile.png
├── test
│ ├── test_order_resolver
│ │ ├── createOrder.test.js
│ │ ├── deleteAnOrderItem.test.js
│ │ ├── deleteOrderItemsNow.test.js
│ │ ├── deleteOrder.test.js
│ │ ├── getAllOrders.test.js
│ │ ├── getMyOrderItems.test.js
│ │ ├── getMyOrders.test.js
│ │ ├── getTheOrderAsDispatcher.test.js
│ │ ├── getTheOrderAsSeller.test.js
│ │ ├── updateOrderAddress.test.js
│ │ └── updateOrderItems.test.js
│ ├── test_payment_resolver
│ │ ├── createPayment.test.js
│ │ ├── getMyPayment.test.js
│ │ └── updatePayment.test.js
│ ├── test_product_resolver
│ │ ├── createProduct.test.js
│ │ ├── deleteProduct.test.js
│ │ ├── getAllProductsOfUsersByCategor.test.js
│ │ ├── getAllProducts.test.js
│ │ ├── getProduct.test.js
│ │ ├── getUserProducts.test.js
│ │ └── updateProduct.test.js
│ └── test_user_resolver
│ ├── categories.test.js
│ ├── category.test.js
│ ├── createCategories.test.js
│ ├── createCategory.test.js
│ ├── createUser.test.js
│ ├── deleteCategory.test.js
│ ├── deleteUser.test.js
│ ├── forgotPassword.test.js
│ ├── logins.test.js
│ ├── logout.test.js
│ ├── updatePassword.test.js
│ ├── updateUser.test.js
│ ├── users.test.js
│ └── user.test.js
└── utils
├── allowedextension.js
├── consumer.js
├── emailclient.js
├── managedata
│ ├── deletemodels.js
│ └── sendrequest.js
├── mutation.js
└── mylogger.js
/graphql
: Main GraphQL endpoint for querying and mutating data.
/api
: RESTful API routes for additional functionalities.
npm test
Please read our Code of Conduct to understand the expected behavior in our community.
We welcome contributions! Please see our Contributing Guidelines for more details.
This project is licensed under the MIT License. See the LICENSE file for details.