Commit graph

31 commits

Author SHA1 Message Date
Claude
f0eb4bdef5
Rewrite Tracks application in Golang
This commit introduces a complete rewrite of the Tracks GTD application
in Go (Golang), providing a modern, performant alternative to the Ruby
on Rails implementation.

## Architecture & Technology Stack

- Language: Go 1.21+
- Web Framework: Gin
- ORM: GORM with SQLite/MySQL/PostgreSQL support
- Authentication: JWT with bcrypt password hashing
- Clean Architecture: Separated models, services, handlers, and middleware

## Implemented Features

### Core Models
- User: Authentication and user management
- Context: GTD contexts (@home, @work, etc.)
- Project: Project grouping and tracking
- Todo: Task management with state machine (active, completed, deferred, pending)
- Tag: Flexible tagging system with polymorphic associations
- Dependency: Todo dependencies with circular dependency detection
- Preference: User preferences and settings
- Note: Project notes
- Attachment: File attachment support (model only)
- RecurringTodo: Recurring task template (model only)

### API Endpoints

**Authentication:**
- POST /api/auth/login - User login
- POST /api/auth/register - User registration
- POST /api/auth/logout - User logout
- GET /api/me - Get current user

**Todos:**
- GET /api/todos - List todos with filtering
- POST /api/todos - Create todo
- GET /api/todos/:id - Get todo details
- PUT /api/todos/:id - Update todo
- DELETE /api/todos/:id - Delete todo
- POST /api/todos/:id/complete - Mark as completed
- POST /api/todos/:id/activate - Mark as active
- POST /api/todos/:id/defer - Defer to future date
- POST /api/todos/:id/dependencies - Add dependency
- DELETE /api/todos/:id/dependencies/:successor_id - Remove dependency

**Projects:**
- GET /api/projects - List projects
- POST /api/projects - Create project
- GET /api/projects/:id - Get project details
- PUT /api/projects/:id - Update project
- DELETE /api/projects/:id - Delete project
- POST /api/projects/:id/complete - Complete project
- POST /api/projects/:id/activate - Activate project
- POST /api/projects/:id/hide - Hide project
- POST /api/projects/:id/review - Mark as reviewed
- GET /api/projects/:id/stats - Get project statistics

**Contexts:**
- GET /api/contexts - List contexts
- POST /api/contexts - Create context
- GET /api/contexts/:id - Get context details
- PUT /api/contexts/:id - Update context
- DELETE /api/contexts/:id - Delete context
- POST /api/contexts/:id/hide - Hide context
- POST /api/contexts/:id/activate - Activate context
- POST /api/contexts/:id/close - Close context
- GET /api/contexts/:id/stats - Get context statistics

### Business Logic

**Todo State Management:**
- Active: Ready to work on
- Completed: Finished tasks
- Deferred: Future actions (show_from date)
- Pending: Blocked by dependencies

**Dependency Management:**
- Create blocking relationships between todos
- Automatic state transitions when blocking todos complete
- Circular dependency detection
- Automatic unblocking when prerequisites complete

**Tag System:**
- Polymorphic tagging for todos and recurring todos
- Automatic tag creation on first use
- Tag cloud support

**Project & Context Tracking:**
- State management (active, hidden, closed/completed)
- Statistics and health indicators
- Review tracking for projects

### Infrastructure

**Configuration:**
- Environment-based configuration
- Support for SQLite, MySQL, and PostgreSQL
- Configurable JWT secrets and token expiry
- Flexible server settings

**Database:**
- GORM for ORM
- Automatic migrations
- Connection pooling
- Multi-database support

**Authentication & Security:**
- JWT-based authentication
- Bcrypt password hashing
- Secure cookie support
- Token refresh mechanism

**Docker Support:**
- Multi-stage Dockerfile for optimized builds
- Docker Compose with PostgreSQL
- Volume mounting for data persistence
- Production-ready configuration

## Project Structure

```
cmd/tracks/              # Application entry point
internal/
  config/               # Configuration management
  database/             # Database setup and migrations
  handlers/             # HTTP request handlers
  middleware/           # Authentication middleware
  models/              # Database models
  services/            # Business logic layer
```

## Documentation

- README_GOLANG.md: Comprehensive documentation
- .env.example: Configuration template
- API documentation included in README
- Code comments for complex logic

## Future Work

The following features from the original Rails app are not yet implemented:
- Recurring todo instantiation logic
- Email integration (Mailgun/CloudMailin)
- Advanced statistics and analytics
- Import/Export functionality (CSV, YAML, XML)
- File upload handling for attachments
- Mobile views
- RSS/Atom feeds
- iCalendar export

## Benefits Over Rails Version

- Performance: Compiled binary, lower resource usage
- Deployment: Single binary, no runtime dependencies
- Type Safety: Compile-time type checking
- Concurrency: Better handling of concurrent requests
- Memory: Lower memory footprint
- Portability: Easy cross-platform compilation

## Testing

