Skip to content

Commit e03b9de

Browse files
authored
Merge pull request doccano#341 from chakki-works/dev-frontend
Supporting mobile annotation
2 parents da8534d + 231cc5f commit e03b9de

File tree

158 files changed

+18085
-0
lines changed

Some content is hidden

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

158 files changed

+18085
-0
lines changed

app/.dockerignore

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
**/bundle/
2+
**/node_modules/
3+
**/webpack-stats.json
4+
5+
**/*.sqlite3
6+
**/.env
7+
**/junitxml/
8+
**/staticfiles/
9+
**/venv/
10+
**/__pycache__/

app/Dockerfile

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
FROM python:3.6
2+
3+
# set work directory
4+
WORKDIR /app
5+
6+
# set environment variables
7+
ENV PYTHONDONTWRITEBYTECODE 1
8+
ENV PYTHONUNBUFFERED 1
9+
10+
# install psycopg2 dependencies
11+
RUN apt-get update \
12+
&& apt-get install --no-install-recommends -y python3-dev libpq-dev unixodbc-dev
13+
14+
# install dependencies
15+
RUN pip install --upgrade pip setuptools
16+
COPY ./requirements.txt /app/requirements.txt
17+
RUN pip install --no-cache-dir -r requirements.txt
18+
19+
# copy project
20+
COPY . /app/

app/requirements.txt

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
apache-libcloud==2.4.0
2+
applicationinsights==0.11.7
3+
colour==0.1.5
4+
chardet==3.0.4
5+
coverage==4.5.3
6+
dj-database-url==0.5.0
7+
Django==2.1.11
8+
django-cloud-browser==0.5.0
9+
django-filter==2.0.0
10+
django-heroku==0.3.1
11+
django-webpack-loader==0.6.0
12+
django-widget-tweaks==1.4.2
13+
django-polymorphic==2.0.3
14+
django-pyodbc-azure==2.1.0.0
15+
django-rest-polymorphic==0.1.8
16+
djangorestframework==3.10
17+
djangorestframework-csv==2.1.0
18+
djangorestframework-filters==0.10.2
19+
environs==4.1.0
20+
djangorestframework-xml==1.4.0
21+
Faker==0.9.1
22+
flake8==3.6.0
23+
furl==2.0.0
24+
gunicorn==19.9.0
25+
lockfile==0.12.2
26+
mixer==6.1.3
27+
model-mommy==1.6.0
28+
psycopg2-binary==2.7.7
29+
pyexcel==0.5.14
30+
pyexcel-xlsx==0.5.7
31+
python-dateutil==2.7.3
32+
pytz==2018.4
33+
requests==2.21.0
34+
six==1.11.0
35+
seqeval==0.0.6
36+
social-auth-app-django==3.1.0
37+
social-auth-core[azuread]==3.0.0
38+
text-unidecode==1.2
39+
tornado==5.0.2
40+
unittest-xml-reporting==2.5.1
41+
vcrpy==2.0.1
42+
vcrpy-unittest==0.1.7
43+
whitenoise[brotli]==4.1.2
44+
conllu==1.3.2

app/tools/run.sh

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
#!/usr/bin/env bash
2+
3+
set -o errexit
4+
5+
if [[ ! -d "staticfiles" ]]; then
6+
echo "Making staticfiles"
7+
python manage.py collectstatic --noinput;
8+
fi
9+
10+
echo "Initializing database"
11+
python manage.py wait_for_db
12+
python manage.py migrate
13+
python manage.py create_roles
14+
15+
if [[ -n "${ADMIN_USERNAME}" ]] && [[ -n "${ADMIN_PASSWORD}" ]] && [[ -n "${ADMIN_EMAIL}" ]]; then
16+
python manage.py create_admin \
17+
--username "${ADMIN_USERNAME}" \
18+
--password "${ADMIN_PASSWORD}" \
19+
--email "${ADMIN_EMAIL}" \
20+
--noinput \
21+
|| true
22+
fi
23+
24+
echo "Starting django"
25+
gunicorn --bind 0.0.0.0:8000 app.wsgi --timeout 300

docker-compose.prod.yml

Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
version: "3"
2+
services:
3+
4+
backend:
5+
build: ./app
6+
command: ["/app/tools/run.sh", "0.0.0.0:8000"]
7+
volumes:
8+
- ./app/:/app/
9+
- static_volume:/app/staticfiles
10+
environment:
11+
ADMIN_USERNAME: "admin"
12+
ADMIN_PASSWORD: "password"
13+
ADMIN_EMAIL: "[email protected]"
14+
DATABASE_URL: "postgres://doccano:doccano@postgres:5432/doccano?sslmode=disable"
15+
ALLOW_SIGNUP: "False"
16+
depends_on:
17+
- postgres
18+
networks:
19+
- network-backend
20+
- network-frontend
21+
22+
frontend:
23+
build: ./frontend
24+
volumes:
25+
- www:/app/dist
26+
27+
nginx:
28+
build: ./nginx
29+
volumes:
30+
- www:/var/www/html:ro
31+
- static_volume:/static
32+
ports:
33+
- 80:80
34+
depends_on:
35+
- backend
36+
networks:
37+
- network-frontend
38+
39+
postgres:
40+
image: postgres:12.0-alpine
41+
volumes:
42+
- postgres_data:/var/lib/postgresql/data/
43+
environment:
44+
POSTGRES_USER: "doccano"
45+
POSTGRES_PASSWORD: "doccano"
46+
POSTGRES_DB: "doccano"
47+
networks:
48+
- network-backend
49+
50+
volumes:
51+
postgres_data:
52+
static_volume:
53+
www:
54+
55+
networks:
56+
network-backend:
57+
network-frontend:

