mirror of https://github.com/doccano/doccano.git
Hironsan
4 years ago
16 changed files with 243 additions and 87 deletions
Unified View
Diff Options
-
73CONTRIBUTING.md
-
51README.md
-
21app/Dockerfile
-
10app/api/tests/test_api.py
-
3app/api/urls.py
-
11app/api/views.py
-
2app/requirements.txt
-
2app/server/static/assets/css/annotation.css
-
3app/server/static/components/annotation.pug
-
6app/server/static/package-lock.json
-
26docs/faq.md
-
84docs/project_structure.md
-
15frontend/Dockerfile
-
17frontend/components/organisms/layout/TheHeader.vue
-
4frontend/nuxt.config.js
-
2tools/install-mssql.sh
@ -0,0 +1,73 @@ |
|||||
|
# Contributing |
||||
|
|
||||
|
When contributing to this repository, please first discuss the change you wish to make via issue with the owners of this repository before making a change. |
||||
|
|
||||
|
Please note we have a code of conduct, please follow it in all your interactions with the project. |
||||
|
|
||||
|
## How to contribute to doccano |
||||
|
|
||||
|
### Reporting Bugs |
||||
|
|
||||
|
#### Before submitting a bug report |
||||
|
|
||||
|
* Check the [FAQs](https://github.com/doccano/doccano/blob/master/docs/faq.md) for a list of common questions and problems. |
||||
|
* Ensure the bug was not already reported by searching on GitHub under [Issues](https://github.com/doccano/doccano/issues). |
||||
|
* [Open a new issue](https://github.com/doccano/doccano/issues/new/choose) if you're unable to find an open one addressing the problem. |
||||
|
* Use the relevant bug report templates to create the issue. |
||||
|
|
||||
|
#### How do I submit a good bug report? |
||||
|
|
||||
|
Explain the problem and include additional details to help maintainers reproduce the problem: |
||||
|
|
||||
|
* Use a clear and descriptive title for the issue to identify the problem. |
||||
|
* Describe the exact steps which reproduce the problem in as many details as possible. |
||||
|
* Provide specific examples to demonstrate the steps. |
||||
|
* Describe the behavior you observed after following the steps and point out what exactly is the problem with that behavior. |
||||
|
* Explain which behavior you expected to see instead and why. |
||||
|
* Include screenshots and animated GIFs which show you following the described steps and clearly demonstrate the problem. |
||||
|
* If the problem is related to performance or memory, include a CPU profile capture with your report. |
||||
|
* If the problem is related to network, include a network activity in Chrome/Firefox/Safari DevTools. |
||||
|
* If the problem wasn't triggered by a specific action, describe what you were doing before the problem happened and share more information using the guidelines below. |
||||
|
|
||||
|
### Suggesting Enhancements |
||||
|
|
||||
|
#### Before submitting an enhancement suggestion |
||||
|
|
||||
|
* Ensure the suggestion was not already reported by searching on GitHub under [Issues](https://github.com/doccano/doccano/issues). |
||||
|
* [Open a new issue](https://github.com/doccano/doccano/issues/new/choose) if you're unable to find an open one addressing the suggestion. |
||||
|
* Use the relevant issue templates to create one. |
||||
|
|
||||
|
#### How do I submit a good enhancement suggestion? |
||||
|
|
||||
|
Explain the suggestion and include additional details to help developers understand it: |
||||
|
|
||||
|
* Use a clear and descriptive title for the issue to identify the suggestion. |
||||
|
* Provide a step-by-step description of the suggested enhancement in as many details as possible. |
||||
|
* Provide specific examples to demonstrate the steps. |
||||
|
* Describe the current behavior and explain which behavior you expected to see instead and why. |
||||
|
* Include screenshots and animated GIFs which help you demonstrate the steps or point out the part of doccano which the suggestion is related to. |
||||
|
* Explain why this enhancement would be useful to most doccano users. |
||||
|
* List some other annotation tools or applications where this enhancement exists. |
||||
|
* Specify which version of doccano you're using. |
||||
|
* Specify the name and version of the OS you're using. |
||||
|
|
||||
|
### Pull Request Process |
||||
|
|
||||
|
Please follow these steps to have your contribution considered by the maintainers: |
||||
|
|
||||
|
1. Open a related issue before making a pull request as much as possible. |
||||
|
2. Follow all instructions in [the template](PULL_REQUEST_TEMPLATE.md) |
||||
|
3. Follow the [styleguides](#styleguides) |
||||
|
4. After you submit your pull request, verify that all [status checks](https://help.github.com/articles/about-status-checks/) are passing <details><summary>What if the status checks are failing?</summary>If a status check is failing, and you believe that the failure is unrelated to your change, please leave a comment on the pull request explaining why you believe the failure is unrelated. A maintainer will re-run the status check for you. If we conclude that the failure was a false positive, then we will open an issue to track that problem with our status check suite.</details> |
||||
|
5. You may merge the Pull Request in once you have the sign-off of the project members([@Hironsan](https://github.com/Hironsan) or [@icoxfog417](https://github.com/icoxfog417)). |
||||
|
|
||||
|
While the prerequisites above must be satisfied prior to having your pull request reviewed, the reviewer(s) may ask you to complete additional design work, tests, or other changes before your pull request can be ultimately accepted. |
||||
|
|
||||
|
## Styleguides |
||||
|
|
||||
|
### Git Commit Messages |
||||
|
|
||||
|
* Use the present tense ("Add feature" not "Added feature") |
||||
|
* Use the imperative mood ("Move cursor to..." not "Moves cursor to...") |
||||
|
* Limit the first line to 72 characters or less |
||||
|
* Reference issues and pull requests liberally after the first line |
@ -1,20 +1,17 @@ |
|||||
FROM python:3.6 |
|
||||
|
FROM alpine:3.9.6 |
||||
|
|
||||
|
CMD ["python3"] |
||||
|
|
||||
# set work directory |
|
||||
WORKDIR /app |
WORKDIR /app |
||||
|
|
||||
# set environment variables |
|
||||
ENV PYTHONDONTWRITEBYTECODE 1 |
ENV PYTHONDONTWRITEBYTECODE 1 |
||||
ENV PYTHONUNBUFFERED 1 |
ENV PYTHONUNBUFFERED 1 |
||||
|
|
||||
# install psycopg2 dependencies |
|
||||
RUN apt-get update \ |
|
||||
&& apt-get install --no-install-recommends -y python3-dev libpq-dev unixodbc-dev |
|
||||
|
COPY . /app/ |
||||
|
|
||||
# install dependencies |
|
||||
RUN pip install --upgrade pip setuptools |
|
||||
COPY ./requirements.txt /app/requirements.txt |
|
||||
RUN pip install --no-cache-dir -r requirements.txt |
|
||||
|
RUN apk add -U bash python3 python3-dev libpq postgresql-dev unixodbc-dev musl-dev g++ libffi-dev \ |
||||
|
&& pip3 install --upgrade pip setuptools \ |
||||
|
&& pip3 install --no-cache-dir -r requirements.txt \ |
||||
|
&& ln -s /usr/bin/python3 /usr/bin/python \ |
||||
|
&& apk del python3-dev postgresql-dev unixodbc-dev musl-dev g++ libffi-dev |
||||
|
|
||||
# copy project |
|
||||
COPY . /app/ |
|
@ -1,70 +1,82 @@ |
|||||
# Project Structure |
# Project Structure |
||||
|
|
||||
In doccano v1.x, the application consists of a frontend and backend API. They are stored in the `frontend` and `app` directories. |
|
||||
|
The important files/directories are as follows: |
||||
|
|
||||
```bash |
|
||||
. |
|
||||
├── app |
|
||||
|
``` |
||||
|
/ |
||||
|
├── app/ |
||||
|
├── frontend/ |
||||
|
├── nginx/ |
||||
|
├── tools/ |
||||
├── docker-compose.dev.yml |
├── docker-compose.dev.yml |
||||
├── docker-compose.prod.yml |
|
||||
├── frontend |
|
||||
├── nginx |
|
||||
└── tools |
|
||||
|
└── docker-compose.prod.yml |
||||
``` |
``` |
||||
|
|
||||
The other important files/directories are as follows: |
|
||||
|
Consider them: |
||||
|
|
||||
|
**[app/](https://github.com/doccano/doccano/tree/master/app)** |
||||
|
|
||||
|
The `app/api` directory contains backend code. See [below](#Backend). |
||||
|
|
||||
- [docker-compose.dev.yml](https://github.com/doccano/doccano/blob/master/docker-compose.dev.yml) |
|
||||
- [docker-compose.prod.yml](https://github.com/doccano/doccano/blob/master/docker-compose.prod.yml) |
|
||||
- [nginx](https://github.com/doccano/doccano/tree/master/nginx) |
|
||||
- [tools](https://github.com/doccano/doccano/tree/master/tools) |
|
||||
|
**[frontend/](https://github.com/doccano/doccano/tree/master/frontend)** |
||||
|
|
||||
|
The `app/api` directory contains frontend code. See [below](#Frontend). |
||||
|
|
||||
**[docker-compose.dev.yml](https://github.com/doccano/doccano/blob/master/docker-compose.dev.yml)** |
**[docker-compose.dev.yml](https://github.com/doccano/doccano/blob/master/docker-compose.dev.yml)** |
||||
|
|
||||
The `docker-compose.dev.yml` file contains configuration to run a development environment. Once we run the command `docker-compose -f docker-compose.dev.yml up`, compose runs backend API and frontend development containers. |
|
||||
|
The `docker-compose.dev.yml` file contains [Docker Compose](https://docs.docker.com/compose) configuration to run a development environment. |
||||
|
Once we run the command `docker-compose -f docker-compose.dev.yml up`, compose runs backend API and frontend development containers. |
||||
|
|
||||
**[docker-compose.prod.yml](https://github.com/doccano/doccano/blob/master/docker-compose.prod.yml)** |
**[docker-compose.prod.yml](https://github.com/doccano/doccano/blob/master/docker-compose.prod.yml)** |
||||
|
|
||||
The `docker-compose.prod.yml` file contains configuration to run a production environment. We adopted the three tier architecture. Once we run the command `docker-compose -f docker-compose.prod.yml up`, compose builds frontend and runs DBMS, backend API and web server containers. |
|
||||
|
The `docker-compose.prod.yml` file contains [Docker Compose](https://docs.docker.com/compose) configuration to run a production environment. |
||||
|
We adopted the three tier architecture. Once we run the command `docker-compose -f docker-compose.prod.yml up`, compose builds frontend and runs DBMS, backend API and web server containers. |
||||
|
|
||||
**[nginx](https://github.com/doccano/doccano/tree/master/nginx)** |
**[nginx](https://github.com/doccano/doccano/tree/master/nginx)** |
||||
|
|
||||
The `nginx` directory contains a nginx configuration file and Docker container. They are used only in `docker-compose.prod.yml`. |
|
||||
|
The `nginx` directory contains a NGINX configuration file and Docker container. They are used only in `docker-compose.prod.yml`. |
||||
|
|
||||
**[tools](https://github.com/doccano/doccano/tree/master/tools)** |
**[tools](https://github.com/doccano/doccano/tree/master/tools)** |
||||
|
|
||||
The `tools` directory contains some shell scripts. They are used for CI, CD and so on. |
The `tools` directory contains some shell scripts. They are used for CI, CD and so on. |
||||
|
|
||||
## Frontend |
|
||||
|
|
||||
The directory structure of the frontend follows Nuxt.js one. See the Nuxt.js documentation for details: |
|
||||
|
Also, there are directories and files contain doccano v0.x codes. |
||||
|
In the future, they will be integrated into the currect code or removed: |
||||
|
|
||||
- [Nuxt.js/Directory Structure](https://nuxtjs.org/guide/directory-structure/) |
|
||||
|
``` |
||||
|
/ |
||||
|
├── app/ |
||||
|
├── └── server/ |
||||
|
└── docker-compose.yml |
||||
|
``` |
||||
|
|
||||
## Backend API |
|
||||
|
## Backend |
||||
|
|
||||
The directory structure of the backend api follows Django one. The important directories are as follows: |
|
||||
|
The directory structure of the backend follows [Django](https://www.djangoproject.com) one. |
||||
|
The important directories are as follows: |
||||
|
|
||||
```bash |
|
||||
. |
|
||||
├── api |
|
||||
├── app |
|
||||
├── authentification |
|
||||
└── server |
|
||||
|
``` |
||||
|
/ |
||||
|
├── app/ |
||||
|
├── ├── api/ |
||||
|
├── ├── app/ |
||||
|
└── └── authentification/ |
||||
``` |
``` |
||||
|
|
||||
**[app/api](https://github.com/doccano/doccano/tree/master/app/api)** |
|
||||
|
**[app/api/](https://github.com/doccano/doccano/tree/master/app/api)** |
||||
|
|
||||
The `api` directory contains backend API application. We use Django Rest Framework to implement the API. If you want to add new API, change the contents of this directory. |
|
||||
|
The `app/api` directory contains backend API application. We use [Django Rest Framework](https://www.django-rest-framework.org) to implement the API. |
||||
|
If you want to add new API, change the contents of this directory. |
||||
|
|
||||
**[app/app](https://github.com/doccano/doccano/tree/master/app/app)** |
|
||||
|
**[app/app/](https://github.com/doccano/doccano/tree/master/app/app)** |
||||
|
|
||||
The `app` directory contains Django project settings. See [Writing your first Django app, part 1](https://docs.djangoproject.com/en/3.0/intro/tutorial01/#creating-a-project). |
|
||||
|
The `app/app` directory contains Django project settings. See [Writing your first Django app, part 1](https://docs.djangoproject.com/en/3.0/intro/tutorial01/#creating-a-project). |
||||
|
|
||||
**[app/authentification](https://github.com/doccano/doccano/tree/master/app/authentification)** |
|
||||
|
**[app/authentification/](https://github.com/doccano/doccano/tree/master/app/authentification)** |
||||
|
|
||||
The `authentification` directory contains authentification application. It is mainly used for user signup. |
|
||||
|
The `app/authentification` directory contains authentification application. It is mainly used for user signup. |
||||
|
|
||||
**[app/server](https://github.com/doccano/doccano/tree/master/app/server)** |
|
||||
|
## Frontend |
||||
|
|
||||
The `server` directory contains doccano v0.x codes. In the future, this directory will be integrated into the `api` directory. |
|
||||
|
The `frontent` directory structure of the frontend follows [Nuxt.js](https://ru.nuxtjs.org) one. |
||||
|
See the [Nuxt.js documentation](https://nuxtjs.org/guide/directory-structure/) for details. |
@ -1,14 +1,11 @@ |
|||||
FROM node:13.2.0 |
|
||||
|
FROM node:13.2-alpine |
||||
|
|
||||
# set work directory |
|
||||
WORKDIR /app |
WORKDIR /app |
||||
|
|
||||
# copy project |
|
||||
COPY . /app/ |
COPY . /app/ |
||||
|
|
||||
# install dependencies |
|
||||
RUN npm install -g npm@latest |
|
||||
RUN npm install |
|
||||
|
|
||||
# build project |
|
||||
RUN npm run build |
|
||||
|
RUN apk add -U git python3 make g++ \ |
||||
|
&& npm install -g npm@latest \ |
||||
|
&& npm install \ |
||||
|
&& npm run build \ |
||||
|
&& apk del git make g++ |
Write
Preview
Loading…
Cancel
Save