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

Christian Sihotang #11

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

Built with Express and Mongoose on server side. and built with Vue on client side


**Question Endpoints**


| METHOD | ENDPOINT | HEADERS | BODY | DESCRIPTION | SUCCESS | ERROR|
|--------|----------|---------|------|------------| -- | -- |
| POST | /question| `token` | title (string), description (string) | Create question | return New Question Object | return error|
| GET | /question | `none` | | Get All question | return All question | return error|
| GET | /question/:id | `none` | | Get One question | return One question | return error|
| GET | /question/user | `token` | | Get Specific User question | return questions | return error|
| PUT | /question/:id | `token` | title (string), description (string) | Update question | return Updated question Object | return error|
| PUT | /question/vote/:id | `token` | status(string between 'upvote' or 'downvote' ) | Update question vote | return Updated question Object | return error|
| DELETE | /question/:id | `token` | | Delete question | return Success | return error|


**Answer Endpoints**


| METHOD | ENDPOINT | HEADERS | BODY | DESCRIPTION | SUCCESS | ERROR|
|--------|----------|---------|------|------------| -- | -- |
| POST | /answer/:questionId| `token` | description (string) | Create answer | return New Answer Object | return error|
| GET | /answer | `token` | | Get All answer | return All answer | return error|
| GET | /answer/:id | `token` | | Get One answer | return One answer | return error|
| PUT | /answer/:id | `token` | description (string) | Update answer | return Updated answer Object | return error|
| PUT | /answer/vote/:id | `token` | status(string between 'upvote' or 'downvote' ) | Update answer vote | return Updated answer Object | return error|


**Users Endpoint**


| METHOD | ENDPOINT| HEADERS | BODY | DESCRIPTION | SUCCESS | ERROR|
|---------|---------|---------| ---------| --------- | -- | -- |
| POST | /users/register | `none` | username (string), email (string), password (string) | Create user | return User Object | return error|
| POST | /users/login | `none` |email (string), password (string) | Login user | return Token | return error|
### Usage
Make new file `.env` With Template:
```
JWT_SECRET = YOUR-SECRET-HERE
DBNAME = YOUR-DB-NAME-HERE
```

Make sure you have MongooDB, Node.js and npm installed in your computer, and then run these commands:

```
$ service mongod start
$ npm install
$ npm run dev
```
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'
]
}
Loading