Merge branch 'feature/no-nuxt'

This commit is contained in:
Ramon Wenger 2018-08-09 14:37:41 +02:00
commit 1efb11c4d6
19 changed files with 1233 additions and 3445 deletions

3
client/.gitignore vendored
View File

@ -12,6 +12,3 @@ yarn-error.log*
*.ntvs*
*.njsproj
*.sln
# Nuxt Build
.nuxt

View File

@ -35,6 +35,7 @@ module.exports = {
extensions: ['.js', '.vue', '.json', '.gql', '.graphql'],
alias: {
'@': resolve('src'),
'~': resolve('src'),
styles: resolve('styles')
}
},

18
client/index.html Normal file
View File

@ -0,0 +1,18 @@
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width,initial-scale=1.0">
<title>skillBox</title>
<link href='https://fonts.googleapis.com/css?family=Material+Icons' rel="stylesheet" type="text/css">
<link href="https://fonts.googleapis.com/css?family=Montserrat:500,800" rel="stylesheet">
</head>
<body>
<div id="app">
<div class="center">
</div>
</div>
<!-- built files will be auto injected -->
</body>
</html>

View File

@ -1,43 +0,0 @@
const webpack = require('webpack')
module.exports = {
build: {
plugins: [
new webpack.ProvidePlugin({
'_': 'lodash'
})
]
},
css: [
'~/assets/main.scss'
],
router: {
base: process.env.NODE_ENV === 'production' ? '/static/' : '/'
},
env: {
baseUrl: process.env.BASE_URL || 'http://localhost:3000'
},
head: {
link: [
{rel: 'stylesheet', href: 'https://fonts.googleapis.com/css?family=Montserrat:400,800'}
]
},
mode: 'spa',
modules: ['@nuxtjs/apollo'],
apollo: {
clientConfigs: {
default: {
httpEndpoint: 'http://localhost:8000/api/graphql/',
httpLinkOptions: {
credentials: 'same-origin'
},
}
}
},
plugins: [
'~plugins/vue-axios',
'~plugins/vue-vimeo-player'
],
srcDir: 'src/'
}

4484
client/package-lock.json generated

File diff suppressed because it is too large Load Diff

View File