frontend/.babelrc

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
{
2+
"env": {
3+
"test": {
4+
"presets": [
5+
[
6+
"@babel/preset-env",
7+
{
8+
"targets": {
9+
"node": "current"
10+
}
11+
}
12+
]
13+
]
14+
}
15+
}
16+
}

frontend/.dockerignore

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
**/bundle/
2+
**/node_modules/
3+
**/webpack-stats.json
4+
5+
**/.env
6+
**/coverage/

frontend/.eslintrc.js

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
module.exports = {
2+
root: true,
3+
env: {
4+
browser: true,
5+
node: true
6+
},
7+
parserOptions: {
8+
parser: 'babel-eslint'
9+
},
10+
extends: [
11+
'@nuxtjs',
12+
'plugin:nuxt/recommended'
13+
],
14+
// add your custom rules here
15+
rules: {
16+
"no-console": "off",
17+
"no-restricted-syntax": [
18+
"error",
19+
{
20+
"selector": "CallExpression[callee.object.name='console'][callee.property.name!=/^(log|warn|error|info|trace)$/]",
21+
"message": "Unexpected property on console object was called"
22+
}
23+
]
24+
}
25+
}

frontend/.gitignore

Lines changed: 88 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,88 @@
1+
# Created by .ignore support plugin (hsz.mobi)
2+
### Node template
3+
# Logs
4+
logs
5+
*.log
6+
npm-debug.log*
7+
yarn-debug.log*
8+
yarn-error.log*
9+
10+
# Runtime data
11+
pids
12+
*.pid
13+
*.seed
14+
*.pid.lock
15+
16+
# Directory for instrumented libs generated by jscoverage/JSCover
17+
lib-cov
18+
19+
# Coverage directory used by tools like istanbul
20+
coverage
21+
22+
# nyc test coverage
23+
.nyc_output
24+
25+
# Grunt intermediate storage (http://gruntjs.com/creating-plugins#storing-task-files)
26+
.grunt
27+
28+
# Bower dependency directory (https://bower.io/)
29+
bower_components
30+
31+
# node-waf configuration
32+
.lock-wscript
33+
34+
# Compiled binary addons (https://nodejs.org/api/addons.html)
35+
build/Release
36+
37+
# Dependency directories
38+
node_modules/
39+
jspm_packages/
40+
41+
# TypeScript v1 declaration files
42+
typings/
43+
44+
# Optional npm cache directory
45+
.npm
46+
47+
# Optional eslint cache
48+
.eslintcache
49+
50+
# Optional REPL history
51+
.node_repl_history
52+
53+
# Output of 'npm pack'
54+
*.tgz
55+
56+
# Yarn Integrity file
57+
.yarn-integrity
58+
59+
# dotenv environment variables file
60+
.env
61+
62+
# parcel-bundler cache (https://parceljs.org/)
63+
.cache
64+
65+
# next.js build output
66+
.next
67+
68+
# nuxt.js build output
69+
.nuxt
70+
71+
# Nuxt generate
72+
dist
73+
74+
# vuepress build output
75+
.vuepress/dist
76+
77+
# Serverless directories
78+
.serverless
79+
80+
# IDE / Editor
81+
.idea
82+
.editorconfig
83+
84+
# Service worker
85+
sw.*
86+
87+
# Mac OSX
88+
.DS_Store

frontend/Dockerfile

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
FROM node:13.1.0
2+
3+
# set work directory
4+
WORKDIR /app
5+
6+
# set environment variables
7+
# ENV PYTHONDONTWRITEBYTECODE 1
8+
9+
# copy project
10+
COPY . /app/
11+
12+
# install dependencies
13+
RUN npm install -g npm@latest
14+
RUN npm install
15+
16+
# build project
17+
RUN npm run build

frontend/README.md

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
# doccano-client
2+
3+
> doccano client
4+
5+
## Build Setup
6+
7+
``` bash
8+
# install dependencies
9+
$ yarn install
10+
11+
# serve with hot reload at localhost:3000
12+
$ yarn dev
13+
14+
# build for production and launch server
15+
$ yarn build
16+
$ yarn start
17+
18+
# generate static project
19+
$ yarn generate
20+
```
21+
22+
For detailed explanation on how things work, checkout [Nuxt.js docs](https://nuxtjs.org).

0 commit comments

Comments
 (0)