Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/DannyYShi/visions-api
Back-end code for Visions, a custom website designed for selling professional photos.
https://github.com/DannyYShi/visions-api
Last synced: 8 days ago
JSON representation
Back-end code for Visions, a custom website designed for selling professional photos.
- Host: GitHub
- URL: https://github.com/DannyYShi/visions-api
- Owner: DannyYShi
- Created: 2020-11-04T15:54:43.000Z (about 4 years ago)
- Default Branch: master
- Last Pushed: 2021-05-11T17:52:34.000Z (over 3 years ago)
- Last Synced: 2024-10-14T20:03:01.642Z (29 days ago)
- Language: JavaScript
- Homepage:
- Size: 5.82 MB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Visions (server)
This is the backend code for Visions, a website template for an online professional photography store or portfolio.
**Link to Live App:** https://visions-iota.vercel.app/
**Link to Client Repo:** https://github.com/danny-shi/visions## API Documentation
### Shop Endpoints
### ▸ `GET /api/shop`
Returns an array of objects of each item in the database representing the items available to be purchased.**Example**
```JSON
[
{
"item_id": 1,
"item_name": "Mountain",
"img_file": "mountain.jpg",
"item_price": 35,
"item_description": "A picture of a mountain."
},
{
"item_id": 2,
"item_name": "Ocean",
"img_file": "ocean.jpg",
"item_price": 35,
"item_description": "The seaside view outside of our AirBnb."
},
{
"item_id": 3,
"item_name": "Woman",
"img_file": "woman.jpg",
"item_price": 35,
"item_description": "Portrait of a woman passing by on the street."
},
{
"item_id": 4,
"item_name": "Waterfall",
"img_file": "waterfall.jpg",
"item_price": 35,
"item_description": "Hidden waterfall we discovered on a hike."
},
{
"item_id": 5,
"item_name": "Stones",
"img_file": "stones.jpg",
"item_price": 35,
"item_description": "A stone tower by a river."
}
]
```### Item Endpoints
### ▸ `GET /api/shop/:item_id`
Returns an object of a particular item in the database by the `item_id` assigned to it.**Example**
```JSON
{
"item_id": 3,
"item_name": "Woman",
"img_file": "woman.jpg",
"item_price": 35,
"item_description": "Portrait of a woman passing by on the street."
}
```
### Order Endpoints
### ▸ `GET /api/orders/
Gets a list of orders that have been placed through the website with various details.**Example**
```JSON
[
{
"order_id": 1,
"customer_name": "Andrew Siegand",
"customer_email": "[email protected]",
"comments": null,
"total_price": 35,
"order_summary": "Item: Mountain, Price: $35, Quantity: 1, Total cost: $35"
}
]
```## Technology Stack
* **Express** for handling API requests
* **Node** for interacting with the file system
* **PostgreSQL** for the database
* **Knex.js** for interfacing with the **PostgreSQL** database
* **Postgrator** for database migration
* **Heroku** for deploying the database