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
Binary file added .DS_Store
Binary file not shown.
34 changes: 33 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1 +1,33 @@
# hacktivoverflow
# hacktivoverflow

**user router**

| No | Router | Method | Description
--- | --- | --- | ---
1 | /register | POST | Register a User
2 | /login | POST | Login User
3 | /verify | GET | Verify if Token Exist

**question router**

| No | Router | Method | Description
--- | --- | --- | ---
1 | / | POST | Add New Question
2 | /findall | GET | Get All Question
3 | /:id | GET | Get One Question
4 | /addvote/:id | POST | Add Vote Question
5 | /downvote/:id | POST | Remove Vote Question
6 | /:id | DELETE | Remove Question
7 | /:id | PUT | Update a Question
8 | /best/:id | PUT | Add Best Answer

**answer routers**

| No | Router | Method | Description
--- | --- | --- | ---
1 | /:id | POST | Add New Answer
2 | /voteup/:id | POST | Add Vote Answer
3 | /votedown/:id | POST | Remove Vote Question
4 | /:id | GET | Get One Answer
5 | /:id | PUT | Update an Answer
6 | /:id | delete | Delete an Answer
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
```
yarn install
```

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

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

### Run your tests
```
yarn run test
```

### Lints and fixes files
```
yarn 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'
]
}
32 changes: 32 additions & 0 deletions client/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
{
"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": {
"@ckeditor/ckeditor5-build-classic": "^12.0.0",
"@ckeditor/ckeditor5-vue": "^1.0.0-beta.1",
"axios": "^0.18.0",
"bootstrap": "^4.3.1",
"jquery": "^3.3.1",
"popper.js": "^1.14.7",
"sweetalert": "^2.1.2",
"vue": "^2.6.6",
"vue-router": "^3.0.1",
"vuex": "^3.0.1"
},
"devDependencies": {
"@vue/cli-plugin-babel": "^3.5.0",
"@vue/cli-plugin-eslint": "^3.5.0",
"@vue/cli-service": "^3.5.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/favicon.ico
Binary file not shown.
17 changes: 17 additions & 0 deletions client/public/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width,initial-scale=1.0">
<link rel="icon" href="./favicon.ico">
<title>client</title>
</head>
<body>
<noscript>
<strong>We're sorry but client doesn't work properly without JavaScript enabled. Please enable it to continue.</strong>
</noscript>
<div id="app"></div>
<!-- built files will be auto injected -->
</body>
</html>
49 changes: 49 additions & 0 deletions client/src/App.vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
<template>
<div id="app">
<MainNavbar></MainNavbar>
<div class="main">
<transition
name="fade"
mode="out-in"
>
<router-view/>
</transition>
</div>
<MainFooter></MainFooter>
</div>
</template>

<script>
import MainNavbar from '@/components/Navbar.vue'
import MainFooter from '@/components/Footer.vue'
export default {
name: 'app',
components: {
MainNavbar,
MainFooter
}
}
</script>


<style>
#app {
font-family: 'Roboto', sans-serif;
-webkit-font-smoothing: antialiased;
-moz-osx-font-smoothing: grayscale;
max-width: 100%;
}

.fade-enter-active,
.fade-leave-active {
transition-duration: 0.3s;
transition-property: opacity;
transition-timing-function: ease;
}

.fade-enter,
.fade-leave-active {
opacity: 0
}

</style>
Binary file added client/src/assets/icon/down.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/src/assets/icon/login.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/src/assets/icon/register.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/src/assets/icon/true.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/src/assets/icon/up.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/src/assets/logo.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/src/assets/logo/logo-overflow.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
24 changes: 24 additions & 0 deletions client/src/components/Footer.vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
<template>
<div class="footer">
<div>Copyright © 2019 fender13 - All Rights Reserved </div>
</div>
</template>

<script>
export default {
name: 'MainFooter'
}
</script>

<style scoped>
.footer {
margin-top: 10%;
right: 0;
bottom: 0;
left: 0;
padding: 1rem;
background-color: black;
text-align: center;
color: white;
}
</style>
64 changes: 64 additions & 0 deletions client/src/components/Navbar.vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
<template>
<div class="navbar-container">
<div>
<nav class="navbar navbar-expand-lg navbar-light bg-light justify-content-between">
<div class="navbar-header">
<router-link to="/"><img src="../assets/logo/logo-overflow.png" alt="Hacktiv-Overflow"></router-link>
<button class="navbar-toggler" type="button" data-toggle="collapse" data-target="#navbarSupportedContent" aria-controls="navbarSupportedContent" aria-expanded="false" aria-label="Toggle navigation">
<span class="navbar-toggler-icon"></span>
</button>
</div>

<div class="collapse navbar-collapse" id="navbarSupportedContent">
<ul class="nav navbar-nav ml-auto">
<li class="nav-item">
<router-link to="/dashboard"><a class="nav-link" v-if="isLogin">Dashboard</a></router-link>
</li>
<li class="nav-item" v-if="!isLogin">
<router-link to="/login"><a class="nav-link">Login</a></router-link>
</li>
<li class="nav-item" v-if="isLogin">
<a class="nav-link" href="#" @click.prevent="onClickLogout">Logout</a>
</li>
</ul>
</div>
</nav>
</div>
</div>
</template>

<script>
export default {
name: 'MainNavbar',
computed: {
isLogin() {
return this.$store.getters.isLogin
}
},
methods: {
onClickLogout() {
this.$store.dispatch('userLogout')
}
}
}
</script>

<style scoped>
* {
margin: 0;
padding: 0;
}

.navbar-container {
max-width: 100%;
}

img {
width: 130px;
}

a:active {
border: none;
}

</style>
8 changes: 8 additions & 0 deletions client/src/database/server.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
import axios from 'axios'

var axi = axios.create({
baseURL: 'http://localhost:8081',
headers: {'token': localStorage.getItem('token')}
})

export default axi
24 changes: 24 additions & 0 deletions client/src/main.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
import Vue from 'vue'
import App from './App.vue'
import router from './router'
import store from './store'

import 'bootstrap'
import 'bootstrap/dist/css/bootstrap.min.css'

import CKEditor from '@ckeditor/ckeditor5-vue'

Vue.use( CKEditor )

Vue.config.productionTip = false

new Vue({
store,
router,
created() {
this.$store.dispatch('verifyToken', {
isToken: localStorage.getItem('token')
})
},
render: h => h(App)
}).$mount('#app')
Loading