Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .tool-versions
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
python 3.12.8
114 changes: 113 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,12 +1,124 @@
# Alinka PySide

Application for Supporting Center for Children - A PySide6 desktop application for managing educational support decisions and generating documents.

## Prerequisites

- **Python 3.12** - Required Python version for the application
- Version management tool of choice for Python, e.g. asdf or pyenv
- **Poetry** - Dependency management and virtual environment handling

## Quick Setup

### 1. Clone and Setup Project

```bash
# Install dependencies (including dev dependencies for testing and linting)
poetry install --with dev

# Create necessary directories (the application will create them automatically, but you can create them manually if needed)
# On macOS:
mkdir -p "$HOME/Library/Application Support/Alinka"
mkdir -p "$HOME/Documents/Alinka"

# On Linux:
mkdir -p "$HOME/.local/share/Alinka"
mkdir -p "$HOME/Documents/Alinka"

# Run migrations
poetry run alembic upgrade head
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Migration should run automatically on app startup


# Populate database with test data (WARNING: This can take a long time and may hang)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Verrrry good point. It indeed might be a bit confusing 😃

poetry run python tools/populate_database.py

# Generate documents
poetry run python tools/create_documents.py --type specjalne
```

### 2. Run the Application

```bash
poetry run python run.py
```

## Directory Structure

The application uses platform-specific directories managed by `platformdirs`:

**On macOS:**
- **Database**: `~/Library/Application Support/Alinka/alinka.sqlite`
- **Documents**: `~/Documents/Alinka/`
- **Logs**: `~/Library/Application Support/Alinka/logs/` (when running as packaged app)

**On Linux:**
- **Database**: `~/.local/share/Alinka/alinka.sqlite`
- **Documents**: `~/Documents/Alinka/`
- **Logs**: `~/.local/share/Alinka/logs/` (when running as packaged app)

The application automatically creates these directories when needed.

## Development Commands

```bash
# Run tests
poetry run pytest

# Run linting
poetry run black .
poetry run isort .
poetry run flake8 .

# Create database migration
poetry run alembic revision --autogenerate -m "your_message"

# Apply migrations
poetry run alembic upgrade head
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Duplicate? (l.29)



```

## Project Structure

```
alinka-pyside/
├── alinka/ # Main application code
│ ├── config/ # Configuration settings
│ ├── db/ # Database models and connections
│ ├── docx/ # Document generation
│ ├── widget/ # PySide6 GUI components
│ └── ...
├── migrations/ # Database migrations
├── tests/ # Test files
├── tools/ # Utility scripts
├── pyproject.toml # Poetry configuration
├── .tool-versions # asdf tool versions
└── run.py # Application entry point
```

## Technology Stack

- **GUI Framework**: PySide6 (Qt for Python)
- **Database**: SQLite with SQLAlchemy ORM
- **Migrations**: Alembic
- **Document Generation**: Custom Word templates
- **Dependency Management**: Poetry
- **Configuration**: Pydantic Settings

## Development

If you're using Docker Compose (or Linux in general) for development, be aware
that Waylaynd as Windows System is causing issues and it would be wise
that Wayland as Windows System is causing issues and it would be wise
to switch X11 (see procedure in https://apploye.com/help/switch-from-wayland-to-xorg-ubuntu/).

## Contributing

1. Follow the existing code style (Black, isort, flake8)
2. Write tests for new features
3. Update migrations for database changes
4. Test before submitting PRs

## Release

To make a release please follow instruction
1. Go to "Actions" tab and run "Crate release" workflow (additional instructions [here](https://docs.github.com/en/actions/how-tos/managing-workflow-runs-and-deployments/managing-workflow-runs/manually-running-a-workflow#running-a-workflow)).
2. When workflow is done (all checks are green), go back to the main repo and find release on the right.
Expand Down