A Flask REST API for sharing Python utilities with a React frontend (in progress). The Flask backend exposes all features as JSON endpoints under /api/; the legacy Jinja2 views remain during the frontend transition.
├── acp_app/
│ ├── api/ REST API blueprints (JSON responses for React)
│ ├── services/ Business logic — no HTTP awareness
│ ├── views/ Legacy Jinja2 views (routes only, to be removed post-React)
│ ├── static/ CSS and images (legacy)
│ ├── templates/ Jinja2 HTML templates (legacy)
│ ├── data/
│ │ └── raw/ Source CSVs and XLS files for seeding the database
│ ├── commands.py Flask CLI commands (init-db, init-team, etc.)
│ ├── models.py SQLAlchemy ORM models
│ └── __init__.py App factory
├── instance/ SQLite database lives here (gitignored)
├── tests/
├── .env.example Template for environment variables
├── app.py Entry point
├── config.py Flask configuration classes
├── dev.sh Developer workflow script
├── requirements.txt
└── web.config wfastcgi config for IIS
| Method | Endpoint | Description |
|---|---|---|
| GET | /api/team |
Team members list |
| GET | /api/aspen/search/<term> |
Aspen IO + IP tag search |
| GET | /api/aspen/status |
Aspen IO status |
| GET | /api/intellution/<term>?col=tag |
Intellution tag search |
| POST | /api/gcc/eos |
EOS code → plain English |
| GET | /api/ttparser/<name>/<seq> |
Truthtable lookup |
-
Create and fill in your local environment file:
cp .env.example .env.local # edit .env.local with your values -
Create a virtual environment and install dependencies:
python -m venv .venv pip install -r requirements.txt
-
Initialize the database:
./dev.sh flask init-db
-
Seed the database with your data files:
./dev.sh flask init-intellution # requires files in acp_app/data/raw/intellution/ ./dev.sh flask init-team # requires files in acp_app/data/raw/team/ ./dev.sh flask init-ttparser # requires files in acp_app/data/raw/gcc/
-
Start the dev server:
./dev.sh flask run --debug
All commands are run via dev.sh to ensure the environment is loaded:
| Command | Description |
|---|---|
./dev.sh flask init-db |
Create all database tables |
./dev.sh flask init-intellution |
Load Intellution tag data |
./dev.sh flask init-team |
Load team and unit data |
./dev.sh flask init-ttparser |
Load GCC Truthtable data |
./dev.sh flask run --debug |
Start Flask dev server |
One row per person. Multiple units for one person are separated by |.
| Column | Type | Description |
|---|---|---|
name |
string | Full name |
role |
string | Job title |
email |
string | Email address (can be blank) |
linkedin |
string | Full LinkedIn URL (can be blank) |
active |
boolean | true to show, false to hide |
units |
string | Plant areas, pipe-separated: Unit1|Unit2 |
Example:
name,role,email,linkedin,active,units
John Doe,Controls Engineer,John@company.com,,true,Unit1|Unit2
Jane Doesnt,Controls Engineer,,,true,UtilitiesSee .env.example for a full template. Key variables:
| Variable | Description |
|---|---|
FLASK_APP |
Entry point (app.py) |
FLASK_CONFIG |
development, testing, or production |
SECRET_KEY |
Random secret string |
DEV_DATABASE_URL |
Dev DB — sqlite:///data.sqlite for local SQLite |
DATABASE_URL |
Production DB URL |
ASPEN_SERVER |
Aspen server hostname (production) |
CORS_ORIGINS |
Allowed origins for the API (default: http://localhost:5173) |