web-development-julia
Skill0 starsChanged 2 days agoMITView on GitHub
Build Julia web applications and APIs with Genie.jl, HTTP.jl, and Oxygen.jl. Use for Julia routes, middleware, JSON endpoints, web servers, and model-serving endpoints.
In this repository55 other files it gives its agents.
- advanced-optimizationSkill
- bayesian-inferenceSkill
- bayesian-pinnSkill
- bayesian-ude-workflowSkill
- catalyst-reactionsSkill
- continuum-mechanics-and-rheologySkill
- control-theorySkill
- creating-julia-appSkill
- debugging-toolkitSkill
- differential-equationsSkill
- differentiationSkill
- equation-discoverySkill
- experiment-trackingSkill
- fem-feaSkill
- julia-graph-neural-networksSkill
- julia-languageSkill
- julia-ml-and-dlSkill
- julia-model-deploymentSkill
- julia-paper-implementationSkill
- julia-pro-helpSkill
- julia-pro-modeSkill
- julia-reinforcement-learningSkill
- modeling-toolkitSkill
- neural-pdeSkill
- nonlinear-dynamicsSkill
- numerical-methods-implementationSkill
- package-development-workflowSkill
- performance-tuningSkill
- physical-learning-systemsSkill
- playbook-debugSkill
- playbook-model-validateSkill
- playbook-package-releaseSkill
- playbook-paper-implementSkill
- playbook-perfSkill
- playbook-test-specSkill
- principle-both-sidesSkill
- principle-breakingSkill
- principle-file-is-truthSkill
- principle-gateSkill
- principle-limitsSkill
- principle-loud-failureSkill
- principle-one-stepSkill
- principle-proof-listSkill
- principle-rebuttalSkill
- principle-runtime-surfaceSkill
- principle-three-boundsSkill
- principle-three-clocksSkill
- scientific-visualizationSkill
- sciml-and-diffeqSkill
- setup-julia-proSkill
- signal-processingSkill
- simulation-and-hpcSkill
- statistical-physicsSkill
- symbolic-mathSkill
- zarr-cloud-arraysSkill
The file
Files
Julia Web Development
Genie.jl REST API
using Genie, Genie.Router, Genie.Renderer.Json
route("/") do
"Welcome"
end
route("/api/items/:id::Int") do
id = payload(:id)
json(:result => compute(id))
end
route("/api/items", method = POST) do
data = jsonpayload()
json(:created => process(data))
end
up(8000)Middleware
function auth_middleware(handler)
req = handler
function(req)
haskey(req.headers, "Authorization") || return HTTP.Response(401, "Unauthorized")
handler(req)
end
endFramework Selection
| Framework | Use Case |
| Genie.jl | Full MVC, authentication, ORM |
| HTTP.jl | Lightweight, custom control |
| Oxygen.jl | Minimal API framework |
HTTP.jl Server
using HTTP, JSON3
function router(req::HTTP.Request)
if req.method == "GET" && req.target == "/health"
return HTTP.Response(200, ["Content-Type" => "application/json"],
JSON3.write(Dict(:status => "ok")))
elseif req.method == "POST" && startswith(req.target, "/api/compute")
body = JSON3.read(String(req.body))
result = process(body)
return HTTP.Response(200, JSON3.write(result))
end
return HTTP.Response(404, "Not Found")
end
HTTP.serve(router, "0.0.0.0", 8080)Genie.jl MVC Pattern
# routes.jl
using Genie.Router, Genie.Renderer.Json
route("/api/v1/models", method = GET) do
models = SearchLight.all(SimulationModel)
json(:models => models)
end
route("/api/v1/models", method = POST) do
payload = jsonpayload()
model = SimulationModel(name=payload["name"], params=payload["params"])
SearchLight.save!(model)
json(:id => model.id, :status => "created")
end
route("/api/v1/models/:id/run", method = POST) do
id = payload(:id)
model = SearchLight.findone(SimulationModel, id=id)
result = run_simulation(model)
json(:result => result)
endJSON Handling
using JSON3, StructTypes
struct SimulationRequest
model::String
parameters::Dict{String, Float64}
steps::Int
end
StructTypes.StructType(::Type{SimulationRequest}) = StructTypes.Struct()
# Parse request body
req = JSON3.read(body, SimulationRequest)Deployment
| Strategy | Configuration |
| Systemd service | ExecStart=julia --sysimage=app.so server.jl |
| Docker | Multi-stage build with PackageCompiler sysimage |
| Reverse proxy | Nginx/Caddy in front of Julia HTTP server |
| Environment config | ENV["GENIE_ENV"] = "prod" |
Checklist
- Routes organized by resource with RESTful verbs
- JSON serialization via StructTypes for type safety
- Error responses return appropriate HTTP status codes
- Middleware handles authentication and CORS
- System image compiled for production startup time
- Health check endpoint exposed for load balancer probes
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

