This is the backend API for FoodSwift, a restaurant delivery application. It powers the core functionality of order processing, user management, and delivery tracking.
Before you begin, ensure you have met the following requirements:
- Node.js: Make sure you have Node.js installed. You can download it from https://nodejs.org/.
- Yarn: We use Yarn as a package manager. You can install it via npm with the following command:
npm install -g yarn
. - MongoDB: You need a MongoDB instance as the database for the application. You can install it locally or use a cloud-hosted solution like MongoDB Atlas.
- Docker: If you want to containerize your application, make sure Docker is installed. You can download it from https://www.docker.com/.
These instructions will help you set up and run the FoodSwift API on your local machine for development and testing purposes.
- Clone this repository:
git clone git@github.com:MEZ901/FoodSwift-API.git
- Navigate to the project directory:
cd FoodSwift-API
- Install the required dependencies:
yarn install
Duplicate the .env.example file and rename it to .env
cp .env.example .env
Update the environment variables in the .env file as needed for your local setup.
- Ensure that your MongoDB server is up and running.
To start the FoodSwift API, run the following command:
yarn run dev
By default, the server will run on http://localhost:8080. You can change the port by modifying the PORT variable in your .env file.
You can use Postman or any other API testing tool to test the API.
You can find the project structure documentation here.
The API documentation can be found here.
The Docker documentation can be found here.
You can run tests using the following command:
yarn test