@ -1,17 +1,16 @@
{
"name": "frontend",
"version": "1.0.0",
"description": "A Vue.js project",
"author": "maersu <me@maersu.ch>",
"description": "skillBox vue client",
"author": "pawel / ramon",
"private": true,
"scripts": {
"dev": "nuxt",
"build": "nuxt build",
"start": "nuxt start",
"heroku-postbuild": "npm run build"
"dev": "webpack-dev-server --inline --progress --config build/webpack.dev.conf.js",
"start": "npm run dev",
"lint": "eslint --ext .js,.vue src",
"build": "node build/build.js"
},
"dependencies": {
"@nuxtjs/apollo": "^4.0.0-rc1",
"apollo-cache-inmemory": "^1.2.2",
"apollo-client": "^2.3.2",
"apollo-link-http": "^1.5.4",
@ -49,7 +48,6 @@
"lodash": "^4.17.10",
"node-notifier": "^5.1.2",
"node-sass": "^4.9.2",
"nuxt": "^1.4.2",
"optimize-css-assets-webpack-plugin": "^3.2.0",
"ora": "^1.2.0",
"portfinder": "^1.0.13",
@ -57,12 +55,12 @@
"postcss-loader": "^2.0.8",
"postcss-url": "^7.2.1",
"rimraf": "^2.6.0",
"semver": "^5.3.0",
"sass-loader": "^7.1.0",
"semver": "^5.3.0",
"shelljs": "^0.7.6",
"uglifyjs-webpack-plugin": "^1.1.1",
"unfetch": "^3.1.1",
"url-loader": "^0.5.8",
"url-loader": "^1.0.1",
"uuid": "^3.2.1",
"vue": "^2.5.17",
"vue-apollo": "^3.0.0-beta.16",

View File

@ -19,8 +19,24 @@
</aside>
<main>
<nuxt/>
<router-view></router-view>
</main>
<footer>Footer</footer>
</div>
</template>
<script>
export default {
name: 'App',
data() {
return {}
},
mounted() {
}
}
</script>
<style lang="scss">
@import "styles/main";
@import "@/assets/main.scss";
</style>

View File

View File

@ -4,8 +4,11 @@
- https://seesparkbox.com/foundry/bem_by_example
*/
@import 'variables';
@import 'typography';
.container {
margin: 0 auto;
width: 100%;

View File

@ -1,6 +1,6 @@
<template>
<div class="module-teaser">
<img src="~/assets/maggie.jpg" alt="" class="module-teaser__image">
<img src="@/assets/maggie.jpg" alt="" class="module-teaser__image">
<div class="module-teaser__body">
<h3 class="module-teaser__meta-title">Modul 1</h3>
<h3 class="module-teaser__title">Mein neues Umfeld</h3>
@ -10,6 +10,8 @@
</template>
<style scoped lang="scss">
@import "@/assets/_variables.scss";
.module-teaser {
box-shadow: 0 3px 9px 0 rgba(0, 0, 0, 0.12);
border: 1px solid #E2E2E2;

29
client/src/main.js Normal file
View File

@ -0,0 +1,29 @@
import 'babel-polyfill'
import Vue from 'vue'
import axios from 'axios'
import VueAxios from 'vue-axios'
import VueVimeoPlayer from 'vue-vimeo-player'
import apolloClient from './graphql/client'
import VueApollo from 'vue-apollo'
import App from './App'
import router from './router'
import store from '@/store/index'
Vue.config.productionTip = false
Vue.use(VueApollo)
Vue.use(VueAxios, axios)
Vue.use(VueVimeoPlayer)
const apolloProvider = new VueApollo({
defaultClient: apolloClient
})
/* eslint-disable no-new */
new Vue({
el: '#app',
store,
router,
provide: apolloProvider.provide(),
render: h => h(App)
})

View File

@ -10,7 +10,7 @@
</template>
<script>
import ALL_MODULES from '~/graphql/gql/allModules'
import ALL_MODULES from '@/graphql/gql/allModules'
export default {
data() {

View File

@ -12,7 +12,7 @@
</template>
<script>
import ModuleTeaser from '~/components/ModuleTeaser.vue';
import ModuleTeaser from '@/components/ModuleTeaser.vue';
export default {
components: {

View File

@ -1,5 +0,0 @@
import axios from 'axios'
import VueAxios from 'vue-axios'
import Vue from 'vue'
Vue.use(VueAxios, axios)

View File

@ -1,4 +0,0 @@
import Vue from 'vue'
import VueVimeoPlayer from 'vue-vimeo-player'
Vue.use(VueVimeoPlayer)

View File

@ -0,0 +1,25 @@
import Vue from 'vue'
import Router from 'vue-router'
import Dashboard from '@/pages/PageDashboard'
import index from '@/pages/index'
import topic from '@/pages/topic'
import NotFound from '@/pages/PageNotFound'
const routerOptions = [
{path: '/', name: 'index', component: index},
{path: '/dashboard', name: 'dashboard', component: Dashboard},
{path: '/topic', name: 'topic', component: topic},
{path: '*', component: NotFound}
]
const routes = routerOptions.map(route => {
return {
...route
}
})
Vue.use(Router)
export default new Router({
routes,
mode: 'history'
})

12
client/vue.config.js Normal file
View File

@ -0,0 +1,12 @@
module.exports = {
css: {
loaderOptions: {
sass: {
data: `
@import "@/assets/_variables.scss";
@import "@/assets/main.scss";
`
}
}
}
};

View File

@ -94,7 +94,6 @@ if DEBUG:
MIDDLEWARE += ['corsheaders.middleware.CorsMiddleware']
CORS_ORIGIN_WHITELIST = (
'localhost:8080',
'localhost:3000',
)
CORS_ALLOW_CREDENTIALS = True
@ -201,7 +200,7 @@ STATIC_ROOT = os.path.join(BASE_DIR, 'static')
STATIC_URL = '/static/'
STATICFILES_DIRS = (
os.path.join(BASE_DIR, '..', 'client/dist'),
os.path.join(BASE_DIR, '..', 'client/dist/static'),
)
if not TEST:

View File

@ -17,8 +17,8 @@ class PrivateGraphQLView(LoginRequiredMixin, GraphQLView):
def home(request):
if settings.DEBUG:
try:
return HttpResponse(requests.get('http://localhost:3000/{}'.format(request.get_full_path())).text)
return HttpResponse(requests.get('http://localhost:8080/{}'.format(request.get_full_path())).text)
except Exception as e:
print('Can not connect to dev server at http://localhost:3000:', e)
print('Can not connect to dev server at http://localhost:8080:', e)
return render(request, 'index.html', {})