{"id":13467744,"url":"https://github.com/cuppar/rtd","last_synced_at":"2025-03-26T03:31:05.637Z","repository":{"id":183438028,"uuid":"670128090","full_name":"cuppar/rtd","owner":"cuppar","description":"Learn Rust by 500 lines code","archived":false,"fork":false,"pushed_at":"2023-09-05T09:49:49.000Z","size":3248,"stargazers_count":490,"open_issues_count":9,"forks_count":24,"subscribers_count":7,"default_branch":"master","last_synced_at":"2024-10-05T19:52:10.838Z","etag":null,"topics":["cli-app","learning-by-doing","rust","step-by-step-guide","tutorial"],"latest_commit_sha":null,"homepage":"","language":"Rust","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/cuppar.png","metadata":{"files":{"readme":"readme.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null}},"created_at":"2023-07-24T11:02:05.000Z","updated_at":"2024-10-04T16:28:36.000Z","dependencies_parsed_at":"2024-01-08T14:46:05.813Z","dependency_job_id":null,"html_url":"https://github.com/cuppar/rtd","commit_stats":null,"previous_names":["cuppar/rtd"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cuppar%2Frtd","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cuppar%2Frtd/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cuppar%2Frtd/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cuppar%2Frtd/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/cuppar","download_url":"https://codeload.github.com/cuppar/rtd/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":222107286,"owners_count":16932450,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["cli-app","learning-by-doing","rust","step-by-step-guide","tutorial"],"created_at":"2024-07-31T15:01:00.029Z","updated_at":"2024-10-29T20:30:57.289Z","avatar_url":"https://github.com/cuppar.png","language":"Rust","readme":"# Learn Rust by 500 lines code\n[![crate_version](https://img.shields.io/crates/v/rtd-tutorial)](https://crates.io/crates/rtd-tutorial)\n[![crate_downloads](https://img.shields.io/crates/d/rtd-tutorial?color=blue)](https://crates.io/crates/rtd-tutorial)\n[![license](https://img.shields.io/crates/l/rtd-tutorial?color=red)](https://github.com/cuppar/rtd/blob/master/LICENSE)\n\nEnglish | [中文](https://github.com/cuppar/rtd/blob/master/readme_zh.md#500%E8%A1%8C%E4%BB%A3%E7%A0%81%E5%AD%A6%E4%BC%9Arust)\n\n- RTD (Rust To Do) is a todo app cli tool write by 500 lines Rust code. (exclude space lines/comments/long line break display/test code)\n- RTD is also a [tutorial](https://github.com/cuppar/rtd/wiki), designed to learn Rust by doing.\n\n![rtd_list_all](Tutorial/doc/img/readme/rtd_list_all.png)\n\n## Table of contents\n\n- [What can you learn from rtd?](#what-can-you-learn-from-rtd)\n- [Prepare](#prepare)\n- [Install](#install)\n- [Usage](#usage)\n- [About author](#about-author)\n\n---\n\n## What can you learn from RTD?\n\n#### Assuming you know nothing about Rust, through the [Learn Rust by 500 lines code](https://github.com/cuppar/rtd/wiki) tutorial, step by step to build the project from scratch, you will learn:\n  - Rust common syntax\n  - Rust module system (`package`/`binary crate`/`library crate`/`mod`/`pub`/`use`)\n  - Rust ownership model (Bernstein conditions)\n  - Rust lifetime\n  - Rust error/null handling model (`Result\u003cT, E\u003e`/`Option\u003cT\u003e`)\n  - Rust generic\n  - Rust pattern matching (`if let` , `match` ...)\n  - Rust unit test\n  - Rust file I/O (`File Seek`/`Buffed File I/O`)\n  - Rust manipulating environment variables\n  - Rust command line parameter parsing\n  - Rust release package to crate.io\n  - The general process of developing a program (requirements/design/implementation/testing/release/maintenance)\n  - Layered abstraction (data storage layer/model mapping layer/data model layer/business logic layer/application interface layer/user interface layer)\n  - Handwritten serialization/deserialization from scratch\n  - Implement the recycle bin function (virtualization concept)\n\n###### Architecture\n\n![rtd_arch](Tutorial/doc/img/readme/rtd_arch.svg)\n\n###### Storage\nUse a local file `$HOME/.rtd.csv` store all data\n\n![data_storage](Tutorial/doc/img/readme/csv.png)\n![rtd_list_all](Tutorial/doc/img/readme/rtd_list_all.png)\n\n#### After completing this tutorial or installing RTD directly, you will get:\n  - Extremely lightweight and concise todo command line application\n  - Cross-platform, Rust's excellent build system naturally supports cross-platform\n  - Safe, supports recycle bin, completely local, no network, no database\n  - All data storage uses only one local csv file, which can be switched between different machines by copying the csv file\n\n---\n\nInteresting fact: I use RTD to complete the RTD tutorial :)\n\nIf you like my tutorial, don't forget to give me a star~\n\n---\n\n## Prepare\n\n- Rust is naturally cross-platform. This project is built and tested in the `linux` environment, and `Windows`/`MacOS` are also supported. You can choose to download the corresponding `Cargo` according to your own operating system.\n- `Cargo` Rust's package management and build tool, can be installed directly through the [Rust official website](https://www.rust-lang.org/tools/install) `rustup` one line command. Then, all things will be done by `Cargo`, so cute, right?\n\n## Install\n\n#### Via `crate.io` :\n\n```bash\ncargo install rtd-tutorial\n```\n\n#### Or via `git repo` :\n```bash\ngit clone https://github.com/cuppar/rtd.git\ncargo install --path rtd\n```\n\n## Usage\n\n#### View help document\n```bash\nrtd -h\nrtd --help\n```\n\n![rtd_help_summary](Tutorial/doc/img/readme/rtd_help_summary.png)\n![rtd_help](Tutorial/doc/img/readme/rtd_help.png)\n\n#### Add a todo\n```bash\nrtd -a \u003citem-name\u003e\nrtd --add \u003citem-name\u003e\n```\n\n![rtd_add](Tutorial/doc/img/readme/rtd_add.png)\n\n#### List all uncompleted todos\n```bash\nrtd\nrtd -l\nrtd -l uncompleted\nrtd --list\nrtd --list uncompleted\n```\n\n![rtd_list_uncompleted](Tutorial/doc/img/readme/rtd_list_uncompleted.png)\n\n#### Complete a todo\n```bash\nrtd -c \u003citem-id\u003e\nrtd --complete \u003citem-id\u003e\n```\n\n![rtd_complete_item](Tutorial/doc/img/readme/rtd_complete_item.png)\n\n#### List all completed todos\n```bash\nrtd -l completed\nrtd --list completed\n```\n\n![rtd_list_completed](Tutorial/doc/img/readme/rtd_list_completed.png)\n\n#### Uncomplete a todo\n```bash\nrtd -u \u003citem-id\u003e\nrtd --uncomplete \u003citem-id\u003e\n```\n\n![rtd_uncomplete_item](Tutorial/doc/img/readme/rtd_uncomplete_item.png)\n\n#### Throw a todo into the recycle bin\n```bash\nrtd -d \u003citem-id\u003e\nrtd --delete \u003citem-id\u003e\n```\n\n![rtd_delete_item](Tutorial/doc/img/readme/rtd_delete_item.png)\n\n#### List all recycle bin todos\n```bash\nrtd -l deleted\nrtd --list deleted\n```\n\n![rtd_list_deleted](Tutorial/doc/img/readme/rtd_list_deleted.png)\n\n#### Restore a todo from the recycle bin\n```bash\nrtd -r \u003citem-id\u003e\nrtd --restore \u003citem-id\u003e\n```\n\n![rtd_restore_item](Tutorial/doc/img/readme/rtd_restore_item.png)\n\n#### Physically destroy a todo\n```bash\nrtd --destroy \u003citem-id\u003e\n```\n\n![rtd_destroy_item](Tutorial/doc/img/readme/rtd_destroy_item.png)\n\n#### Empty recycle bin\n```bash\nrtd --destroy-deleted\n```\n\n![rtd_destroy_deleted](Tutorial/doc/img/readme/rtd_destroy_deleted.png)\n\n#### List all todos\n```bash\nrtd -l all\nrtd --list all\n```\n\n![rtd_list_all](Tutorial/doc/img/readme/rtd_list_all.png)\n\n#### Clear all todos\n```bash\nrtd --clear\n```\n\n![rtd_clear](Tutorial/doc/img/readme/rtd_clear.png)\n\n## About author\n\nCuppar He(He Zhiying), software development engineer, likes programming, technical writing, learning new things, especially computer science, worked for [SAP](https://www.sap.com/)([World Top 100](https://www.rankingthebrands.com/Brand-detail.aspx?brandID=22)) and [Alibaba Group](https://www.alibabagroup.com/)([World Top 100](https://www.rankingthebrands.com/Brand-detail.aspx?brandID=6245) \u0026 Chinese internet giant). I am currently in Gap Year, if you are looking for a software development engineer and can provide a high-quality offer(Both remote and on-site), please contact me `cuppar.hzy@gmail.com`.","funding_links":[],"categories":["Rust","Resources"],"sub_categories":["Web programming"],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcuppar%2Frtd","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcuppar%2Frtd","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcuppar%2Frtd/lists"}