This project involves developing a RESTful JSON API for a food company's group-buying management system. The API will provide comprehensive functionality for managing users, products, and orders. Key operations include the ability to add, update, and delete these entities. Additionally, it will offer a feature to retrieve a comprehensive list of all the orders placed. This API will serve as an essential tool for effectively organizing and maintaining the group-buying activities within the company.
- ExpressJs
- MongoDb
- NodeJs
- Typescript
- Clone the repo
git clone https://github.com/steffFrank/NODE_FOOD_PROJECT.git
- Install NPM packages
npm install
- MongoDb
You will need 2 mongodb urls
create an .env file and store them as:
- MONGODB_URL: your_mongodb_url
- TEST_MONGODB_URL: your_mongodb_url_for_tests
- security
The API was created using https protocol, therefore you will need a self-signed certificate and a key. You can create them with this line of code.
openssl req -x509 -newkey rsa:4096 -nodes -keyout key.pem -out cert.pem -days 365
- Start the server
npm start
- Run the tests - executed on the .ts files in src folder
npm test
- Run the build - Results in the dist folder
npm run build
-
To place an order, you need to be sure that the products and users exist
-
To update the order, change the orderId variable with the new one you want to update
-
Run the following to be sure all the tests are passing
MIT license
Steff Frank - [email protected]