Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Anhar Amir Fathoni #16

Open
wants to merge 5 commits into
base: master
Choose a base branch
from
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
265 changes: 264 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1 +1,264 @@
# hacktivoverflow
# hacktivoverflow

LINK DEPLOY
<br>
[http://overflow.anharfathoni.site/](http://overflow.anharfathoni.site/)

<br><br><br>

# REST-API 🔥
***
## Register
***
sign up with new user info
1. URL `http://localhost:3000/register`
2. Method `POST`
3. URL Param `not required`
4. Data Param
```javascript
{
"name": "anhar",
"email": "[email protected]",
"password": "1234",
}

```
5. Success Response
```javascript
CODE : 201 (Created)

CONTENT :
{
message: "success register, please login to continue"
}
```
6. Error Response
```javascript
CODE: 400

CONTENT:
{
message: "error message"
}
```
***
## Sign In Using Email
***
sign in while get an access token based on credentials
1. URL `localhost:3000/login`
2. Method `POST`
3. URL Param `not required`
4. Data Param
```javascript
{
"email": "[email protected]",
"password": "yourpassword",
}

```
5. Success Response
```javascript
CODE : 200

CONTENT :
{
message: "success login"
}
```
6. Error Response
```javascript
CODE: 400

CONTENT:
{
message: 'error message'
}
```

***
## Get All Question
***

1. URL `http://localhost:3000/questions`
2. Method `GET`
3. URL Param `not required`
4. Data Param
```javascript


```
5. Success Response
```javascript
CODE : 200

CONTENT :
{
"questions": [
{
"voteUp": [],
"voteDown": [],
"createdAt": "2019-01-30T16:26:58.899Z",
"updatedAt": "2019-01-30T16:30:17.178Z",
"tags": [
"aaa"
],
"answerId": [],
"_id": "5c51d0d11db72829dc98791b",
"title": "tanya dong ?",
"body": "SAS",
"userId": {},
"__v": 0
}
]
}
```
6. Error Response
```javascript
CODE: 400

CONTENT:
{
message: 'error message'
}
```

***
## Post Question
***

1. URL `http://localhost:3000/questions`
2. Method `POST`
3. URL Param `not required`
4. Data Param
```javascript
headers: {
token: <token>
},

data: {
title: '',
body: '',
tags: []
}

```
5. Success Response
```javascript
CODE : 200

CONTENT :
{
"question": {
"voteUp": [],
"voteDown": [],
"createdAt": "2019-01-30T16:58:28.062Z",
"updatedAt": "2019-01-30T16:58:28.062Z",
"tags": [
""
],
"answerId": [],
"_id": "5c51d7ebf6c64434ef24c893",
"title": "title1",
"body": "body1",
"userId": { ... },
"__v": 0
},
"message": "success post question"
}
```
6. Error Response
```javascript
CODE: 400

CONTENT:
{
message: 'error message'
}
```


***
## Get Answer
***

1. URL `http://localhost:3000/answers/`
2. Method `POST`
3. URL Param `:questionId`
4. Data Param
```javascript
headers: {
token: <token>
}
```
5. Success Response
```javascript
CODE : 200

CONTENT :
{
answer: [{
content: '',
userId: {},
questionId: {},
voteUp: [],
voteDown: [],
createdAt: Date,
updatedAt: Date
}]
}
```
6. Error Response
```javascript
CODE: 400

CONTENT:
{
message: 'error message'
}
```

***
## Post Answer
***

1. URL `http://localhost:3000/answers/`
2. Method `POST`
3. URL Param `:questionId`
4. Data Param
```javascript
headers: {
token: <token>
},
data: {
content: 'your answer'
}
```
5. Success Response
```javascript
CODE : 200

CONTENT :
{
"answer": {
"voteUp": [],
"voteDown": [],
"createdAt": "2019-01-30T16:58:28.067Z",
"updatedAt": "2019-01-30T16:58:28.067Z",
"_id": "5c51d99bf6c64434ef24c894",
"content": "your answer",
"questionId": "5c51d7ebf6c64434ef24c893",
"userId": "5c51d7ccf6c64434ef24c892",
"__v": 0
},
"message": "success post answer"
}
```
6. Error Response
```javascript
CODE: 400

CONTENT:
{
message: 'error message'
}
```
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 ie <= 8
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'
],
rules: {
'no-console': process.env.NODE_ENV === 'production' ? 'error' : 'off',
'no-debugger': process.env.NODE_ENV === 'production' ? 'error' : 'off'
},
parserOptions: {
parser: 'babel-eslint'
}
}
21 changes: 21 additions & 0 deletions client/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
.DS_Store
node_modules
/dist

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

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

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

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

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

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

### Run your tests
```
npm run test
```

### 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/app'
]
}
33 changes: 33 additions & 0 deletions client/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
{
"name": "client",
"version": "0.1.0",
"private": true,
"scripts": {
"serve": "vue-cli-service serve",
"build": "vue-cli-service build",
"lint": "vue-cli-service lint"
},
"dependencies": {
"@johmun/vue-tags-input": "^2.0.0",
"axios": "^0.18.0",
"bootstrap-vue": "^2.0.0-rc.11",
"moment": "^2.24.0",
"multer": "^1.4.1",
"sweetalert": "^2.1.2",
"vue": "^2.5.21",
"vue-google-signin-button": "^1.0.2",
"vue-router": "^3.0.1",
"vue-wysiwyg": "^1.7.2",
"vuex": "^3.0.1"
},
"devDependencies": {
"@vue/cli-plugin-babel": "^3.3.0",
"@vue/cli-plugin-eslint": "^3.3.0",
"@vue/cli-service": "^3.3.0",
"@vue/eslint-config-standard": "^4.0.0",
"babel-eslint": "^10.0.1",
"eslint": "^5.8.0",
"eslint-plugin-vue": "^5.0.0",
"vue-template-compiler": "^2.5.21"
}
}
5 changes: 5 additions & 0 deletions client/postcss.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
module.exports = {
plugins: {
autoprefixer: {}
}
}
Binary file added client/public/H-logo2.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added client/public/favicon.ico
Binary file not shown.
Binary file added client/public/hacktivoverflowLogo.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added client/public/hacktivoverflowLogo2.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading