- Notifications
You must be signed in to change notification settings - Fork190
🧞The highly productive Julia web framework
License
GenieFramework/Genie.jl
Folders and files
Name | Name | Last commit message | Last commit date | |
---|---|---|---|---|
Repository files navigation
Genie.jl is the backbone of theGenie Framework, which provides a streamlined and efficient workflow for developing modern web applications. It builds on Julia's strengths (high-level, high-performance, dynamic, JIT compiled), exposing a rich API and a powerful toolset for productive web development.
Genie Framework is composed of four main components:
- Genie.jl: the server backend, providing features for routing, templating, authentication, and much more.
- Stipple.jl: a package for building reactive UIs with a simple and powerful low-code API in pure Julia.
- Genie Builder: a VSCode plugin for building UIs visually in a drag-and-drop editor.
- SearchLight.jl: a complete ORM solution, enabling easy database integration without writing SQL queries.
To learn more about Genie, visit thedocumentation, and theapp gallery.
If you need help with anything, you can find us onDiscord.
geniedashboard.mp4
Julia data dashboard powered by Genie.App gallery
🛠Genie Router: Genie has a really powerful💪Router
. Matching web requests to functions, extracting and setting up the request's variables and the execution environment, and invoking the response methods. Features include:
- Static, Dynamic, Named routing
- Routing parameters
- Linking routes
- Route management (Listing, Deleting, Modifying) support
- Routing methods (
GET
,POST
,PUT
,PATCH
,DELETE
,OPTIONS
) - and more ...
# Genie Hello World!# As simple as Hellousing Genieroute("/hello")do"Welcome to Genie!"end# Powerful high-performance HTML view templatesusing Genie.Renderer.Htmlroute("/html")doh1("Welcome to Genie!")|> htmlend# JSON rendering built inusing Genie.Renderer.Jsonroute("/json")do (:greeting=>"Welcome to Genie!")|> jsonend# Start the app!up(8888)
🔌WebSocket: Genie provides a powerful workflow for client-server communication over websockets
julia>using Genie, Genie.Routerjulia>channel("/foo/bar")do # process request end[WS] /foo/bar => #1 | :foo_bar
📃Templating: Built-in templates support forHTML
,JSON
,Markdown
,JavaScript
views.
🔐Authentication: Easy to add database backed authentication for restricted area of a website.
julia>using Pkgjulia> Pkg.add("GenieAuthentication")# adding authentication pluginjulia>using GenieAuthenticationjulia> GenieAuthentication.install(@__DIR__)
⏰Tasks: Tasks allow you to perform various operations and hook them with crons jobs for automation
module S3DBTask# ... hidden code""" Downloads S3 files to local disk. Populate the database from CSV file"""functionruntask()mktempdir()do directory@info"Path of directory" directory# download record filedownload(RECORD_URL)# unzip fileunzip(directory)# dump to databasedbdump(directory)endend# ... more hidden codeend
$ bin/runtask S3DBTask
📦Plugin Ecosystem: Explore plugins built by the community such asGenieAuthentication,GenieAutoreload,GenieAuthorisation, and more
🗃️ORM Support: ExploreSearchLight a complete ORM solution for Genie, supporting Postgres, MySQL, SQLite and other adapters
functionsearch(user_names, regions, startdate, enddate)# ... hidden code where_filters= SQLWhereEntity[SQLWhereExpression("lower(user_name) IN ($(repeat("?,",length(user_names))[1:end-1] ) )", user_names),SQLWhereExpression("date >= ? AND date <= ?", startdate, enddate) ] SearchLight.find(UserRecord, where_filters, order=["record.date"])# ... more hidden codeend
Database Migrations
module CreateTableRecordimport SearchLight.Migrations: create_table, column, primary_key, add_index, drop_tablefunctionup()create_table(:record)do [primary_key()column(:user_uuid,:string, limit=100)column(:user_name,:string, limit=100)column(:status,:integer, limit=4)column(:region,:string, limit=20)column(:date_of_birth,:string, limit=100) ]endadd_index(:record,:user_uuid)add_index(:record,:user_name)add_index(:record,:region)add_index(:record,:date_of_birth)endfunctiondown()drop_table(:record)endend
Model Validations
📝 More Genie features like:
Files Uploads
route("/", method= POST)doifinfilespayload(:yourfile)write(filespayload(:yourfile))stat(filename(filespayload(:yourfile)))else"No file uploaded"endend
Logging
|Caching
|Cookies and Sessions
|Docker, Heroku, JuliaHub, etc Integrations
|Genie Deploy
- To explore more features checkGenie Documentation 🏃♂️🏃♀️
Please contribute usingGitHub Flow. Create a branch, add commits, andopen a pull request.
Please readCONTRIBUTING
for details on ourCODE OF CONDUCT
, and the process for submitting pull requests to us.
The awesome Genie logo was designed by Alvaro Casanova
Hoppscoth for readme structure template
Genie uses a multitude of packages that have been kindly contributed by the Julia community
This project is licensed under theMIT License - see theLICENSE
file for details.
⭐ If you enjoy this project please consider starring the 🧞Genie.jl GitHub repo. It will help us fund our open source projects.
About
🧞The highly productive Julia web framework