feat: Remove outdated testing documentation and add comprehensive development and feature guides
- Deleted `TESTING_SETUP.md` and `TEST_UPDATES_SUMMARY.md` as they were outdated. - Introduced `CHANGELOG.md` to document notable changes and version history. - Added `DEVELOPMENT.md` for detailed development setup, testing framework, and debugging guidance. - Created `FEATURES.md` to outline core features and functionalities of TheChart. - Established `README.md` as a centralized documentation index for users and developers.
This commit is contained in:
240
README.md
240
README.md
@@ -1,15 +1,34 @@
|
||||
# Thechart
|
||||
App to manage medication and see the evolution of its effects.
|
||||
# TheChart
|
||||
Advanced medication tracking application for monitoring treatment progress and symptom evolution.
|
||||
|
||||
## Quick Start
|
||||
```bash
|
||||
# Install dependencies
|
||||
make install
|
||||
|
||||
# Run the application
|
||||
make run
|
||||
|
||||
# Run tests
|
||||
make test
|
||||
```
|
||||
|
||||
## 📚 Documentation
|
||||
- **[Features Guide](docs/FEATURES.md)** - Complete feature documentation
|
||||
- **[Development Guide](docs/DEVELOPMENT.md)** - Testing, development, and architecture
|
||||
- **[Changelog](docs/CHANGELOG.md)** - Version history and feature evolution
|
||||
- **[Quick Reference](#quick-reference)** - Common commands and shortcuts
|
||||
|
||||
## Table of Contents
|
||||
- [Prerequisites](#prerequisites)
|
||||
- [Installation](#installation)
|
||||
- [Running the Application](#running-the-application)
|
||||
- [Key Features](#key-features)
|
||||
- [Development](#development)
|
||||
- [Deployment](#deployment)
|
||||
- [Docker Usage](#docker-usage)
|
||||
- [Troubleshooting](#troubleshooting)
|
||||
- [Make Commands Reference](#make-commands-reference)
|
||||
- [Quick Reference](#quick-reference)
|
||||
|
||||
## Prerequisites
|
||||
|
||||
@@ -179,75 +198,85 @@ python src/main.py
|
||||
On first run, the application will:
|
||||
- Create a default CSV data file (`thechart_data.csv`) if it doesn't exist
|
||||
- Set up logging in the `logs/` directory
|
||||
- Create necessary configuration files
|
||||
- Initialize medicine and pathology configuration files (`medicines.json`, `pathologies.json`)
|
||||
- Create necessary directory structure
|
||||
## Key Features
|
||||
|
||||
### 🏥 Modular Medicine System
|
||||
- **Dynamic Medicine Management**: Add, edit, and remove medicines through the UI
|
||||
- **Configurable Properties**: Customize names, dosages, colors, and quick-dose options
|
||||
- **JSON Configuration**: Easy management through `medicines.json`
|
||||
- **Automatic UI Updates**: All components update when medicines change
|
||||
|
||||
### 💊 Advanced Dose Tracking
|
||||
- **Precise Timestamps**: Record exact time and dose amounts
|
||||
- **Multiple Daily Doses**: Track multiple doses of the same medicine
|
||||
- **Comprehensive Interface**: Dedicated dose management in edit windows
|
||||
- **Historical Data**: Complete dose history with CSV persistence
|
||||
|
||||
### 📊 Enhanced Visualizations
|
||||
- **Interactive Graphs**: Toggle visibility of symptoms and medicines
|
||||
- **Dose Bar Charts**: Visual representation of daily medication intake
|
||||
- **Enhanced Legends**: Multi-column layout with average dosage information
|
||||
- **Professional Styling**: Clean, informative chart design
|
||||
|
||||
### 📈 Data Management
|
||||
- **Robust CSV Storage**: Human-readable and portable data format
|
||||
- **Automatic Backups**: Data protection during updates
|
||||
- **Backward Compatibility**: Seamless upgrades without data loss
|
||||
- **Dynamic Columns**: Adapts to new medicines and pathologies
|
||||
|
||||
For complete feature documentation, see **[docs/FEATURES.md](docs/FEATURES.md)**.
|
||||
|
||||
## Development
|
||||
|
||||
### Code Quality Tools
|
||||
The project includes several code quality tools that are automatically set up:
|
||||
### Testing Framework
|
||||
TheChart includes a comprehensive testing suite with **93% code coverage**:
|
||||
|
||||
#### Formatting and Linting
|
||||
```shell
|
||||
make format # Format code with ruff
|
||||
make lint # Run linter checks
|
||||
```bash
|
||||
# Run all tests
|
||||
make test
|
||||
|
||||
# Run tests with coverage report
|
||||
uv run pytest --cov=src --cov-report=html
|
||||
|
||||
# Run specific test file
|
||||
uv run pytest tests/test_graph_manager.py -v
|
||||
```
|
||||
|
||||
**With uv directly:**
|
||||
```shell
|
||||
uv run ruff format . # Format code
|
||||
uv run ruff check . # Check for issues
|
||||
```
|
||||
**Testing Statistics:**
|
||||
- **112 total tests** across 6 test modules
|
||||
- **93% overall coverage** (482 statements, 33 missed)
|
||||
- **Pre-commit testing** prevents broken commits
|
||||
|
||||
#### Running Tests
|
||||
```shell
|
||||
make test # Run unit tests
|
||||
```
|
||||
### Code Quality
|
||||
```bash
|
||||
# Format code
|
||||
make format
|
||||
|
||||
**With uv directly:**
|
||||
```shell
|
||||
uv run pytest # Run tests with pytest
|
||||
# Check code quality
|
||||
make lint
|
||||
|
||||
# Run pre-commit checks
|
||||
pre-commit run --all-files
|
||||
```
|
||||
|
||||
### Package Management with uv
|
||||
|
||||
#### Adding Dependencies
|
||||
```shell
|
||||
# Add a runtime dependency
|
||||
```bash
|
||||
# Add dependencies
|
||||
uv add package-name
|
||||
|
||||
# Add a development dependency
|
||||
# Add development dependencies
|
||||
uv add --dev package-name
|
||||
|
||||
# Add specific version
|
||||
uv add "package-name>=1.0.0"
|
||||
```
|
||||
# Update dependencies
|
||||
uv sync --upgrade
|
||||
|
||||
#### Removing Dependencies
|
||||
```shell
|
||||
# Remove dependencies
|
||||
uv remove package-name
|
||||
```
|
||||
|
||||
#### Updating Dependencies
|
||||
```shell
|
||||
# Update all dependencies
|
||||
uv sync --upgrade
|
||||
|
||||
# Update specific package
|
||||
uv add "package-name>=new-version"
|
||||
```
|
||||
|
||||
#### Pre-commit Hooks
|
||||
Pre-commit hooks are automatically installed and will run on every commit to ensure code quality. They include:
|
||||
- Code formatting with ruff
|
||||
- Linting checks
|
||||
- Import sorting
|
||||
- Basic file checks
|
||||
|
||||
### Development Dependencies
|
||||
The following development tools are included:
|
||||
- **ruff** - Fast Python linter and formatter
|
||||
- **pre-commit** - Git hook management
|
||||
- **pyinstaller** - For creating standalone executables
|
||||
For detailed development information, see **[docs/DEVELOPMENT.md](docs/DEVELOPMENT.md)**.
|
||||
|
||||
## Deployment
|
||||
|
||||
@@ -312,43 +341,33 @@ python src/main.py
|
||||
|
||||
## Docker Usage
|
||||
|
||||
## Docker Usage
|
||||
|
||||
### Building the Container Image
|
||||
Build a multi-platform Docker image:
|
||||
```shell
|
||||
### Quick Start with Docker
|
||||
```bash
|
||||
# Build and start the application
|
||||
make build
|
||||
```
|
||||
|
||||
### Running with Docker Compose
|
||||
The project includes Docker Compose configuration for easy container management:
|
||||
|
||||
1. **Start the application:**
|
||||
```shell
|
||||
make start
|
||||
```
|
||||
|
||||
2. **Stop the application:**
|
||||
```shell
|
||||
# Stop the application
|
||||
make stop
|
||||
```
|
||||
|
||||
3. **Access container shell:**
|
||||
```shell
|
||||
# Access container shell
|
||||
make attach
|
||||
```
|
||||
|
||||
### Manual Docker Commands
|
||||
If you prefer using Docker directly:
|
||||
|
||||
```shell
|
||||
```bash
|
||||
# Build image
|
||||
docker build -t thechart .
|
||||
|
||||
# Run container
|
||||
docker run -it --rm thechart
|
||||
# Run container with X11 forwarding (Linux)
|
||||
docker run -it --rm \
|
||||
-e DISPLAY=$DISPLAY \
|
||||
-v /tmp/.X11-unix:/tmp/.X11-unix:rw \
|
||||
thechart
|
||||
```
|
||||
|
||||
**Note:** Docker support is primarily for development. For production use, consider the standalone executable deployment.
|
||||
|
||||
## Troubleshooting
|
||||
|
||||
### Common Issues
|
||||
@@ -407,34 +426,10 @@ If you encounter issues not covered here:
|
||||
3. Try rebuilding the virtual environment
|
||||
4. Verify file permissions for deployment directories
|
||||
|
||||
## Make Commands Reference
|
||||
## Quick Reference
|
||||
|
||||
The project uses a Makefile to simplify common development and deployment tasks.
|
||||
|
||||
### Show Help Menu
|
||||
```shell
|
||||
make help
|
||||
```
|
||||
|
||||
### Available Commands
|
||||
| Command | Description |
|
||||
|---------|-------------|
|
||||
| `install` | Set up the development environment |
|
||||
| `run` | Run the application |
|
||||
| `shell` | Open a shell in the local environment |
|
||||
| `format` | Format the code with ruff |
|
||||
| `lint` | Run the linter |
|
||||
| `test` | Run the tests |
|
||||
| `requirements` | Export the requirements to a file |
|
||||
| `build` | Build the Docker image |
|
||||
| `start` | Start the app (Docker) |
|
||||
| `stop` | Stop the app (Docker) |
|
||||
| `attach` | Open a shell in the container |
|
||||
| `deploy` | Deploy standalone app executable |
|
||||
| `help` | Show this help |
|
||||
|
||||
### Quick Reference
|
||||
```shell
|
||||
### Essential Commands
|
||||
```bash
|
||||
# Development workflow
|
||||
make install # One-time setup
|
||||
make run # Run application
|
||||
@@ -451,6 +446,35 @@ make start # Start containerized app
|
||||
make stop # Stop containerized app
|
||||
```
|
||||
|
||||
### Project Structure
|
||||
```
|
||||
src/ # Main application source code
|
||||
├── main.py # Application entry point
|
||||
├── ui_manager.py # User interface management
|
||||
├── data_manager.py # CSV data operations
|
||||
├── graph_manager.py # Visualization and plotting
|
||||
├── medicine_manager.py # Medicine system
|
||||
└── pathology_manager.py # Symptom tracking
|
||||
|
||||
docs/ # Documentation
|
||||
├── FEATURES.md # Complete feature guide
|
||||
└── DEVELOPMENT.md # Development guide
|
||||
|
||||
logs/ # Application logs
|
||||
deploy/ # Deployment configuration
|
||||
tests/ # Test suite
|
||||
medicines.json # Medicine configuration
|
||||
pathologies.json # Pathology configuration
|
||||
thechart_data.csv # User data (created on first run)
|
||||
```
|
||||
|
||||
### Key Files
|
||||
- **`medicines.json`**: Configure available medicines
|
||||
- **`pathologies.json`**: Configure tracked symptoms
|
||||
- **`thechart_data.csv`**: Your medication and symptom data
|
||||
- **`pyproject.toml`**: Project configuration and dependencies
|
||||
- **`uv.lock`**: Dependency lock file
|
||||
|
||||
---
|
||||
|
||||
## Why uv?
|
||||
@@ -471,13 +495,3 @@ make stop # Stop containerized app
|
||||
| Add package | `uv add package` | `poetry add package` |
|
||||
| Run command | `uv run command` | `poetry run command` |
|
||||
| Activate environment | `source .venv/bin/activate` | `poetry shell` |
|
||||
|
||||
**Project Structure:**
|
||||
- `src/` - Main application source code
|
||||
- `logs/` - Application log files
|
||||
- `deploy/` - Deployment configuration files
|
||||
- `build/` - Build artifacts (created during deployment)
|
||||
- `.venv/` - Virtual environment (created by uv)
|
||||
- `uv.lock` - Lock file with exact dependency versions
|
||||
- `pyproject.toml` - Project configuration and dependencies
|
||||
- `thechart_data.csv` - Application data file
|
||||
|
||||
Reference in New Issue
Block a user