blob: 5f3fa7a71a01a5e98288f3f9258c8d711a2766d5 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
|
# Swimmer
Network-based tile tool.
## Installation
First, install miniconda and node.
```
conda create env -f environment.yml
yarn install
```
(this should work on Linux as well but let me know if it doesn't)
## Running the site
Before running the commands, enter the client directory, load the Conda environment, and make sure the database is current:
```
cd cli
conda activate swimmer
./cli.py db upgrade head
```
Then build the frontend and run the Flask server:
```
yarn build:dev
yarn server
```
The server will be running on http://0.0.0.0:5000/
## Development
Monitor the Javascript for changes (run in another window):
```
yarn watch
```
Generate a new migration if you've modified the database:
```
./cli.py db revision --autogenerate -m 'describe the changes'
./cli.py db upgrade head
```
Run the frontend demo flask server (port 3000):
```
yarn demo
```
To programmatically create pages, modify `cli/commands/site/populate.py`
## Customizing builds
If the functionality of the live site needs to change, make a new router and go from there. See `frontend/site/projects/museum/app.js` for an example.
```
# Building the Last Museum site (development)
yarn build:museum:dev
# Deploying the Last Museum site (production)
yarn build:museum:production
rsync -rlptuvz ./data_store/exports/last-museum/ lens@garden:swimmer/data_store/exports/last-museum/
```
|