Official Hermes Gift repository
Main languages & libraries :
- React
- Redux
- Webpack
- Babel
- react-router
- lodash
- Django
- Postgre
Route | Description | Old page |
---|---|---|
/ | Home page | http://hermesgift.bg/ |
/products | Products page with | http://hermesgift.bg/index.php/categories/sklad |
/products/:category | Products from category | http://hermesgift.bg/index.php/categories/sklad/mobile-accessories |
/services | Services page | http://hermesgift.bg/index.php/nashatapechatnitsa |
/service/:serviceid | Service details page | http://hermesgift.bg/index.php/nashatapechatnitsa/item/tamponen-pechat |
/for-us | For us & Contacts page | http://hermesgift.bg/index.php/for-us |
/search/products/:keyword | Search page with specific keyword | http://hermesgift.bg/index.php/component/virtuemart/search?keyword=180-01&limitstart=0&option=com_virtuemart&view=category |
/catalogs | Catalogs page | http://hermesgift.bg/index.php/catalogs |
- name: Product name
- description: Product description
- product_id: Hermes product ID
- client_id: Client product ID
- category_id: Category ID (ForeignKey)
- price: Price
- currency: USD/lv
- image_link: link to cloudinary
- online: true/false
- views: Number of views
Category contain products example
- name: Category name
- value: Category value (for links)
- products: Products in the category
- parent_category: Parent category
- image_link: Category front image
- online: true/false
PDF Catalogs, examples
- name: Catalog name
- image_link: Catalog front image (link to cloudinary)
- link: Link to catalog pdf
- online: true/false
- title: Asset title
- body: Asset body (HTML or simple text)
- asset_id: Unique asset id
- image_link: Asset front image
- online: true/false
Site configurations. Example: Which assets to be displayed on http://hermesgift.bg/index.php/nashatapechatnitsa And other configurations
- services: Array with assets values
Product:
Get product:
method: GET
endpoint: /api/product/{id}
response:
{
name: String,
description: String,
price: String, // 22,00 лв
product_id: String,
image_link: String,
category_id: ForeignKey
}
error response:
{
status_code: 404,
"detail": "Not Found"
}
description:
- If everything is OK with this product, the API returns status 200 and product data.
- If product is not found, the API returns status 404 and NOT_FOUND status_code
- If product is offline, the API returns status 404 and NOT_FOUND status_code
Get products from category:
method: GET
endpoint: /api/products/{category_name}
response:
{
products: [
{
name: String,
price: String,
image_link: String,
product_id: String
},
{
name: String,
price: String,
image_link: String,
product_id: String
}
],
count: Number
}
error response:
{
status_code: 404,
"detail": "Not Found"
}
optional parameters:
count: how many products to return. Example: when we want to implement pagination (page size is this count)
start: from which product to start the search. Same Example ^
description:
If category is not found, the API returns status 404 and NOT_FOUND status_code
Return only online products
Category:
Get categories:
method: GET
endpoint: /api/categories
response:
{
categories: [
{
name: String,
value: String,
category_img: String
},
{
name: String,
value: String,
category_img: String
}
],
count: Number
}
description:
Returns only online categories
Catalog:
Get catalogs:
method: GET
endpoint: /api/catalogs
response:
{
catalogs: [
{
name: String,
image_link: String,
link: String
},
{
name: String,
image_link: String,
link: String
}
],
count: Number
}
description:
Returns only online catalogs
Asset:
method: GET
endpoint: /api/asset/{asset_id}
response:
{
title: String,
body: String,
asset_id: String,
image_link: String
}
error response:
{
status_code: 404,
"detail": "Not Found"
}
description:
Return only online asset
Body is a simple text or html with tags
Sites:
Get site configuration
method: GET
endpoint: /api/site/{config}
Example response:
{
services: [
Asset,
Asset
]
}
error response:
{
status_code: 404,
"detail": "Not Found"
}
description:
Return only online assets
Return only the configuration which you search ({config})
- master - main branch, used only for production builds
- dev - dev branch, used to contains all ready features
- local-branch - dev branch, used to contains a separated feature
Steps when you want to develop a feature.
1. Pull dev branch
2. Create a new branch. Example update-en-translations
3. Switch to your new branch
4. Commit
5. When you are ready, push your changes
6. Go to **hermes** github repository and click "Create a pull request" button
7. Add title and description
8. Wait for review approval and merge