A Flask web application that extracts health/nutrition articles from markdown files, imports them into a SQLite database with full citation linking, and provides an alchemy-style interface for combining healing items into protocols.
- Article Management: Browse, search, and view health/nutrition articles with full citation support
- Alchemy Builder: Combine healing items from different categories to create custom protocols
- Protocol Management: Create, edit, view, and delete user-created protocols
- Citation Linking: Granular citation linking at sentence, paragraph, and bullet-point level
- Full-Text Search: Search articles using SQLite FTS5
alchemy-app/
├── database/ # Database schema
├── parser/ # Markdown parsing modules
├── import/ # Data import scripts
├── app/ # Flask application
├── templates/ # Jinja2 templates
├── static/ # CSS, JS, images
├── requirements.txt # Python dependencies
└── README.md # This file
-
Install dependencies:
pip install -r requirements.txt
-
Initialize the database:
python -m import.import_articles --init --db health.db
-
Import articles:
python -m import.import_articles --db health.db --articles ../site/source/_posts/Natural\ Healing -
Run the Flask application:
export FLASK_APP=app export FLASK_ENV=development flask run
Or using Python:
python run.py
The import script scans the Natural Healing directory and parses all markdown files:
python -m import.import_articles --db health.db --articles ../site/source/_posts/Natural\ HealingOptions:
--db: Database file path (default:health.db)--articles: Path to Natural Healing articles directory--init: Initialize database schema (run once)
- Navigate to the Alchemy Builder page
- Search and select items from the sidebar
- Add items to your protocol
- Enter a protocol name and description
- Click "Create Protocol"
- View all protocols on the Protocols page
- Click on a protocol to see its details and combined properties
- Edit or delete user-created protocols (predefined protocols are read-only)
The database includes the following main tables:
articles- Main article informationcategories- Category hierarchytags- Article tagscitations- Citation/reference informationcontent_blocks- Granular content units with citation linkshealing_properties- Healing properties with hierarchytreatments- Disease/symptom treatmentscomposition_items- Chemical constituentssynergistic_relationships- Synergistic combinationsprotocols- User-created and predefined protocolsprotocol_items- Items in protocols
GET /api/articles- Get all articlesGET /api/article/<slug>- Get article by slugPOST /api/protocol/create- Create a new protocolPOST /api/protocol/<id>/add-item- Add item to protocolDELETE /api/protocol/<id>/remove-item/<item_id>- Remove item from protocolGET /api/protocol/<id>/combined- Get combined properties for protocol
The application uses:
- Flask for the web framework
- SQLite for the database
- Jinja2 for templating
- python-frontmatter for parsing markdown frontmatter
See LICENSE file in the parent directory.