The code structure supports testing, though tests are not yet implemented.
Future work includes adding unit and integration tests.
2025-11-05 10:46:59 +00:00
Jyri-Petteri Paloposki
36cba2fffc Fix build by changing how Yarn is installed 2025-09-20 14:21:16 +03:00
Jyri-Petteri Paloposki
f5f0193b60 Add asset stuff back to being included by default for non-Docker users; move more asset-related packages to the group 2024-07-19 00:02:07 +03:00
Jyri-Petteri Paloposki
d2fff6a64c Don't require the .git directory to exist for a successful Docker build. 2024-07-18 22:09:35 +03:00
Jyri-Petteri Paloposki
ff5adc5696 Replace the version-specific Dockerfiles with one staged Dockerfile 2024-07-18 21:09:04 +03:00
Jyri-Petteri Paloposki
5940fe10a6 Add Stripe as an optional package 2024-07-18 16:14:42 +03:00
Jyri-Petteri Paloposki
d5235e8c61 Move default build to Ruby 3.3, test only MySQL for Rubies 3.1 & 3.2 (middle versions) 2024-06-17 12:46:16 +03:00
Jyri-Petteri Paloposki
05854c6560 Update the netcat package name 2024-06-06 11:16:19 +03:00
Jyri-Petteri Paloposki
80c3b22e04 Make 3.1 our default build 2024-06-06 10:46:36 +03:00
Jyri-Petteri Paloposki
1be3c27165 Run tests for Ruby 3.1 and change from racer to mini_racer for Ruby 3.1 support 2024-06-06 09:53:59 +03:00
Matt Rogers
f405861c60
ci: Ruby 2.7 needs an older version of bundler
Pin Bundler to 2.4.22 so that 2.7 CI keeps working.
2024-02-15 09:39:45 -06:00
Jyri-Petteri Paloposki
6ca701f6fd Fix the Git version in the footer with the Docker image and change the wording. 2022-02-21 13:44:43 +02:00
Jyri-Petteri Paloposki
c2bd1b0d81 Error message fixes for CSV import. Add the necessary directory to Docker image. 2022-02-09 11:28:05 +02:00
Jyri-Petteri Paloposki
7a9dd6cd6f Add the obsidian link support to config also. Fix poll-for-db. 2022-02-03 11:44:26 +02:00
Jyri-Petteri Paloposki
41538efb9e Use the script in bin/ for running the rails server in the Docker image. 2021-11-29 21:37:44 +02:00
Jyri-Petteri Paloposki
8800bab8a9 Fix using most recent versions of the Ruby images in the CI 2021-11-25 01:10:38 +02:00
Jyri-Petteri Paloposki
0b2eec4f82 Move to Ruby 2.7 for the default Docker version as well as the default target for alternative DB's. Fix the Ruby image version with three digits because the most recent versions seem to be somehow broken. 2020-12-11 20:02:47 +02:00
Jyri-Petteri Paloposki
e25c50503c Fix the jquery requires in the stylesheets and the missing Yarn warning. 2020-08-25 21:46:27 +03:00
Jyri-Petteri Paloposki
85e104006c Handle empty database password properly, don't try to run docker-compose inside the container 2020-07-19 21:30:24 +03:00
Jyri-Petteri Paloposki
53c7c94306 A few more fixes in hope of fixing the Docker Compose 2020-07-19 18:07:23 +03:00
Jyri-Petteri Paloposki
2e40879123 Fix the Docker Compose configuration and remove the database config from VCS
Fixes #2248.
2020-07-19 17:36:06 +03:00
Jyri-Petteri Paloposki
3f22c8a036 Better Docker config: Use entrypoint to setup the environment, run in production mode by default, defaults for all config values 2020-07-19 16:12:57 +03:00
Jyri-Petteri Paloposki
8118b588d8 Run migration before starting Docker server; update README a bit 2020-07-17 16:00:22 +03:00
Jyri-Petteri Paloposki
5c94a7c515 Fix the Docker configuration to work better 2020-07-17 00:37:26 +03:00
Matt Rogers
2799afa13a
Update the base image for docker to ruby 2.6 2020-03-11 19:46:06 -05:00
Dan Rice
79ac907346 Migrate CI to GitHub Actions 2019-10-30 21:24:15 -04:00
Matt Rogers
a31db945ab
Upgrade bundler. 2019-04-07 19:55:21 -05:00
Matt Rogers
1b50b3d084
Bump Ruby to 2.4 2019-04-07 12:42:37 -05:00
Matt Rogers
cde2108129
Add a new, slimmer Dockerfile
We'll use docker-compose for providing the other dependencies.
2018-04-25 19:44:21 -05:00
Matt Rogers
7922ae46de Rename Dockerfile to Dockerfile.passenger
I want to slim down the normal Dockerfile so it makes it easier to do
development with a docker based workflow.
2018-04-25 19:42:21 -05:00
Dan Rice
6cd2ae25fe Add Docker configuration
[ci skip]
2016-01-24 15:59:34 -05:00