Coder Social home page Coder Social logo

wildart / genie.jl Goto Github PK

View Code? Open in Web Editor NEW

This project forked from genieframework/genie.jl

0.0 0.0 0.0 32.46 MB

🧞The highly productive Julia web framework

Home Page: https://genieframework.com

License: MIT License

JavaScript 23.20% Julia 76.80%

genie.jl's Introduction

Genie Logo

Genie.jl

🧞 The highly productive Julia web framework

Docs current status Website Tests Genie Downloads Tweet

Built with ❀︎ by contributors


Screenshot

Julia data dashboards powered by Genie

Genie is a full-stack web framework that 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.

Need Help? Reach out on our social media channels.

Chat on Discord Chat on Gitter Discuss on GitHub

Important

We have fixed a security vulnerability that affected older versions of Genie -- please make sure to update to Genie v4.16 or above.


Table of contents

Features

πŸ› 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, Dyanmic, 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 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: Inbuild templating solution 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
  • Database Migrations
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
  • Model Validations

πŸ“ More Genie features like:

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

    stat(filename(filespayload(:yourfile)))
  else
    "No file uploaded"
  end
end
  • Logging System | Caching | Cookies and Sessions | Built in Docker and Heroku Integrations | Genie Deploy
  • To explore more features check Genie Documentation πŸƒβ€β™‚οΈπŸƒβ€β™€οΈ

Made With Genie

Community Curated Resources

  • Awesome Genie Awesome Genie: A curated list of awesome things related to Julia's Web framework Genie.

Community Mentions

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

  • 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

License

This project is licensed under the MIT License - see the LICENSE 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.

genie.jl's People

Contributors

essenciary avatar abhimanyuaryan avatar aminya avatar yoh-meyers avatar hhaensel avatar milesfrain avatar angusmoore avatar p1scescom avatar pallharaldsson avatar diegozea avatar logankilpatrick avatar iskyd avatar tcopestake avatar albaintelligence avatar mirkobunse avatar tweenietomatoes avatar github-actions[bot] avatar gearsad avatar yakir12 avatar ericforgy avatar dhruvasambrani avatar mroqueta avatar nickembrey avatar simeonschaub avatar uniquetokens avatar tlienart avatar vitornesello avatar wschella avatar jtrakk avatar marco-zanon avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    πŸ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. πŸ“ŠπŸ“ˆπŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❀️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.