{"id":13568728,"url":"https://github.com/joy-framework/joy","last_synced_at":"2025-04-04T05:30:23.858Z","repository":{"id":43781495,"uuid":"205866579","full_name":"joy-framework/joy","owner":"joy-framework","description":"A full stack web framework written in janet","archived":false,"fork":false,"pushed_at":"2023-11-16T15:45:14.000Z","size":2320,"stargazers_count":535,"open_issues_count":20,"forks_count":30,"subscribers_count":13,"default_branch":"master","last_synced_at":"2024-11-05T01:34:19.661Z","etag":null,"topics":["janet","janet-lang","joy","sqlite","web","web-application-framework","web-framework","webframework"],"latest_commit_sha":null,"homepage":"https://joy.swlkr.com","language":"Clojure","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/joy-framework.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":".github/FUNDING.yml","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,"dei":null,"publiccode":null,"codemeta":null},"funding":{"github":["swlkr"]}},"created_at":"2019-09-02T13:46:26.000Z","updated_at":"2024-10-25T18:20:27.000Z","dependencies_parsed_at":"2024-01-13T15:37:23.716Z","dependency_job_id":"1ec46f4a-a7e8-4cfc-9045-2a08f220d01b","html_url":"https://github.com/joy-framework/joy","commit_stats":null,"previous_names":[],"tags_count":14,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/joy-framework%2Fjoy","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/joy-framework%2Fjoy/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/joy-framework%2Fjoy/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/joy-framework%2Fjoy/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/joy-framework","download_url":"https://codeload.github.com/joy-framework/joy/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247128695,"owners_count":20888232,"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":["janet","janet-lang","joy","sqlite","web","web-application-framework","web-framework","webframework"],"created_at":"2024-08-01T14:00:30.987Z","updated_at":"2025-04-04T05:30:23.465Z","avatar_url":"https://github.com/joy-framework.png","language":"Clojure","readme":"## You Found Joy!\n\nJoy is a full stack web framework written in [janet](https://github.com/janet-lang/janet)\n\n```clojure\n(use joy)\n\n(route :get \"/\" :home)\n(defn home [request]\n  (text/plain \"You found joy!\"))\n\n(def app (app))\n\n(server app 9001)\n```\n\n## Getting Started\n\nFirst make sure [janet is installed](https://janet-lang.org/docs/index.html)\n\nNext, install the joy cli like this\n\n```sh\njpm install joy\n```\n\nHopefully the `joy` executable will be on your path and ready to roll. If it isn't and you're like me and use homebrew, add this to your `.zprofile`:\n\n```sh\nexport PATH=/usr/local/Cellar/janet/\u003cyour janet version here\u003e/bin:$PATH\n```\n\nThen make sure you reload the profile:\n\n```sh\nsource ~/.zprofile\n```\n\nNow, run the following from your terminal\n\n```sh\njoy new my-joy-project\n```\n\nThis should create a new directory called `my-joy-project` and it should create a few files and things\nto get you started. \n\n### Taking it for a spin\n\nNow that we have a project set up, it's time to test it out in the browser:\n\n```sh\njoy server\n```\n\nThis should start an http server that's listening at http://localhost:9001.\n\nNext, let's create a database, a table and connect it with routes and a few functions for handling requests.\n\n### Create a new sqlite database\n\nIf you aren't already in the `my-joy-project` directory, go ahead and get in there. Now run\n\n```sh\njoy create db\n```\n\nThis creates a new empty database named `dev.sqlite3`. \n\nThe default template doesn't assume you want a database so you'll need to connect to it in `main.janet`:\n\n```clojure\n; # main.janet\n\n(defn main [\u0026 args]\n  (db/connect (env :database-url))\n  (server app (env :port))\n  (db/disconnect))\n```\n\n### Create a database table\n\nRun this to create a new migration with a table with a few columns:\n\n```sh\njoy create table account 'email text unique not null' 'password text not null'\n```\n\nThis has created one file in your db/migrations folder that is waiting to get applied to the database.\n\n### Run database migrations\n\nRun this from your terminal\n\n```sh\njoy migrate\n```\n\nThis will migrate your database and create a new file `db/schema.sql`\n\n### Generate helpful routes\n\nIn joy there are no ORMs, no classes, and no objects, just functions that take requests and return responses.\n\nLet's generate a few routes for the table from earlier:\n\n```sh\njoy create controller account\n```\n\nThose commands have created another new file: `routes/account.janet` and updated your `main.janet` file with an import statement so the account routes get set up.\n\nGo ahead and check out the new `account` routes in the browser now: `http://localhost:9001/accounts`\n\nJoy can do a lot more than that, [check out the docs here](https://github.com/joy-framework/joy/blob/master/docs/readme.md)\n\n## Why?\n\nI wanted something that felt like [coast](https://coastonclojure.com) but took so little resources (memory + cpu) I could run dozens (if not hundreds) of websites on a cheap [VPS](https://www.vultr.com/?ref=7614094).\n\n## Docker/Docker Compose\n\nIn order to make using joy more portable, we wanted to include a Dockerfile that creates an easy place for you to mount your code in and run joy without having to install anything or manage permissions on your local.\n","funding_links":["https://github.com/sponsors/swlkr"],"categories":["web","Clojure","Web"],"sub_categories":["repl","Frameworks"],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjoy-framework%2Fjoy","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjoy-framework%2Fjoy","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjoy-framework%2Fjoy/lists"}