{"id":13424385,"url":"https://github.com/coast-framework/coast","last_synced_at":"2025-12-12T01:10:45.586Z","repository":{"id":38146719,"uuid":"115385537","full_name":"coast-framework/coast","owner":"coast-framework","description":"The fullest full stack clojure web framework","archived":false,"fork":false,"pushed_at":"2023-02-01T04:38:52.000Z","size":1217,"stargazers_count":562,"open_issues_count":18,"forks_count":31,"subscribers_count":17,"default_branch":"master","last_synced_at":"2025-03-09T04:47:54.342Z","etag":null,"topics":["clojure","coast","database","edn","framework","html","sql","web"],"latest_commit_sha":null,"homepage":"https://coast.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/coast-framework.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":"docs/security-intro.md","support":null,"governance":null,"roadmap":null,"authors":null}},"created_at":"2017-12-26T04:31:31.000Z","updated_at":"2025-01-20T21:19:20.000Z","dependencies_parsed_at":"2023-02-15T18:45:56.718Z","dependency_job_id":null,"html_url":"https://github.com/coast-framework/coast","commit_stats":{"total_commits":830,"total_committers":17,"mean_commits":48.8235294117647,"dds":"0.19397590361445782","last_synced_commit":"5d4a6db4cd87ed9a6d0e3015fdaec0ba0e1b6012"},"previous_names":["swlkr/coast"],"tags_count":89,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/coast-framework%2Fcoast","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/coast-framework%2Fcoast/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/coast-framework%2Fcoast/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/coast-framework%2Fcoast/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/coast-framework","download_url":"https://codeload.github.com/coast-framework/coast/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243775839,"owners_count":20346274,"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":["clojure","coast","database","edn","framework","html","sql","web"],"created_at":"2024-07-31T00:00:53.575Z","updated_at":"2025-12-12T01:10:45.538Z","avatar_url":"https://github.com/coast-framework.png","language":"Clojure","readme":"## What is this?\n\nCoast is a full stack web framework written in Clojure for small teams or solo developers. It uses a relational database and renders HTML on the server without Javascript which allows you to ship your web applications faster.\n\n```clojure\n(ns server\n  (:require [coast]))\n\n(def routes [[:get \"/\" ::home]])\n\n(defn home [request]\n  \"You're coasting on clojure!\")\n\n(def app (coast/app {:routes routes}))\n\n(coast/server app {:port 1337})\n```\n\n## 🚨 New version alert 🚨\n\nCheck out the [next branch](https://github.com/coast-framework/coast/tree/next) for the changes coming to coast v1.0\n\n## Discussion\n\nFeel free to ask questions on the [coast gitter channel](https://gitter.im/coast-framework/community).\n\n## Docs\n\n[More comprehensive docs are available here](docs/readme.md)\n\n## Quickstart\n\nIf you don't want to read the docs, and just want to jump in, you're in the right place.\n\n### Installation on Mac\n\n1. Make sure clojure is installed first\n\n```bash\nbrew install clojure\n```\n\n2. Install the coast cli script\n\n```bash\ncurl -o /usr/local/bin/coast https://raw.githubusercontent.com/coast-framework/coast/master/coast \u0026\u0026 chmod a+x /usr/local/bin/coast\n```\n\n3. Create a new coast project\n\n```bash\ncoast new myapp \u0026\u0026 cd myapp\n```\n\n### Installation on Linux (Debian/Ubuntu)\n\n1. Make sure you have bash, curl, rlwrap, and Java installed\n\n```bash\ncurl -O https://download.clojure.org/install/linux-install-1.9.0.391.sh\nchmod +x linux-install-1.9.0.391.sh\nsudo ./linux-install-1.9.0.391.sh\n```\n\n2. Install the coast cli script\n\n```bash\nsudo curl -o /usr/local/bin/coast https://raw.githubusercontent.com/coast-framework/coast/master/coast \u0026\u0026 sudo chmod a+x /usr/local/bin/coast\n```\n\n3. Create a new coast project\n\n```bash\ncoast new myapp \u0026\u0026 cd myapp\n```\n\nThis will take you from a fresh coast installation to a working todo list app.\n\n### New Project\n\nThe first thing you do when you start a coast project? `coast new` in your terminal:\n\n```bash\ncoast new todos\n```\n\nThis will make a new folder in the current directory named \"todos\". Let's get in there and see what's up:\n\n```bash\ncd todos\ntree .\n```\n\nThis will show you the layout of a default coast project:\n\n```bash\n.\n├── Makefile\n├── README.md\n├── bin\n│   └── repl.clj\n├── db\n│   ├── db.edn\n│   └── associations.clj\n├── deps.edn\n├── env.edn\n├── resources\n│   ├── assets.edn\n│   └── public\n│       ├── css\n│       │   ├── app.css\n│       │   └── tachyons.min.css\n│       └── js\n│           ├── app.js\n│           └── jquery.min.js\n├── src\n│   ├── components.clj\n│   ├── home.clj\n│   ├── routes.clj\n│   └── server.clj\n└── test\n    └── server_test.clj\n```\n\n### Start the dev server\n\nType this in your terminal in your project directory\n\n```bash\nmake server\n```\n\nand visit `http://localhost:1337` to see the welcoming coast on clojure default page ✨\n\nThis should also create a sqlite database with the name of the database defined in `db.edn` and the `COAST_ENV` or `:coast-env` environment variable defined in `env.edn`.\n\n### Migrations\n\nNow that the database is created, let's generate a migration:\n\n```bash\ncoast gen migration create-table-todo name:text finished:bool\n# db/migrations/20190926190239_create_table_todo.clj created\n```\n\nThis will create a file in `db/migrations` with a timestamp and whatever name you gave it, in this case: `create_table_todo`\n\n```clojure\n(ns migrations.20190926190239-create-table-todo\n  (:require [coast.db.migrations :refer :all]))\n\n(defn change []\n  (create-table :todo\n    (text :name)\n    (bool :finished)\n    (timestamps)))\n```\n\nThis is Clojure, not SQL, although plain SQL migrations would work just fine. Time to apply this migration to the database:\n\n```bash\nmake db/migrate\n# clj -m coast.migrations migrate\n#\n# -- Migrating:  20190310121319_create_table_todo ---------------------\n#\n# create table todo ( id integer primary key, name text, finished boolean, updated_at timestamp, created_at timestamp not null default current_timestamp )\n#\n# -- 20190310121319_create_table_todo ---------------------\n#\n# 20190310121319_create_table_todo migrated successfully\n```\n\nThis updates the database schema with a `todo` table. Time to move on to the clojure code.\n\n### Generators\n\nNow that the database has been migrated, this is where coast's generators come in. Rather than you having to type everything out by hand and read docs as you go, generators are a way to get you started and you can customize what you need from there.\n\nThis will create a file in the `src` directory with the name of a table. Coast is a pretty humble web framework, there's no FRP or ~~graph query languages~~ or anything. There are just files with seven functions each: `build`, `create`, `view`, `edit`, `change`, `delete` and `index`.\n\n```bash\ncoast gen code todo\n# src/todo.clj created successfully\n```\n\nCoast uses a library under the hood called [hiccup](https://github.com/weavejester/hiccup) to generate HTML.\n\n### Routes\n\nOne thing coast doesn't do yet is update the routes file, let's do that now:\n\n```clojure\n(ns routes\n  (:require [coast]))\n\n(def routes\n  (coast/site\n    (coast/with-layout :components/layout\n      [:get \"/\" :home/index]\n      [:resource :todo]))) ; add this line\n```\n\nThe routes are also clojure vectors, with each element of the route indicating which HTTP method, url and function to call, along with an optional route name if you don't like the `namespace`/`function` name.  \n\n```[:resource :todo]``` sets up basic [CRUD routes](https://coastonclojure.com/docs/routing.md#user-content-route-resources) in one line.\n\n### Start the server\n\n#### From the command line\n\nLet's check it out from the terminal. Run this\n\n```bash\nmake server\n```\n\nand visit `http://localhost:1337/todos` to see the app in action.\n\n#### From the REPL\nI currently use atom with [parinfer](https://shaunlebron.github.io/parinfer/) and [chlorine](https://github.com/mauricioszabo/atom-chlorine) as my REPL client, check it out if you want a smooth clojure experience.\n\nFirst run, the repl socket server:\n\n```bash\nmake repl\n```\n\nThen in your editor, connect to the repl server.\n\nIn atom with chlorine for example:\n\nPress `space + c`, fill in the port with `5555` and hit `Enter`.\n\nAfter you're connected, load the `server.clj` file with `Chlorine: Load File`.\n\nFinally, move your cursor to `(-main)` and evaluate with `Cmd+Enter`.\n\nNavigate to http://localhost:1337/todos and check out your handiwork.\n\n### Tested on Different Platforms\n\n#### Tested on Clojure 1.10.0 on MacOS using brew to install Clojure\n\nreadline versions might clash depending on your setup. You might need to downgrade to a lower version of readline depending on your version of Clojure. For example... readline version 7.0 for clojure 1.9\n\n## Contributing\n\nAny contribution is welcome! Submit a PR and let's get it merged in!\n\n## License\n\nCoast on Clojure is released under the [MIT License](https://opensource.org/licenses/MIT).\n","funding_links":[],"categories":["Clojure"],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcoast-framework%2Fcoast","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcoast-framework%2Fcoast","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcoast-framework%2Fcoast/lists"}