Enjure
Every Clojure Developer's nightmare: An opinionated Clojure web framework.
Get StartedUsage
Enjure requires the base Clojure install with the command line tools.
Installation
$ git clone https://github.com/janetacarr/enjure.git && cd enjure
$ clj -T:build install-cli
Note: You'll possibly be prompted for a password as the enjure CLI requires root permissions to install. (Supports Linux / Mac OS only right now)
Creating a Project
$ cd ~
$ enjure new hello-enjure && cd hello-enjure
$ enjure serve
CLI Commands
- serve - Starts the web server
- notes - Print all NOTES, FIXME, HACK, and TODO in project.
- generate - Create a new controller, page, entity, or migration.
- destroy - Delete a new controller, page, entity, or migration.
- migrate - Run the database migrations.
- help - Print this message.
Design Philosophy
Enjure revolves around a few core concepts:
- Easy to get going, and easy to keep going.
- Enjure provides a tight toolchain for easy project setup and scalable architecture to support long-term growth.
- Less components means less complexity.
- Enjure aims to use minimal components to achieve its goals, avoiding unnecessary complexity.
- Convention over configuration.
- Enjure limits configuration to reduce errors and streamline development.
- Real value over re-packaging.
- Enjure focuses on innovative software design rather than just repackaging existing libraries.
- Your opinion, your library.
- Enjure embraces being opinionated to provide clear direction and reduce decision fatigue.
- A holistic approach.
- Enjure considers the interoperability and impact of all components in the system.
Architecture
Enjure follows a modified Model-View-Controller (MVC) architecture, tailored for Clojure development:
- Model: Represents the data structure. (Note: Currently not implemented)
- View: Handled by the 'pages' in Enjure, responsible for rendering the user interface.
- Controller: Manages the flow of data between Model and View, handling user inputs and system responses.
Key architectural features:
- Opinionated structure for rapid development
- Built-in routing system (though currently slower compared to Reitit)
- Separation of concerns with distinct directories for controllers and pages
- Future plans for database migrations and entity management
Enjure aims to provide a structured yet flexible framework for Clojure web development, allowing developers to focus on building features rather than setting up boilerplate code.
Structure
Enjure follows the typical MVC architecture:
$ cd hello-enjure && tree .
├── deps.edn
├── enjure.edn
└── src
└── hello_enjure
├── controllers
│ └── signin.clj
├── core.clj
└── pages
└── index.clj
(Model is missing because it hasn't been implemented yet)
Known Issues
- No models / entities / migrations (yet).
- No controllers request coercion for params (yet).
- Router adds 'ghost' path params.
- Router slow AF compared to Reitit.
Unknown Issues
Probably plenty, just haven't found them yet.