Skip to content

Commit

Permalink
docs: grammar and spellchecking (#77)
Browse files Browse the repository at this point in the history
  • Loading branch information
CondensedMilk7 authored Oct 6, 2023
1 parent 9ad9cbc commit 7df9dc1
Show file tree
Hide file tree
Showing 7 changed files with 32 additions and 31 deletions.
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -39,4 +39,4 @@ lerna-debug.log*
.env

# Ignore copied changelog
/docs/changelog.md
/docs/CHANGELOG.md
11 changes: 9 additions & 2 deletions docs/authentication.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ This means that, for example, if there is a user-related logic in shop
or chat module that you want to integrate in your app, you will also
need to use authentication endpoints.

Authentication uses access tokens through both `Authorization` header and
Authentication uses JSON Web Tokens ([JWT](https://jwt.io/)) through both `Authorization` header and
cookies, allowing you to use whichever option you see fit.

Base URL:
Expand All @@ -14,6 +14,13 @@ Base URL:
https://api.everrest.educata.dev/auth
```

:::info NOTE
After new major release of chrome, cookies will not be supported for different-oirigin front-end apps.
This means that your front-end apps which will not be hosted on the same origin as API (edicata.dev)
will ignore cookies. It is therefore recommended to store tokens in `localStorage` or `sessionStorage`
and attatch them directly to `Authorization` request headers.
:::

## Sign Up

- Method: `POST`
Expand Down Expand Up @@ -399,7 +406,7 @@ curl -X 'POST' \
}
```

::: warning NOTE
::: warning WARNING
This changes user's password into an automatically generated one which will be sent to their email.
The user then can access his account with it and optionally [change it](#change-password).
:::
Expand Down
15 changes: 8 additions & 7 deletions docs/cart.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Cart

In the cart module, users can create a cart, add products to it, proceed to checkout, delete items, and clear the cart. This operates in a simple manner, similar to how it is handled on shopping websites.
In the cart module users can create a cart, add products to it, proceed to checkout, delete items, and clear the cart. This operates in a simple manner, similar to how it is handled on shopping websites.

Base URL:

Expand All @@ -12,16 +12,17 @@ https://api.everrest.educata.dev/shop/cart

<img src="./public/flowchart.svg" alt="flowchart of cart module">

To use the cart module, we must follow a workflow similar to the provided flowchart. First of all, a user needs to create a cart by <a href="#create-cart">Create cart</a>. Then, the user is allowed to check the cart at any time by <a href="#get-cart">Get cart</a>. After that, if the user wants to add a new product to the cart, they should use the <a href="#update-cart">Update cart</a> option. There may be moments when the user wants to clear the cart, for this action, we will use the <a href="#clear-cart">Clear cart</a> option. If the user wants to remove an item from the cart, we should use the <a href="#delete-item">Delete item</a> option. Finally, if the user wants to proceed to checkout, we should use the <a href="#checkout">Checkout</a> option.
In this cart system, the cart for the user only exists when there's a need for it. A new user therefore has no cart and it should be created first.
After checkout the cart is emptied and therefore it is deleted. Adding product to the cart afterwards required creating a new cart.

To use the cart module, we must follow a workflow similar to the provided flowchart. First of all, a user needs to create a cart by <a href="#create-cart">Create cart</a>. Then, the user is allowed to check the cart at any time by <a href="#get-cart">Get cart</a>. After that, if the user wants to add a new product to the cart, they should use the <a href="#update-cart">Update cart</a> endpoint. There may be moments when the user wants to clear the cart, for this, the <a href="#clear-cart">Clear cart</a> endpoint can be used. If the user wants to remove an item from the cart, <a href="#delete-item">Delete item</a> endpint should be used. Finally, if the user wants to proceed to checkout, <a href="#checkout">Checkout</a> enpoint can be used.

::: info NOTE
All endpoints for the cart module require the user to be `authorized`. This means that an access token must be attached either to cookies or the `Authorization` header.
All endpoints for the cart module require the user to be authorized. This means that an access token must be attached either to cookies or the `Authorization` header.
:::

## Create cart

To create cart, user has to choose one time for first time.

- Method: `POST`
- URL: `https://api.everrest.dev/shop/cart/product`

Expand Down Expand Up @@ -71,7 +72,7 @@ curl -X 'POST' \
```

::: info NOTE
This endpoint works if the user does not have a cart attached.
This endpoint works if the user does not already have a cart.
:::

## Get cart
Expand Down Expand Up @@ -171,7 +172,7 @@ curl -X 'PATCH' \
```

::: info NOTE
This endpoint works if the user already have a cart attached.
This endpoint works if the user already has a cart.
:::

## Clear cart
Expand Down
20 changes: 6 additions & 14 deletions docs/product.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Product

In the product module, users can obtain different types of products with paginated data, which means that almost all the returned data will be paginated.
In the product module users can obtain product data. Almost all endpoints support pagination.

Base URL:

Expand All @@ -21,8 +21,9 @@ https://api.everrest.educata.dev/shop/product
"products": [...]
}
```

::: tip Tip
Every paginated dataset can be modified using `queries` for `page` and `limit`. For example: `https://api.everrest.dev/shop/product/all?page_index=1&page_size=2`
Every paginated dataset can be modified using `queries` for `page` and `limit`. For example: `https://api.everrest.dev/shop/product/all?page_index=1&page_size=2`
:::

## All product
Expand Down Expand Up @@ -159,7 +160,7 @@ curl -X 'GET' \

::: info NOTE
if you want to use `sort_by` or `sort_direction`, you should use
both, they are interdependance params.
both, they are interdependant params.
:::

### Example
Expand Down Expand Up @@ -206,7 +207,7 @@ curl -X 'GET' \
"https://alta.ge/images/thumbnails/900/650/detailed/279/11_s2p2-m2.png.jpg",
"https://alta.ge/images/thumbnails/900/650/detailed/279/1_34al-1v.png.jpg",
"https://alta.ge/images/thumbnails/900/650/detailed/279/download_%281%29.png.jpg"
],
]
}
]
}
Expand Down Expand Up @@ -320,15 +321,7 @@ curl -X 'GET' \
### Response

```json
[
"asus",
"samsung",
"xiaomi",
"apple",
"honor",
"oneplus",
"lenovo"
]
["asus", "samsung", "xiaomi", "apple", "honor", "oneplus", "lenovo"]
```

## Brand by Name
Expand Down Expand Up @@ -463,4 +456,3 @@ Requires access token attatched either to cookies or `Authorization` header.
]
}
```

Loading

0 comments on commit 7df9dc1

Please sign in to comment.