{"id":26600730,"url":"https://github.com/btbytes/tohray","last_synced_at":"2025-04-09T16:23:44.086Z","repository":{"id":251834154,"uuid":"838559310","full_name":"btbytes/tohray","owner":"btbytes","description":"Microblogging application for one person","archived":false,"fork":false,"pushed_at":"2024-08-11T03:18:26.000Z","size":99,"stargazers_count":6,"open_issues_count":0,"forks_count":1,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-04-02T21:40:52.398Z","etag":null,"topics":["docker","flyio","karax-vdom","nim","prologue-framework","terminalcss"],"latest_commit_sha":null,"homepage":"https://tohray.fly.dev","language":"Nim","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/btbytes.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.txt","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-08-05T22:35:51.000Z","updated_at":"2025-01-24T05:58:29.000Z","dependencies_parsed_at":"2025-03-23T18:45:11.800Z","dependency_job_id":null,"html_url":"https://github.com/btbytes/tohray","commit_stats":null,"previous_names":["btbytes/tohray"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/btbytes%2Ftohray","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/btbytes%2Ftohray/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/btbytes%2Ftohray/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/btbytes%2Ftohray/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/btbytes","download_url":"https://codeload.github.com/btbytes/tohray/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248065935,"owners_count":21042003,"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":["docker","flyio","karax-vdom","nim","prologue-framework","terminalcss"],"created_at":"2025-03-23T18:34:11.850Z","updated_at":"2025-04-09T16:23:44.079Z","avatar_url":"https://github.com/btbytes.png","language":"Nim","readme":"# tohray\n\n[ತೊರೆ](https://kn.wiktionary.org/wiki/ತೊರೆ), pronounced \"toh-ray\" (with a dental 't' sound),\nis a microblogging application to capture stream of thoughts inspired by [Linus Lee](https://thesephist.com)'s [Stream](https://stream.thesephist.com)\n\nThe word ತೊರೆ in [Kannada](https://en.wikipedia.org/wiki/Kannada) has multiple meanings, but most commonly\nas rivulet, forego, divest; which are indeed appropriate description for the intent.\n\nYou can see this in action at \u003chttps://tohray.fly.dev\u003e.\n\n## Features\n\n- Write new posts\n- In markdown\n- Edit posts\n- Delete posts\n- Click on the date to see posts written during that *month*.\n- Supports multiple users, but I really wrote it for one user.\n- You can allow users to sign up by giving them the `inviteCode`\n- Export all the feeds from `/export` endpoint.\n    - default format is JSON\n    - append `?format=md` to export in markdown format ie., `/export?format=md`. The entries are returned with a File Seperator (ASCII 28) after each entry.\n- Calendar view by month at `/calendar` to see all the posts belonging to a month.\n\n## Non-Features\n\n- There is no \"user management\".\n- There is no \"password reset\".\n\n## Technology Details\n\nLinus wrote his [stream app](https://github.com/thesephist/stream) using a language he created himself - [Oaklang](https://oaklang.org).\nI wanted an excuse to use Nim for something \"useful\", so I used Nim, and it was a great experience.\n\nNim is a fast, and friendly language that is statically typed, while looking like Python in Syntax.\nIt compiles the source code into C (or C++, or Javascript), which allows the programs written in it\nto be very fast, small, and quite portable.\n\n- Programming Language: [Nim](https://nim-lang.org)\n- Framework: [Prologue](https://planety.github.io/prologue/), which in turn uses [Karax](https://github.com/karaxnim/karax).\n- Database: SQLite\n- CSS: [Terminal](https://terminalcss.xyz)\n- Cloud: Tested on \u003chttps://fly.io\u003e\n- Editor: eh.. didn't know you cared, but it was written on [Zed](https://zed.dev) which has decent support\nfor editing Nim with `nimlangserver`.\n\n## Programming Notes\n\n- The `views.nim` file way too long, but I'm not ashamed of it. It's app I wrote for myself, and it\nfits into myhead perfectly fine.\n- The decision to compile secrets into the binary was made after realizing that managing secrets in\nthe environment, `.env` files, `consts.nim` .. multiple places is just busy work. Not how I would write\na \"production\" application.. but this is a \"hobby\" application. And, whatever makes me happy to keep\nwriting code will remain.\n\n## Installation\n\n- Clone this directory\n- Have [nim](//nim-lang.org) installed on your computer\n- copy `example-consts.nim` to `consts.nim` and **set the variables**\n- NOTE: The config is compiled into the binary. There is no \"config file\"\n- Compile the app with `$ nim compile toray.nim`\n- Launch the program with `./tohray`, and the program will start on port `:8080` - \u003chttp://localhost:8080\u003e\n- Go to \u003chttp://localhost:8080/register\u003e (not visible on the web page itself)\n- Use the `inviteCode` you set in `consts.nim` along with your name and password\n- Click on `Write` to start writing. I recomment writing a post with slug `about` so that the `about` link on the top nav actually goes to the about page.\n- The data is stored in a `sqlite` databse given in the `consts.nim` file\n- NOTE: if you want to see how the blog looks with some entries in it, you can run `sqlite3 tohray.db \u003c test.sql` to see some `lorem ipsum` content.\n\n## Installation on fly.io\n\nI wrote this so that I can run it `fly.io`.  Study the `Dockerfile` and `fly.toml`.\n\nObserve how I copy `fly-consts.nim` to `consts.nim` in the `Dockerfile`. This allows you to have a\nlocal copy (on the computer) with the secrets etc, but will be compiled into the binary on deployment.\n\nTo create the volume where the database is stored (`/mnt/db` in `fly.toml`), you have to use this\ncommand: `fly volumes create db -r atl`. Here, `atl` stands for Atlanta, where I launched the app.\nThe app and the volume should be in the same zone.\n\n## Todo\n\n- [x] Export all the posts in a JSON file (and markdown)\n- [x] Add a calendar view\n- [x] Edit Posts. ~~Don't hold your breath~~\n- [x] Add calendar and export links\n- [x] RSS Feed\n- [ ] Fix Broken Search\n- [ ] Fix \"Next Page\" and \"Previous Page\" navigation\n- [ ] Implement `/import`\n- [ ] Deploy on other PaaS platforms like unicraft etc.\n- [ ] Make a static build of this docker image. Currently, it is using a full sized Ubuntu Normal image. bleh.\n- [ ] Make it [Apple podcast compatible](https://github.com/godofredoninja/simply/pull/150)\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbtbytes%2Ftohray","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbtbytes%2Ftohray","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbtbytes%2Ftohray/lists"}