Skip to content
This repository was archived by the owner on Apr 9, 2022. It is now read-only.

Commit 2bbe2aa

Browse files
committed
initial commit
0 parents  commit 2bbe2aa

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

77 files changed

+2480
-0
lines changed

Makefile

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
clean:
2+
find . -name \*.pyc -o -name -delete
3+
find . -name \*.pyo -o -name -delete
4+
find . -name __pycache__ -o -name -delete
5+
find . -path "./server/server/api/migrations/*.py" -not -name "__init__.py" -o -name -delete
6+
rm -f server/db.sqlite3
7+
8+
database:
9+
./server/manage.py makemigrations api --noinput
10+
./server/manage.py migrate --noinput
11+
12+
fixtures:
13+
./server/manage.py createsuperuser --username=root --email=root@example.com --noinput
14+
./server/manage.py create_fixtures
15+
16+
client/node_modules:
17+
npm --prefix=./client install
18+
19+
client-dist: client/node_modules
20+
npm --prefix=./client run build
21+
22+
server-dev:
23+
./server/manage.py runserver --settings=server.settings
24+
25+
all: clean database fixtures client-dist server-dev

README.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
VueJS and django-rest-auth
2+
========================================================================
3+
An example [VueJS](https://github.com/vuejs/vue) project featuring an authentication and registration flow using endpoints from [django-rest-auth](https://github.com/Tivix/django-rest-auth).
4+
5+
* [client](client)
6+
* [server](server)

client/.babelrc

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
{
2+
"presets": [
3+
["env", {
4+
"modules": false,
5+
"targets": {
6+
"browsers": ["> 1%", "last 2 versions", "not ie <= 8"]
7+
}
8+
}],
9+
"stage-2"
10+
],
11+
"plugins": ["transform-vue-jsx", "transform-runtime"],
12+
"env": {
13+
"test": {
14+
"presets": ["env", "stage-2"],
15+
"plugins": ["transform-vue-jsx", "istanbul"]
16+
}
17+
}
18+
}

client/.editorconfig

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
root = true
2+
3+
[*]
4+
charset = utf-8
5+
indent_style = space
6+
indent_size = 2
7+
end_of_line = lf
8+
insert_final_newline = true
9+
trim_trailing_whitespace = true

client/.eslintignore

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
/build/
2+
/config/
3+
/dist/
4+
/*.js
5+
/test/unit/coverage/

client/.eslintrc.js

Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
// https://eslint.org/docs/user-guide/configuring
2+
3+
module.exports = {
4+
root: true,
5+
parser: 'babel-eslint',
6+
parserOptions: {
7+
sourceType: 'module'
8+
},
9+
env: {
10+
browser: true,
11+
},
12+
extends: 'airbnb-base',
13+
// required to lint *.vue files
14+
plugins: [
15+
'html'
16+
],
17+
// check if imports actually resolve
18+
settings: {
19+
'import/resolver': {
20+
webpack: {
21+
config: 'build/webpack.base.conf.js'
22+
}
23+
}
24+
},
25+
// add your custom rules here
26+
rules: {
27+
// don't require .vue extension when importing
28+
'import/extensions': ['error', 'always', {
29+
js: 'never',
30+
vue: 'never'
31+
}],
32+
// disallow reassignment of function parameters
33+
// disallow parameter object manipulation except for specific exclusions
34+
'no-param-reassign': ['error', {
35+
props: true,
36+
ignorePropertyModificationsFor: [
37+
'state', // for vuex state
38+
'acc', // for reduce accumulators
39+
'e' // for e.returnvalue
40+
]
41+
}],
42+
// allow optionalDependencies
43+
'import/no-extraneous-dependencies': ['error', {
44+
optionalDependencies: ['test/unit/index.js']
45+
}],
46+
// allow debugger during development
47+
'no-debugger': process.env.NODE_ENV === 'production' ? 'error' : 'off'
48+
}
49+
}

client/.gitignore

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
.DS_Store
2+
node_modules/
3+
/dist/
4+
npm-debug.log*
5+
yarn-debug.log*
6+
yarn-error.log*
7+
/test/unit/coverage/
8+
/test/e2e/reports/
9+
selenium-debug.log
10+
11+
# Editor directories and files
12+
.idea
13+
.vscode
14+
*.suo
15+
*.ntvs*
16+
*.njsproj
17+
*.sln

client/.postcssrc.js

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
// https://github.com/michael-ciniawsky/postcss-load-config
2+
3+
module.exports = {
4+
"plugins": {
5+
// to edit target browsers: use "browserslist" field in package.json
6+
"postcss-import": {},
7+
"autoprefixer": {}
8+
}
9+
}

client/README.md

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
# client development
2+
3+
``` bash
4+
# install dependencies
5+
npm install
6+
7+
# serve with auto-reload at localhost:8080
8+
npm run dev
9+
10+
# build for production with minification
11+
npm run build
12+
13+
# build for production and view the bundle analyzer report
14+
npm run build --report
15+
16+
# run unit tests
17+
npm run unit
18+
19+
# run e2e tests
20+
npm run e2e
21+
22+
# run all tests
23+
npm test
24+
```
25+
26+
For more details on the build setup see [guide](http://vuejs-templates.github.io/webpack/) and [docs for vue-loader](http://vuejs.github.io/vue-loader).

client/build/build.js

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
'use strict'
2+
require('./check-versions')()
3+
4+
process.env.NODE_ENV = 'production'
5+
6+
const ora = require('ora')
7+
const rm = require('rimraf')
8+
const path = require('path')
9+
const chalk = require('chalk')
10+
const webpack = require('webpack')
11+
const config = require('../config')
12+
const webpackConfig = require('./webpack.prod.conf')
13+
14+
const spinner = ora('building for production...')
15+
spinner.start()
16+
17+
rm(path.join(config.build.assetsRoot, config.build.assetsSubDirectory), err => {
18+
if (err) throw err
19+
webpack(webpackConfig, (err, stats) => {
20+
spinner.stop()
21+
if (err) throw err
22+
process.stdout.write(stats.toString({
23+
colors: true,
24+
modules: false,
25+
children: false, // if you are using ts-loader, setting this to true will make tyescript errors show up during build
26+
chunks: false,
27+
chunkModules: false
28+
}) + '\n\n')
29+
30+
if (stats.hasErrors()) {
31+
console.log(chalk.red(' Build failed with errors.\n'))
32+
process.exit(1)
33+
}
34+
35+
console.log(chalk.cyan(' Build complete.\n'))
36+
console.log(chalk.yellow(
37+
' Tip: built files are meant to be served over an HTTP server.\n' +
38+
' Opening index.html over file:// won\'t work.\n'
39+
))
40+
})
41+
})

0 commit comments

Comments
 (0)