Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
240 changes: 240 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,2 +1,242 @@
# ecommerce-cms
Membuat website untuk management content ecommerce ( dipakai oleh admin)

FIREBASE = https://e-commerce-cms-66bdc.web.app/

email: [email protected]
password: 1234

HEROKU = https://e-commerce-cms-gacor.herokuapp.com/

## RESTful endpoints
List of available endpoint:

- `POST /products`
- `GET /products`
- `PUT /products/:id`
- `DELETE /products/:id`
- `POST /login`


### POST /products
_Request headers_
```json
{
"access_token": "<access_token>"
}
```

_Request Body_
```json
{
"name": "string",
"image_url": "string",
"price": "integer",
"stock": "integer"
}

```

_Response (201 - Created)_
```json
{
"id": "integer",
"name": "string",
"image_url": "string",
"price": "integer",
"stock": "integer",
"createdAt": "date",
"updatedAt": "date"
}
```

_Response (400 - Bad Request)_
```json
[
{
"message": "name is empty"
},
{
"message": "image_url is empty"
}
]
```

_Response (500 - Internal Server Error)_
```json
{
"message": "Internal Server Error"
}
```
---
### GET /products
_Request headers_
```json
{
"access_token": "<access_token>"
}
```

_Response (200 - OK)_
```json
[
{
"id": 1,
"name": "sepatu",
"image_url": "unplash.com",
"price": 6,
"stock": 1
},
{
"id": 2,
"name": "kaos",
"image_url": "pexels.com",
"price": 5,
"stock": 2
},
{
"id": 3,
"name": "kaos kaki",
"image_url": "google.com",
"price": 10,
"stock": 1
}
]
```

_Response (500 - Internal Server Error)_
```
{
"message": "Internal Server Error"
}
```
---
### PUT /products/:id
_Request headers_
```json
{
"access_token": "<access_token>"
}
```

_Request Body_
```json
{
"name": "string",
"image_url": "string",
"price": "integer",
"stock": "integer"
}

```

_Response (200 - OK)_
```json
{
"id": "integer",
"name": "string",
"image_url": "integer",
"price": "integer",
"stock": 1,
"createdAt": "date",
"updatedAt": "date"
}
```

_Response (400 - Bad Request)_
```json
[
{
"message": "name is empty"
},
{
"message": "image_url is empty"
}
]
```

_Response (404 - Not Found)_
```
{
"message": "error Not Found"
}
```

_Response (500 - Internal Server Error)_
```json
{
"message": "Internal Server Error"
}
```
---
### DELETE /products/:id
_Request headers_
```json
{
"access_token": "<access_token>"
}
```

_Response (200 - OK)_
```json
{
"id": "integer",
"name": "string",
"image_url": "string",
"price": "integer",
"stock": "integer",
"createdAt": "date",
"updatedAt": "date"
}
```

_Response (404 - Not Found)_
```
{
"message": "error Not Found"
}
```

_Response (500 - Internal Server Error)_
```json
{
"message": "Internal Server Error"
}
```
---
### POST /login

_Request Body_
```json
{
"email": "string",
"password": "string"
}

```

_Response (200 - OK)_
```json
{
"access_token": "<access_token>"
}
```

_Response (400 - Bad Request)_
```json
[
{
"message": "You don't put any password"
},
{
"message": "You don't put any email"
}
]
```

_Response (500 - Internal Server Error)_
```json
{
"message": "Internal Server Error"
}
```
3 changes: 3 additions & 0 deletions client/.browserslistrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
> 1%
last 2 versions
not dead
5 changes: 5 additions & 0 deletions client/.editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
[*.{js,jsx,ts,tsx,vue}]
indent_style = space
indent_size = 2
trim_trailing_whitespace = true
insert_final_newline = true
17 changes: 17 additions & 0 deletions client/.eslintrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
module.exports = {
root: true,
env: {
node: true
},
extends: [
'plugin:vue/essential',
'@vue/standard'
],
parserOptions: {
parser: 'babel-eslint'
},
rules: {
'no-console': process.env.NODE_ENV === 'production' ? 'warn' : 'off',
'no-debugger': process.env.NODE_ENV === 'production' ? 'warn' : 'off'
}
}
23 changes: 23 additions & 0 deletions client/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
.DS_Store
node_modules
/dist


# local env files
.env.local
.env.*.local

# Log files
npm-debug.log*
yarn-debug.log*
yarn-error.log*
pnpm-debug.log*

# Editor directories and files
.idea
.vscode
*.suo
*.ntvs*
*.njsproj
*.sln
*.sw?
24 changes: 24 additions & 0 deletions client/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
# client

## Project setup
```
npm install
```

### Compiles and hot-reloads for development
```
npm run serve
```

### Compiles and minifies for production
```
npm run build
```

### Lints and fixes files
```
npm run lint
```

### Customize configuration
See [Configuration Reference](https://cli.vuejs.org/config/).
5 changes: 5 additions & 0 deletions client/babel.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
module.exports = {
presets: [
'@vue/cli-plugin-babel/preset'
]
}
Loading