*NOTE: This project integrates with my other [asl-rulebook2](https://github.com/pacman-ghost/asl-rulebook2) project. Add a setting to your `site.cfg` e.g.*
*NOTE: This project integrates with my other [asl-rulebook2](https://code.pacman-ghost.com/public/asl-rulebook2) project. Add a setting to your `site.cfg` e.g.*
```
```
ASLRB_BASE_URL = http://localhost:5020
ASLRB_BASE_URL = http://localhost:5020
```
```
*and references to rules will be converted to clickable links that will open the ASLRB at that rule.*
### To create a new database
*NOTE: This requires the Python environment to have been set up (see the developer notes below).*
Go to the *alembic/* directory and change the database connection string in *alembic.ini* e.g.
*NOTE: You will need Docker >= 17.05 (for multi-stage builds)*, and `docker-compose`.
*NOTE: You will need Docker >= 17.05 (for multi-stage builds)*, and `docker-compose`.
@ -55,17 +37,15 @@ It is possible to configure publications and their articles so that clicking the
For security reasons, browsers don't allow *file://* links to PDF's, they must be served by a web server. This program supports this, but some things need to be set up first.
For security reasons, browsers don't allow *file://* links to PDF's, they must be served by a web server. This program supports this, but some things need to be set up first.
When you run the application, specify the top-level directory that contains your PDF's in the command line e.g.
When you run the application, specify the top-level directory that contains your PDF's in the command line e.g.
```
```
./run-containers.sh \
./run-containers.sh \
-d /home/pacman-ghost/asl-articles.db \
-d /home/pacman-ghost/asl-articles.db \
-e /home/pacman-ghost/asl-articles-docs/
-e /home/pacman-ghost/asl-articles-docs/
```
```
Then, configure your document paths *relative to that directory*.
Then, configure your document paths *relative to that directory*.
For example, say I have my files organized like this:
For example, say I have my files organized like this:
```
```
* /home/pacman-ghost/
* /home/pacman-ghost/
+-- asl-articles.db
+-- asl-articles.db
@ -87,14 +67,16 @@ The application is split over 2 Docker containers, one running a React front-end
##### Setting up the Flask (Python) back-end
##### Setting up the Flask (Python) back-end
Create a *virtualenv*, then go to the *asl_articles/* directory and install the requirements:
Create a *virtualenv*, then go to the *asl_articles/* directory and install the requirements:
```
```pip install -e .[dev]```
pip install -e .[dev]
```
Copy *config/site.cfg.example* to *config/site.cfg*, and update it to point to your database.
Copy *config/site.cfg.example* to *config/site.cfg*, and update it to point to your database.
Then run the server:
Then run the server:
```
```./run-server.py```
./run-server.py
```
You can test if things are working by opening a browser and going to http://localhost:5000/ping
You can test if things are working by opening a browser and going to http://localhost:5000/ping
@ -103,9 +85,11 @@ You can test if things are working by opening a browser and going to http://loca
##### Setting up the React front-end
##### Setting up the React front-end
Go to the *web/* directory and install the requirements:
Go to the *web/* directory and install the requirements: