crystal_todo_list

Version, currently main branch1 version
  • main branchlatestOct 26, 2025

github.com/sebyx07/crystal-react-todo-lucky

Todo list built with crystal and react

1 stars
0 dependents
License: not declared

Installation

# Add this to your shard.yml
dependencies:
  crystal_todo_list:
    github: sebyx07/crystal-react-todo-lucky
    branch: main

main is a branch, not a release, so this tracks it rather than pinning a version.

Then run:

shards install

shard.yml

Crystal
>= 1.18.2
Target
  • crystal_todo_list from src/crystal_todo_list.cr

Dependencies

Runtime Dependencies

  • jwt~> 1.6.1github: crystal-community/jwt
  • avram~> 1.4.0github: luckyframework/avram
  • lucky~> 1.4.0github: luckyframework/lucky
  • carbon~> 0.6.0github: luckyframework/carbon
  • authentic>= 1.0.2, < 2.0.0github: luckyframework/authentic
  • lucky_env~> 0.3.0github: luckyframework/lucky_env
  • lucky_task~> 0.3.0github: luckyframework/lucky_task
  • carbon_sendgrid_adapter~> 0.6.0github: luckyframework/carbon_sendgrid_adapter

Development Dependencies

  • lucky_flow~> 0.10.1github: luckyframework/lucky_flowdev

README

๐Ÿ’Ž Crystal Todo List

A modern todo list application built with Lucky Framework, Crystal, and React.

โœจ Features

  • โœ… Full CRUD operations for todos
  • ๐Ÿ”„ Mark todos as completed/pending
  • ๐Ÿ“ Edit todos inline
  • ๐Ÿ” User authentication (JWT + Sessions)
  • โšก React 19 SPA with React Compiler optimization
  • ๐ŸŽจ Bootstrap 5 UI
  • ๐Ÿ—„๏ธ PostgreSQL database
  • ๐Ÿงช Full test coverage (Frontend + Backend)
  • ๐Ÿณ Docker support for development
  • ๐Ÿ”’ Optional SSL/TLS support

๐Ÿš€ Tech Stack

  • Backend: Crystal 1.18.2 + Lucky Framework 1.4.0
  • Frontend: React 19 + TypeScript + React Compiler
  • Database: PostgreSQL 14
  • Runtime: Bun v1.3.1 (assets & tests)
  • Styling: Bootstrap 5 + Sass
  • Testing: Crystal Spec + Vitest + React Testing Library

๐Ÿ› ๏ธ Quick Start (Docker - Recommended)

All development is done via Docker Compose using the bin/ scripts:

# Start the development server (includes database setup)
bin/dev

That's it! The app will be available at http://localhost:3000 (or https://localhost:3000 with SSL)

๐Ÿณ Available Commands

All scripts automatically handle Docker Compose for you:

# Development
bin/dev               # Start development server with hot reload

# Testing
bin/spec              # Run all specs (Backend + Frontend)
bin/spec spec/requests/todos/         # Run specs in directory
bin/spec spec/requests/todos/index_spec.cr  # Run specific file

# Linting & Formatting
bin/lint              # Auto-format all files (Crystal + JS/TS)
bin/lint --check      # Check formatting without modifying

๐Ÿ—„๏ธ Database

PostgreSQL runs in Docker via docker compose:

  • Not exposed to host (secure by default)
  • Accessed via container network only
  • Automatically managed by bin scripts

โš™๏ธ Environment Configuration

The application uses .env.development.local for local development settings:

  • APP_DOMAIN: dev-1.venom.is (for production SSL)
  • PORT: 5000 (container-to-container port)
  • DATABASE_URL: Automatically set by bin scripts

For SSL/TLS configuration, see docs/ssl-setup.md

๐ŸŒ API Endpoints

Authentication:

  • POST /api/sign_ins - Sign in (returns JWT token)
  • POST /api/sign_ups - Create account
  • DELETE /api/sign_ins - Sign out

Todos:

  • GET /api/todos - List todos (paginated, sorted by updated_at desc)
  • POST /api/todos - Create a new todo
  • PATCH /api/todos/:id - Update a todo
  • DELETE /api/todos/:id - Delete a todo

๐Ÿ’ป VSCode / code-server Setup

The project includes full VSCode/code-server configuration:

Quick setup:

bin/setup-vscode

This configures:

  • โœ… Crystal language server with Docker integration
  • โœ… Syntax highlighting and IntelliSense
  • โœ… Format on save
  • โœ… Jump to definition
  • โœ… Integrated tasks (Ctrl+Shift+B to run dev server)
  • โœ… Test runner (Ctrl+Shift+T)
  • โœ… Debugging support

Available tasks (Ctrl+Shift+P โ†’ "Tasks: Run Task"):

  • Run All Tests
  • Run Current Test File
  • Start Development Server
  • Format Code
  • Check Code Format
  • Run Database Migrations
  • Docker Compose Up/Down

Files:

  • .vscode/settings.json - Crystal LSP and editor config
  • .vscode/tasks.json - Integrated tasks
  • .vscode/launch.json - Debug configurations
  • .vscode/extensions.json - Recommended extensions
  • .editorconfig - Cross-editor formatting

๐Ÿ“š Learning Resources

Lucky uses the Crystal programming language. You can learn about Lucky from the Lucky Guides.