All Projects → joy-framework → Joy

joy-framework / Joy

Licence: mit
A full stack web framework written in janet

Programming Languages

clojure
4091 projects

Projects that are alternatives of or similar to Joy

Actframework
An easy to use Java MVC server stack
Stars: ✭ 690 (+111.01%)
Mutual labels:  web-framework, webframework
Rapidoid
Rapidoid - Extremely Fast, Simple and Powerful Java Web Framework and HTTP Server!
Stars: ✭ 1,571 (+380.43%)
Mutual labels:  web-framework, webframework
Aah
A secure, flexible, rapid Go web framework
Stars: ✭ 647 (+97.86%)
Mutual labels:  web-framework, webframework
Webgo
A minimal framework to build web apps; with handler chaining, middleware support; and most of all standard library compliant HTTP handlers(i.e. http.HandlerFunc).
Stars: ✭ 165 (-49.54%)
Mutual labels:  web-framework, webframework
Simplify.Web
Moved to https://github.com/SimplifyNet. Simplify.Web is a lightweight and fast server-side .NET web-framework based on MVC and OWIN for building HTTP based web-applications, RESTful APIs etc.
Stars: ✭ 23 (-92.97%)
Mutual labels:  web-framework, web-application-framework
mif
MIF is a C++11 web-application framework designed for the backend micro-service development
Stars: ✭ 42 (-87.16%)
Mutual labels:  web-framework, web-application-framework
Jooby
The modular web framework for Java and Kotlin
Stars: ✭ 1,309 (+300.31%)
Mutual labels:  web-framework, webframework
Revel
A high productivity, full-stack web framework for the Go language.
Stars: ✭ 12,463 (+3711.31%)
Mutual labels:  web-framework, web-application-framework
fano
Pascal web application framework
Stars: ✭ 90 (-72.48%)
Mutual labels:  web-framework, web-application-framework
Fuga-Framework
Web Framework for Java
Stars: ✭ 15 (-95.41%)
Mutual labels:  web-framework, web-application-framework
fano
Pascal web application framework
Stars: ✭ 21 (-93.58%)
Mutual labels:  web-framework, web-application-framework
Flex Sdk
Mirror of Apache Flex SDK
Stars: ✭ 321 (-1.83%)
Mutual labels:  web-framework
Squeal
A Swift wrapper for SQLite databases
Stars: ✭ 303 (-7.34%)
Mutual labels:  sqlite
Catena
Catena is a distributed database based on a blockchain, accessible using SQL.
Stars: ✭ 302 (-7.65%)
Mutual labels:  sqlite
Flow
Flow is a Java framework binding Vaadin web components to Java. This is part of Vaadin 10+.
Stars: ✭ 296 (-9.48%)
Mutual labels:  web-application-framework
Rdbc
Rust DataBase Connectivity (RDBC) :: Common Rust API for database drivers
Stars: ✭ 328 (+0.31%)
Mutual labels:  sqlite
Ofbiz Framework
Apache OFBiz is an open source product for the automation of enterprise processes. It includes framework components and business applications for ERP, CRM, E-Business/E-Commerce, Supply Chain Management and Manufacturing Resource Planning. OFBiz provides a foundation and starting point for reliable, secure and scalable enterprise solutions.
Stars: ✭ 315 (-3.67%)
Mutual labels:  web-framework
Node Orm2
Object Relational Mapping
Stars: ✭ 3,063 (+836.7%)
Mutual labels:  sqlite
Requery
requery - modern SQL based query & persistence for Java / Kotlin / Android
Stars: ✭ 3,071 (+839.14%)
Mutual labels:  sqlite
Phoenix
Peace of mind from prototype to production
Stars: ✭ 17,476 (+5244.34%)
Mutual labels:  web-framework

You Found Joy!

Joy is a full stack web framework written in janet

(use joy)

(route :get "/" :home)
(defn home [request]
  (text/plain "You found joy!"))

(def app (app))

(server app 9001)

Getting Started

First make sure janet is installed

Next, install the joy cli like this

jpm install joy

Hopefully 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:

export PATH=/usr/local/Cellar/janet/<your janet version here>/bin:$PATH

Then make sure you reload the profile:

source ~/.zprofile

Now, run the following from your terminal

joy new my-joy-project

This should create a new directory called my-joy-project and it should create a few files and things to get you started.

Taking it for a spin

Now that we have a project set up, it's time to test it out in the browser:

joy server

This should start an http server that's listening at http://localhost:9001.

Next, let's create a database, a table and connect it with routes and a few functions for handling requests.

Create a new sqlite database

If you aren't already in the my-joy-project directory, go ahead and get in there. Now run

joy create db

This creates a new empty database named dev.sqlite3.

The default template doesn't assume you want a database so you'll need to connect to it in main.janet:

; # main.janet

(defn main [& args]
  (db/connect (env :database-url))
  (server app (env :port))
  (db/disconnect))

Create a database table

Run this to create a new migration with a table with a few columns:

joy create table account 'email text unique not null' 'password text not null'

This has created one file in your db/migrations folder that is waiting to get applied to the database.

Run database migrations

Run this from your terminal

joy migrate

This will migrate your database and create a new file db/schema.sql

Generate helpful routes

In joy there are no ORMs, no classes, and no objects, just functions that take requests and return responses.

Let's generate a few routes for the table from earlier:

joy create controller account

Those 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.

Go ahead and check out the new account routes in the browser now: http://localhost:9001/accounts

Joy can do a lot more than that, check out the docs here

Why?

I wanted something that felt like coast but took so little resources (memory + cpu) I could run dozens (if not hundreds) of websites on a cheap VPS.

Docker/Docker Compose

In 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.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].