A simple Kanban board application using Flask and SQLite.

The application can be run with the following steps:
Install required python packages:
bash
pip install -r requirements.txt
Note: this will install packages globally. To avoid changing the system packages, the venv module can be used to set up a virtual environment.
Run the application using flask:
bash
FLASK_APP=main.py flask run
Finally, connect to http://127.0.0.1:5000/ in a web browser.
This is a simple Kanban board application built using Flask and SQLite. The application allows users to create, update, delete, and reorder cards within predefined columns on a Kanban board.
The project consists of three main files:
main.py – The core application logic and route definitions.cards.py – The model and functions for managing Kanban cards.database.py – Handles the database instance using SQLAlchemy.main.pyThis file sets up the Flask application and handles routes for card management.
/: Return Kanban board index page/static/<file:path>: Return static files from the static directory (CSS, JS etc)/cards: Returns all cards in JSON format./columns: Returns available columns./card: POST endpoint to create a new card./card/<int:card_id>: PUT to update or DELETE to delete a card./card/reorder: POST to reorder cards within the board.cards.pyThis file contains the Card model and its associated functions. It includes creating, updating, deleting, and reordering cards.
all_cards(): Fetch all cards, sorted by sort_order.create_card(): Create a new card with optional fields like color and column.update_card(): Update an existing card's attributes.delete_card(): Delete a card.order_cards(): Reorder a card in the list.The Card model is defined with attributes like id, text, column, color, modified, archived, and sort_order. Cards are uniquely identified by id, and columns specify the status of a card.
database.pyThis file initializes the SQLAlchemy instance and connects to an SQLite database. The configuration is flexible to accommodate different databases as needed.
id: Unique identifier for each card (primary key).text: The content of the card (free text).column: Defines which column the card belongs to (predefined options).color: Color of the card, in #RRGGBB format.modified: Auto-updated timestamp when a card is modified.archived: Boolean indicating if a card is archived.sort_order: Determines the order in which cards are displayed in each column.id field must be unique.column value is valid (exists in the list of predefined columns set by the kanban.columns config option).The application uses SQLite managed through SQLAlchemy. The main table Card includes the following columns:
| Column | Type | Description |
|---|---|---|
| id | Integer (PK) | Primary key for each card |
| text | String(120) | The card's content |
| column | String(120) | The card's column (e.g., "To Do", "Done") |
| color | String(7) | Color code in #RRGGBB format |
| modified | DateTime | Last modification timestamp |
| archived | Boolean | Indicates if the card is archived |
| sort_order | Integer | Order of the card within the column |
To integrate this Kanban board into another project:
Ensure Flask and SQLAlchemy are installed. You can use the following:
pip install flask sqlalchemy
Ensure that the SQLALCHEMY_DATABASE_URI in your project points to a valid database:
app.config['SQLALCHEMY_DATABASE_URI'] = 'sqlite:///your_project.db'
Integrate the Card model and the routes from main.py.
With the exception of the following, all code in this repository is released under the terms of the GNU General Public License v3:
$ claude mcp add python-kanban \
-- python -m otcore.mcp_server <graph>