Skip to main content

Terminal User Interface for Second Brain Todo Application

Project description

Terminal Second Brain - TUI

🧠 A modern Terminal User Interface for managing your todos with style and efficiency.

Features

Modern TUI Interface

  • Clean, responsive terminal interface built with Textual
  • Keyboard and mouse navigation support
  • Real-time status updates and notifications

📋 Todo Management

  • View all todos with visual status indicators
  • Add new todos with input validation
  • Mark todos as completed with a single click
  • Automatic refresh and real-time updates

🔗 API Integration

  • Seamless integration with Spring Boot backend
  • Connection health monitoring
  • Error handling and user feedback
  • Configurable API endpoint

Prerequisites

  • Python 3.10 or higher
  • Spring Boot Todo API running on http://localhost:8080

Installation

  1. Install dependencies using uv:
uv sync
  1. Or install manually with pip:
pip install textual httpx rich pydantic

Running the Application

  1. Ensure your Spring Boot backend is running:
# In the main project directory
gradle bootRun
  1. Start the TUI application:
# Using uv (recommended)
uv run main.py

# Or directly with Python
python main.py

Usage

Keyboard Shortcuts

Key Action
q Quit application
a Add new todo
r Refresh todo list
? Show help
Esc Cancel/Go back
Ctrl+S Save (in forms)
Tab Navigate controls
Enter Activate selected item

Mouse Controls

  • Click on a todo to select it
  • Double-click to mark as complete (future feature)
  • Use scroll wheel to navigate long lists

Visual Indicators

  • Completed todos - Green checkmark
  • Pending todos - Yellow circle
  • 🔄 Loading - Spinning indicator
  • Errors - Red X with message

Configuration

The application can be configured through environment variables:

# API endpoint (default: http://localhost:8080)
export TODO_API_URL=http://your-api-server:8080

# Run the application
uv run main.py

Troubleshooting

Connection Issues

If you see a connection error:

  1. Check Backend Status: Ensure Spring Boot app is running
curl http://localhost:8080/actuator/health
  1. Verify API Endpoints: Test the API manually
curl http://localhost:8080/api/v1/todos
  1. Check Port Conflicts: Ensure port 8080 is available

Common Issues

  • Import Errors: Run uv sync to install dependencies
  • API Timeout: Check network connectivity and backend performance
  • Display Issues: Ensure terminal supports Unicode and colors

Development

Project Structure

tui/
├── main.py              # Main application entry point
├── api_client.py        # HTTP client for backend API
├── todo_list.py         # Todo list widget
├── add_todo_screen.py   # Add todo form screen
├── config.py            # Configuration and constants
├── pyproject.toml       # Project dependencies
└── README.md           # This file

Adding Features

The application is built with Textual widgets and follows a modular architecture:

  1. New Screens: Add in separate files, register in SCREENS dict
  2. New Widgets: Extend textual.widgets base classes
  3. API Methods: Add to SyncTodoAPIClient class
  4. Styling: Update CSS in main.py or create separate CSS file

Contributing

  1. Fork the repository
  2. Create a feature branch
  3. Make your changes
  4. Test with the backend API
  5. Submit a pull request

License

This project is part of the Terminal Second Brain application. See the main project LICENSE for details.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

terminal_second_brain-0.0.1.tar.gz (18.7 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

terminal_second_brain-0.0.1-py3-none-any.whl (26.5 kB view details)

Uploaded Python 3

File details

Details for the file terminal_second_brain-0.0.1.tar.gz.

File metadata

File hashes

Hashes for terminal_second_brain-0.0.1.tar.gz
Algorithm Hash digest
SHA256 374844614d2a6f06155742eebdc7dceea90c7f2380787b38ad19a98421e66d5b
MD5 84d657a3c3314828abbcc0581d57994d
BLAKE2b-256 1d7a796663d39fc782e2e8cc32dde30235e053d220cfd5582a98597dc6e1c23f

See more details on using hashes here.

File details

Details for the file terminal_second_brain-0.0.1-py3-none-any.whl.

File metadata

File hashes

Hashes for terminal_second_brain-0.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 53028ecc9e65d0550f366510cb53722a350fe7110a853850b0a9f6d9604be470
MD5 84fdbd481cf5b088da55d624adf7cca7
BLAKE2b-256 d48d18d623ac2b4d44a6b5d519a3d23758d46825134539d8ccd1b9d635f0451d

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page