summaryrefslogtreecommitdiff
path: root/animism-align
diff options
context:
space:
mode:
Diffstat (limited to 'animism-align')
-rw-r--r--animism-align/README.md10
-rw-r--r--animism-align/cli/app/sql/common.py1
-rw-r--r--animism-align/cli/app/sql/env.py1
-rw-r--r--animism-align/cli/app/sql/models/annotation.py2
-rw-r--r--animism-align/cli/app/sql/models/paragraph.py2
-rw-r--r--animism-align/cli/app/sql/models/user.py33
-rw-r--r--animism-align/cli/app/sql/versions/202103021415_add_user_table.py31
-rw-r--r--animism-align/environment.yml23
8 files changed, 88 insertions, 15 deletions
diff --git a/animism-align/README.md b/animism-align/README.md
index d768355..ae3fd39 100644
--- a/animism-align/README.md
+++ b/animism-align/README.md
@@ -39,7 +39,6 @@ npm run build
The server will be running on http://0.0.0.0:5000/
-
## Development
Monitor the Javascript for changes (run in another window):
@@ -57,16 +56,16 @@ Generate a new migration if you've modified the database:
## Export
-For production, export a static version of the episode. This will make an exported folder in `data_store/exports/` which you can zip and upload somewhere.
+For production, export a static version of the episode. This will make an exported folder in `data_store/exports/` which you can zip and upload somewhere.
```
./cli.py site export -o animism
./cli.py viewer run
```
-* The viewer will be running on e.g. http://0.0.0.0:5000/episode1/index.html
-* Currently no `index.html` resolution is performed.
-* For now, the site structure entails:
+- The viewer will be running on e.g. http://0.0.0.0:5000/episode1/index.html
+- Currently no `index.html` resolution is performed.
+- For now, the site structure entails:
```
/index.html # redirects to first episode
@@ -87,3 +86,4 @@ NODE_ENV=production node ./node_modules/webpack-cli/bin/cli.js --config ./webpac
- 2020.06 - Development begins
- 2020.10 - Audio re-recorded
- 2020.11 - Site launches with Episode 1
+- 2021.03 - Begin work on phase 2
diff --git a/animism-align/cli/app/sql/common.py b/animism-align/cli/app/sql/common.py
index 1061a46..10deda3 100644
--- a/animism-align/cli/app/sql/common.py
+++ b/animism-align/cli/app/sql/common.py
@@ -37,3 +37,4 @@ from app.sql.models.upload import Upload
from app.sql.models.media import Media
from app.sql.models.episode import Episode
from app.sql.models.venue import Venue
+from app.sql.models.user import User
diff --git a/animism-align/cli/app/sql/env.py b/animism-align/cli/app/sql/env.py
index 1f03a42..da29cf4 100644
--- a/animism-align/cli/app/sql/env.py
+++ b/animism-align/cli/app/sql/env.py
@@ -20,6 +20,7 @@ from app.sql.models.upload import Upload
from app.sql.models.media import Media
from app.sql.models.episode import Episode
from app.sql.models.venue import Venue
+from app.sql.models.user import User
def run_migrations_offline():
"""Run migrations in 'offline' mode.
diff --git a/animism-align/cli/app/sql/models/annotation.py b/animism-align/cli/app/sql/models/annotation.py
index 2b42eac..a22c941 100644
--- a/animism-align/cli/app/sql/models/annotation.py
+++ b/animism-align/cli/app/sql/models/annotation.py
@@ -10,7 +10,7 @@ from app.sql.common import db, Base, Session
from app.settings import app_cfg
class Annotation(Base):
- """Table for storing references to graphs"""
+ """Table for storing references to annotations"""
__tablename__ = 'annotation'
id = Column(Integer, primary_key=True)
type = Column(String(16, convert_unicode=True), nullable=False)
diff --git a/animism-align/cli/app/sql/models/paragraph.py b/animism-align/cli/app/sql/models/paragraph.py
index 790c9f0..5623db0 100644
--- a/animism-align/cli/app/sql/models/paragraph.py
+++ b/animism-align/cli/app/sql/models/paragraph.py
@@ -10,7 +10,7 @@ from app.sql.common import db, Base, Session
from app.settings import app_cfg
class Paragraph(Base):
- """Table for storing references to graphs"""
+ """Table for storing paragraphs, which contain annotations"""
__tablename__ = 'paragraph'
id = Column(Integer, primary_key=True)
type = Column(String(16, convert_unicode=True), nullable=False)
diff --git a/animism-align/cli/app/sql/models/user.py b/animism-align/cli/app/sql/models/user.py
new file mode 100644
index 0000000..bbc6eef
--- /dev/null
+++ b/animism-align/cli/app/sql/models/user.py
@@ -0,0 +1,33 @@
+from sqlalchemy import create_engine, Table, Column, Text, String, Integer, Boolean, Float, DateTime, JSON, ForeignKey
+from sqlalchemy.orm import relationship
+import sqlalchemy.sql.functions as func
+from sqlalchemy_utc import UtcDateTime, utcnow
+from wtforms_alchemy import ModelForm
+
+from app.sql.common import db, Base, Session
+
+from app.settings import app_cfg
+
+class User(Base):
+ """Table for storing the user list"""
+ __tablename__ = 'user'
+ id = Column(Integer, primary_key=True)
+ username = Column(String(256, convert_unicode=True), nullable=False)
+ password = Column(String(256, convert_unicode=True), nullable=False)
+ is_admin = Column(Boolean, default=False)
+ settings = Column(JSON, default={}, nullable=True)
+
+ def toJSON(self):
+ return {
+ 'id': self.id,
+ 'username': self.username,
+ 'is_admin': self.is_admin,
+ 'settings': self.settings,
+ }
+
+class UserForm(ModelForm):
+ class Meta:
+ model = User
+ exclude = ['settings']
+ def get_session():
+ return Session()
diff --git a/animism-align/cli/app/sql/versions/202103021415_add_user_table.py b/animism-align/cli/app/sql/versions/202103021415_add_user_table.py
new file mode 100644
index 0000000..8e0d70f
--- /dev/null
+++ b/animism-align/cli/app/sql/versions/202103021415_add_user_table.py
@@ -0,0 +1,31 @@
+"""add user table
+
+Revision ID: 5de5fdfbe69a
+Revises: a21872d09bbc
+Create Date: 2021-03-02 14:15:43.084353
+
+"""
+from alembic import op
+import sqlalchemy as sa
+import sqlalchemy_utc
+
+
+# revision identifiers, used by Alembic.
+revision = '5de5fdfbe69a'
+down_revision = 'a21872d09bbc'
+branch_labels = None
+depends_on = None
+
+
+def upgrade():
+ op.create_table('user',
+ sa.Column('id', sa.Integer(), nullable=False),
+ sa.Column('username', sa.String(length=256, _expect_unicode=True), nullable=False),
+ sa.Column('password', sa.String(length=256, _expect_unicode=True), nullable=False),
+ sa.Column('is_admin', sa.Boolean(), nullable=True),
+ sa.Column('settings', sa.JSON(), nullable=True),
+ sa.PrimaryKeyConstraint('id')
+ )
+
+def downgrade():
+ op.drop_table('user')
diff --git a/animism-align/environment.yml b/animism-align/environment.yml
index 92fb95c..0096a28 100644
--- a/animism-align/environment.yml
+++ b/animism-align/environment.yml
@@ -2,14 +2,15 @@ name: animism
channels:
- defaults
dependencies:
- - ca-certificates=2019.5.15=1
- - certifi=2019.6.16=py37_1
+ - ca-certificates=2020.6.24=0
+ - certifi=2020.6.20=py37_0
+ - chardet=3.0.4=py37_1003
- libcxx=4.0.1=hcfea43d_1
- libcxxabi=4.0.1=hcfea43d_1
- libedit=3.1.20181209=hb402a30_0
- libffi=3.2.1=h475c297_4
- ncurses=6.1=h0a44026_1
- - openssl=1.1.1c=h1de35cc_1
+ - openssl=1.1.1g=h1de35cc_0
- pip=19.1.1=py37_0
- python=3.7.3=h359304d_0
- readline=7.0=h1de35cc_5
@@ -27,7 +28,6 @@ dependencies:
- billiard==3.6.0.0
- celery==4.3.0
- cffi==1.14.0
- - chardet==3.0.4
- click==7.0
- colorlog==4.0.2
- cycler==0.10.0
@@ -36,8 +36,11 @@ dependencies:
- dnspython==1.16.0
- flask==1.1.1
- flask-classful==0.14.2
+ - flask-jwt==0.3.2
- flask-sqlalchemy==2.4.0
- flask-wtf==0.14.2
+ - future==0.18.2
+ - httplib2==0.18.1
- idna==2.8
- imageio==2.5.0
- imutils==0.5.2
@@ -62,20 +65,23 @@ dependencies:
- pdoc==0.3.2
- pillow==6.1.0
- pycparser==2.20
+ - pycurl==7.43.0
+ - pyjwt==1.4.2
- pyparsing==2.4.7
- python-dateutil==2.8.0
- python-dotenv==0.10.3
- python-editor==1.0.4
- pytz==2019.2
+ - pyvimeo==1.0.11
- pywavelets==1.1.1
- pyyaml==5.1.2
- - requests==2.22.0
+ - requests==2.24.0
- resampy==0.2.2
- scikit-image==0.15.0
- scikit-learn==0.23.1
- scipy==1.3.0
- simplejson==3.16.0
- - six==1.12.0
+ - six==1.10.0
- soundfile==0.10.3.post1
- sqlalchemy==1.3.6
- sqlalchemy-utc==0.10.0
@@ -83,11 +89,12 @@ dependencies:
- sqlparse==0.3.0
- tempita==0.5.2
- threadpoolctl==2.1.0
+ - tinydb==4.1.1
- tqdm==4.32.2
- - urllib3==1.25.3
+ - tuspy==0.2.1
+ - urllib3==1.25.9
- validators==0.13.0
- vine==1.3.0
- - PyVimeo==1.0.11
- werkzeug==0.15.5
- wtforms==2.2.1
- wtforms-alchemy==0.16.9