- Download the zipped file and unzip it or Clone it
git clone https://github.com/Ahmed-Abd-elhamid/ecommerce-api
- cd inside the project
cd ecommerce-api
- Run this command to install all gems we used
bundle install
- run this command to create your database
rake db:create db:migrate
- seed the database - generate dummy data
rake db:seed
- get api-endpoints by
rake routes
- Start your server
rails server
https://api-ecomm.herokuapp.com/
https://documenter.getpostman.com/view/12318086/TVCcWTzB
-
categoreis end-points
- GET /categories
- GET /categories/:id
- POST /categories
params: title
- PUT /categories/:id
params: title
- DELETE /categories/:id
-
sub_categoreis end-points
- GET /sub_categories
- GET /sub_categories/:id
- POST /sub_categories
params: title, category_id
- PUT /sub_categories/:id
params: title, category_id
- DELETE /sub_categories/:id
-
items end-points
- GET /items
- GET /items
params: search
- GET /items/:id
- POST /items
params: title, brand, description, stock, price, sub_category_id, images[]
- PUT /items/:id
params: title, brand, description, stock, price, sub_category_id, images[]
-
carts end-points
- GET /carts
- GET /carts/:id
- POST /carts
params: item_id, user_id, quantity
- POST /carts/items/:id
params: item_id
- DELETE /carts/:id
-
orders end-points
- GET /orders
- GET /orders/:id
- POST /orders
params: user_id, country, city, address, telephone
- PUT /orders/:id
params: country, city, address, telephone
- PUT orders/deliver/:id
- DELETE /orders/:id
-
users end-points
- GET /users
- GET /users/:id
- DELETE /users/:id
- POST /users
params: name, email, password, password_confirmation, avatar
- PUT /users
params: password, password_confirmation
- DELETE /users
- POST /users/sign_in
params: email, password
- DELETE /users/sign_out
params: uid, access-token, client
To Authenticate all requests you should pass this params: uid, access-token, client, with every request in header.. but for now all request doesn't require authentication.