Home

Awesome

<div align="center"> <a href="https://genieframework.com/"> <img src="docs/content/img/genie-lightblue.svg" alt="Genie Logo" height="64" /> </a> <br /> <p> <h3> <b> Genie.jl </b> </h3> </p> <p> <b> šŸ§ž The highly productive Julia web framework </b> </p> <p>

Docs current status Website Tests Genie Downloads Tweet

</p> <p> <sub> Built with ā¤ļøŽ by <a href="https://github.com/GenieFramework/Genie.jl/graphs/contributors"> contributors </a> </sub> </p> </div>

Genie.jl is the backbone of the Genie 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:

To learn more about Genie, visit the documentation, and the app gallery.

If you need help with anything, you can find us on Discord.

https://github.com/GenieFramework/Genie.jl/assets/5058397/627dcda0-bb13-49f9-8827-2bfb581a9bb7

<p style="font-family:verdana;font-size:60%;margin-bottom:4%" align="center"> <u>Julia data dashboard powered by Genie. <a href="https://learn.genieframework.com/app-gallery">App gallery</a></u> </p>

</details>

Features of Genie.jl

šŸ› 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:

# Genie Hello World!
# As simple as Hello
using Genie
route("/hello") do
    "Welcome to Genie!"
end

# Powerful high-performance HTML view templates
using Genie.Renderer.Html
route("/html") do
    h1("Welcome to Genie!") |> html
end

# JSON rendering built in
using Genie.Renderer.Json
route("/json") do
    (:greeting => "Welcome to Genie!") |> json
end

# Start the app!
up(8888)

šŸ”Œ WebSocket: Genie provides a powerful workflow for client-server communication over websockets

julia> using Genie, Genie.Router

julia> channel("/foo/bar") do
         # process request
       end
[WS] /foo/bar => #1 | :foo_bar

šŸ“ƒ Templating: Built-in templates support for HTML, JSON, Markdown, JavaScript views.

šŸ” Authentication: Easy to add database backed authentication for restricted area of a website.

julia> using Pkg

julia> Pkg.add("GenieAuthentication") # adding authentication plugin

julia> using GenieAuthentication

julia> 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
  """
  function runtask()
    mktempdir() do directory
      @info "Path of directory" directory
      # download record file
      download(RECORD_URL)

      # unzip file
      unzip(directory)

      # dump to database
      dbdump(directory)
    end
  end

# ... more hidden code
end
$ bin/runtask S3DBTask

šŸ“¦ Plugin Ecosystem: Explore plugins built by the community such as GenieAuthentication, GenieAutoreload, GenieAuthorisation, and more

šŸ—ƒļø ORM Support: Explore SearchLight a complete ORM solution for Genie, supporting Postgres, MySQL, SQLite and other adapters


function search(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 code
end
module CreateTableRecord

import SearchLight.Migrations: create_table, column, primary_key, add_index, drop_table

function up()
  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)
    ]
  end

  add_index(:record, :user_uuid)
  add_index(:record, :user_name)
  add_index(:record, :region)
  add_index(:record, :date_of_birth)
end

function down()
  drop_table(:record)
end

end

šŸ“ More Genie features like:

route("/", method = POST) do
  if infilespayload(:yourfile)
    write(filespayload(:yourfile))

    stat(filename(filespayload(:yourfile)))
  else
    "No file uploaded"
  end
end

Contributing

Please contribute using GitHub Flow. Create a branch, add commits, and open a pull request.

Please read CONTRIBUTING for details on our CODE OF CONDUCT, and the process for submitting pull requests to us.

Special Credits

License

This project is licensed under the MIT License - see the LICENSE file for details.

<p>ā­ If you enjoy this project please consider starring the šŸ§ž <b>Genie.jl</b> GitHub repo. It will help us fund our open source projects.</p>