Auto Mart is an online marketplace for automobiles of diverse makes, model or body type. With Auto Mart, users can sell their cars or buy from trusted dealerships or private sellers.
REQUEST | ROUTE | FUNCTIONALITY |
---|---|---|
GET | /api/v1/car | Fetches all Cars sold and unsold |
POST | /api/v1/car | Creates a car sale Ad |
PATCH | /api/v1/car/:car-id/status | Updates a car's status |
PATCH | /api/v1/car/:car-id/price | Updates a car's price |
GET | /api/v1/car/:car-id | Fetches a specific car Ad |
GET | /api/v1/car?status=available | Fetches all unsold car Ads |
GET | /api/v1/car?status=available&min_price=XValue&max_price=XValue | Fetches unsold cars within a price range |
GET | /api/v1/car?status=available&state=new | Fetches unsold new cars |
GET | /api/v1/car?status=available&state=used | Fetches unsold used cars |
GET | /api/v1/car?status=available&manufacturer=XXXValue | Fetches all unsold cars with specified manufacturer |
GET | /api/v1/car?status=available&type=XXXValue | Fetches unsold cars with specified body type |
DELETE | /api/v1/car/:car-id | Deletes a Car Ad |
POST | /api/v1/auth/signup | Creates a new User |
POST | /api/v1/auth/signin | Signs the user in |
POST | /api/v1/order | Creates a purchase order |
PATCH | /api/v1/order/:order-id/price | Updates purchase offered price |
POST | /api/v1/flag | Flags a posted car Ad as fraudulent |
For more details about endpoints check the documentation here
- Javascript
- NodeJs
- ExpressJs
- Mocha
- Chai
- nyc
-
Clone this repository to your local PC
git clone https://github.com/Malaba6/Auto-Mart.git
here -
You need to have Nodejs and npm installed
$ node --version
To check if node is intalled. If not installed, download here$ npm --version
To check if the node package manager is istalled -
Then
$ npm install
To install all the application dependencies -
And make sure postgresql is install in your system
- Make sure database name is automart
- Test db is test_automart
- User name is postgres
-
To run the app
npm start
-
To run tests
npm test
Malaba Eric