Skip to content
Merged
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
60 changes: 60 additions & 0 deletions .github/workflows/pages.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
name: Pages

on:
push:
branches: [ main ]
workflow_dispatch:

permissions:
contents: read
pages: write
id-token: write

concurrency:
group: pages
cancel-in-progress: true

jobs:
build:
name: Build and deploy
runs-on: ubuntu-latest
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}

steps:
- name: Checkout
uses: actions/checkout@v4

- name: Install Rust toolchain
uses: dtolnay/rust-toolchain@stable
with:
targets: wasm32-unknown-unknown

- name: Cache cargo registry
uses: actions/cache@v4
with:
path: ~/.cargo/registry
key: ${{ runner.os }}-cargo-registry-${{ hashFiles('**/Cargo.lock') }}

- name: Cache cargo index
uses: actions/cache@v4
with:
path: ~/.cargo/git
key: ${{ runner.os }}-cargo-index-${{ hashFiles('**/Cargo.lock') }}

- name: Install Trunk
run: cargo install trunk --locked

- name: Build web app
working-directory: success-web
run: trunk build --release --public-url ./

- name: Upload Pages artifact
uses: actions/upload-pages-artifact@v3
with:
path: success-web/dist

- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v4
14 changes: 13 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -19,4 +19,16 @@ Cargo.lock

# End of https://www.toptal.com/developers/gitignore/api/rust
.serena/
archive/
archive/
dist/
*.wasm
*.js.map
build/
.DS_Store
*.swp
*.swo
*~
.vscode/
.idea/
ratzilla/
.answers/
10 changes: 4 additions & 6 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,9 @@ anyhow = "1.0"
chrono = { version = "0.4", features = ["serde"] }
serde = { version = "1.0", features = ["derive"] }
serde_json = "1.0"
uuid = { version = "1.4", features = ["v4"] }
crossterm = "0.27"
ratatui = "0.26"
serde_yaml = "0.9"
fuzzy-matcher = "0.3"
crossterm = "0.28"
ratatui = "0.30"
libc = "0.2"
clap = { version = "4.4", features = ["derive"] }
successlib = { git = "https://github.com/Calonca/success-lib", branch = "main" }
success-core = { path = "success-core" }
successlib = { git = "https://github.com/Calonca/success-lib", branch = "v0.5.x" }
114 changes: 114 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,114 @@
# Success CLI

A terminal-based goal tracking and productivity application built with Rust.

## Project Structure

- **`success-cli`** - CLI application (Ratatui-based TUI)
- **`success-core`** - Core business logic and data structures
- **`success-web`** - Web version (Ratzilla/WebAssembly)repository)

## Getting Started

### Running the CLI Version

```bash
# Build and run the CLI application
cargo run --release

# Or run with a custom archive path
cargo run --release -- --archive /path/to/archive
```

The first time you run the CLI, it will prompt you to set an archive location where all your goals and sessions will be stored.

### Running the Web Version

The web version is built with Ratzilla (Rust + WebAssembly).

Web demo (GitHub Pages): https://calonca.github.io/success-cli/

**Recommended: Using Trunk** (all-in-one build tool for WASM)

```bash
# Install trunk
cargo install trunk

# Build and serve with hot reload (development)
cd success-web
trunk serve

# Build for production
trunk build --release
```

Then open `http://localhost:8080` in your web browser.

Then open the appropriate URL in your web browser (default is `http://localhost:8080` for trunk, `http://localhost:8000` for others).

### Running Ratzilla Web Examples

Ratzilla allows building terminal-themed web applications with Rust and WebAssembly.

```bash
# Change to the ratzilla directory
cd ratzilla

# Build and run an example (e.g., demo)
cargo run --example demo --target wasm32-unknown-unknown

# Other available examples
cargo run --example minimal
cargo run --example demo2
```

For more details on Ratzilla, see [ratzilla/README.md](ratzilla/README.md).

## Features

### CLI Application
- **Goal Management**: Create, track, and manage goals
- **Session Tracking**: Log work sessions and rewards
- **Progress Visualization**: View progress with visual progress bars
- **Notes**: Add and edit notes for each goal
- **External Editor**: Edit notes in your preferred text editor (press `E`)
- **Archive Management**: Open archive folder in file manager (press `o`)

### Key Bindings (CLI)
- `↑↓` - Navigate items
- `←→` - Change day
- `Enter` - Add session/confirm
- `e` - Edit notes (in-app)
- `E` - Edit notes (external editor)
- `o` - Open archive in file manager
- `Esc` - Cancel/exit

## Building

```bash
# Build debug version
cargo build

# Build release version
cargo build --release

# Run tests
cargo test

# Format code
cargo fmt

# Lint code
cargo clippy
```

## Configuration

The CLI stores its configuration at `~/.config/success-cli/config.json` which includes the path to your archive folder.

## Development

- Uses `Ratatui` for terminal UI
- Uses `Crossterm` for terminal handling
- Uses `Chrono` for date/time operations
- Modular architecture with core logic separated from UI
Loading