{"id":13508213,"url":"https://github.com/sugar-framework/sugar","last_synced_at":"2025-10-21T15:56:55.692Z","repository":{"id":13235432,"uuid":"15920083","full_name":"sugar-framework/sugar","owner":"sugar-framework","description":"Modular web framework for Elixir","archived":false,"fork":false,"pushed_at":"2019-05-31T17:37:57.000Z","size":262,"stargazers_count":432,"open_issues_count":9,"forks_count":26,"subscribers_count":16,"default_branch":"master","last_synced_at":"2025-10-21T15:56:42.239Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"https://sugar-framework.github.io/","language":"Elixir","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/sugar-framework.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2014-01-15T00:16:56.000Z","updated_at":"2025-10-12T16:31:24.000Z","dependencies_parsed_at":"2022-09-19T03:01:39.376Z","dependency_job_id":null,"html_url":"https://github.com/sugar-framework/sugar","commit_stats":null,"previous_names":[],"tags_count":13,"template":false,"template_full_name":null,"purl":"pkg:github/sugar-framework/sugar","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sugar-framework%2Fsugar","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sugar-framework%2Fsugar/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sugar-framework%2Fsugar/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sugar-framework%2Fsugar/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/sugar-framework","download_url":"https://codeload.github.com/sugar-framework/sugar/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sugar-framework%2Fsugar/sbom","scorecard":{"id":857481,"data":{"date":"2025-08-11","repo":{"name":"github.com/sugar-framework/sugar","commit":"90e4b02f3aaea818554e76d76cbd8ce54cea4612"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":2.9,"checks":[{"name":"Token-Permissions","score":-1,"reason":"No tokens found","details":null,"documentation":{"short":"Determines if the project's workflows follow the principle of least privilege.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#token-permissions"}},{"name":"Maintained","score":0,"reason":"0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project is \"actively maintained\".","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#maintained"}},{"name":"Packaging","score":-1,"reason":"packaging workflow not detected","details":["Warn: no GitHub/GitLab publishing workflow detected."],"documentation":{"short":"Determines if the project is published as a package that others can easily download, install, easily update, and uninstall.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#packaging"}},{"name":"Dangerous-Workflow","score":-1,"reason":"no workflows found","details":null,"documentation":{"short":"Determines if the project's GitHub Action workflows avoid dangerous patterns.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#dangerous-workflow"}},{"name":"Code-Review","score":4,"reason":"Found 4/10 approved changesets -- score normalized to 4","details":null,"documentation":{"short":"Determines if the project requires human code review before pull requests (aka merge requests) are merged.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#code-review"}},{"name":"Binary-Artifacts","score":10,"reason":"no binaries found in the repo","details":null,"documentation":{"short":"Determines if the project has generated executable (binary) artifacts in the source repository.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#binary-artifacts"}},{"name":"Pinned-Dependencies","score":-1,"reason":"no dependencies found","details":null,"documentation":{"short":"Determines if the project has declared and pinned the dependencies of its build process.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#pinned-dependencies"}},{"name":"CII-Best-Practices","score":0,"reason":"no effort to earn an OpenSSF best practices badge detected","details":null,"documentation":{"short":"Determines if the project has an OpenSSF (formerly CII) Best Practices Badge.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#cii-best-practices"}},{"name":"Fuzzing","score":0,"reason":"project is not fuzzed","details":["Warn: no fuzzer integrations found"],"documentation":{"short":"Determines if the project uses fuzzing.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#fuzzing"}},{"name":"License","score":10,"reason":"license file detected","details":["Info: project has a license file: LICENSE:0","Info: FSF or OSI recognized license: MIT License: LICENSE:0"],"documentation":{"short":"Determines if the project has defined a license.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#license"}},{"name":"Signed-Releases","score":-1,"reason":"no releases found","details":null,"documentation":{"short":"Determines if the project cryptographically signs release artifacts.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#signed-releases"}},{"name":"Branch-Protection","score":0,"reason":"branch protection not enabled on development/release branches","details":["Warn: branch protection not enabled for branch 'master'"],"documentation":{"short":"Determines if the default and release branches are protected with GitHub's branch protection settings.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#branch-protection"}},{"name":"Security-Policy","score":0,"reason":"security policy file not detected","details":["Warn: no security policy file detected","Warn: no security file to analyze","Warn: no security file to analyze","Warn: no security file to analyze"],"documentation":{"short":"Determines if the project has published a security policy.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#security-policy"}},{"name":"Vulnerabilities","score":5,"reason":"5 existing vulnerabilities detected","details":["Warn: Project is vulnerable to: GHSA-vq52-99r9-h5pw","Warn: Project is vulnerable to: GHSA-9fm9-hp7p-53mf","Warn: Project is vulnerable to: GHSA-2q6v-32mr-8p8x","Warn: Project is vulnerable to: GHSA-5v4m-c73v-c7gq","Warn: Project is vulnerable to: GHSA-9h73-w7ch-rh73"],"documentation":{"short":"Determines if the project has open, known unfixed vulnerabilities.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#vulnerabilities"}},{"name":"SAST","score":0,"reason":"SAST tool is not run on all commits -- score normalized to 0","details":["Warn: 0 commits out of 27 are checked with a SAST tool"],"documentation":{"short":"Determines if the project uses static code analysis.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#sast"}}]},"last_synced_at":"2025-08-24T00:16:05.885Z","repository_id":13235432,"created_at":"2025-08-24T00:16:05.885Z","updated_at":"2025-08-24T00:16:05.885Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":280290185,"owners_count":26305279,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-10-21T02:00:06.614Z","response_time":58,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-08-01T02:00:49.836Z","updated_at":"2025-10-21T15:56:55.666Z","avatar_url":"https://github.com/sugar-framework.png","language":"Elixir","funding_links":[],"categories":["Frameworks","Elixir"],"sub_categories":[],"readme":"# Sugar\n\n[![Build Status](https://img.shields.io/travis/sugar-framework/sugar.svg?style=flat)](https://travis-ci.org/sugar-framework/sugar)\n[![Coverage Status](https://img.shields.io/coveralls/sugar-framework/sugar.svg?style=flat)](https://coveralls.io/r/sugar-framework/sugar)\n[![Hex.pm Version](http://img.shields.io/hexpm/v/sugar.svg?style=flat)](https://hex.pm/packages/sugar)\n[![Deps Status](https://beta.hexfaktor.org/badge/all/github/sugar-framework/sugar.svg)](https://beta.hexfaktor.org/github/sugar-framework/sugar)\n[![Gitter](https://badges.gitter.im/Join Chat.svg)](https://gitter.im/sugar-framework/sugar?utm_source=badge\u0026utm_medium=badge\u0026utm_campaign=pr-badge\u0026utm_content=badge)\n\nModular web framework for Elixir\n\n## 0.4.x -\u003e 0.5.x Upgrade Warning\n\nPlease note that `ecto` and `postgrex` have been removed from Sugar's dependencies as of version 0.5.0.  If your application uses Ecto, you'll need to add it to your application's `mix.exs`, like so:\n\n```elixir\ndef project do\n  [ app: :my_app,\n  # ...\n    deps: deps() ]\nend\n\ndef deps do\n  [ {:sugar, \"~\u003e 0.5.0\"},\n    {:ecto, \"~\u003e 2.1\"},\n    {:postgrex, \"~\u003e 0.13.0\"} ]\nend\n```\n\n## Goals\n\n- Speed. Sugar shouldn't be slow and neither should your project.\n- Ease. Sugar should be simple because simple is easy to learn, use and maintain.\n- Effective. Sugar should aid development. You have better things to which to devote your time.\n\n## Reason for Existence\n\nWhy build this when [Dynamo](https://github.com/dynamo/dynamo), [Weber](http://elixir-web.github.io/weber/), and [Phoenix](https://github.com/phoenixframework/phoenix) exist with growing communities? While these projects are great in their own right, Sugar aims to be another contender, sparking more development on all three projects (and/or others that may follow) and giving developers another option when deciding what framework fits their needs best. Sugar may even strive to shake things up just as [ChicagoBoss](http://www.chicagoboss.org/) has done.\n\n## Getting Started\n\n```\n# Clone this repo\ngit clone https://github.com/sugar-framework/simple.git\ncd simple\n\n# Get project dependencies\nmix deps.get\n\n# Start the web server\nmix server # or `iex -S mix server` if you want access to iex\n```\n\n### Configurations\n\nSugar needs to be configured in your application's `config/config.exs` in order to work.  The following options are supported:\n\n#### `config :sugar, router: MyWebsite.Router`\n\nTells Sugar which module to use as a router.  This module should implement `Sugar.Router`, and should have at least one route defined.  This is required.\n\n#### `config :sugar, plug_adapter: Plug.Adapters.Cowboy`\n\nTells Sugar which web server to use to handle HTTP(S) requests.  Cowboy is currently the only supported option, and Sugar will default to using `Plug.Adapters.Cowboy` if this is omitted.\n\n#### `config :sugar, MyWebsite.Router, ...`\n\nTells Sugar how the specified router should be configured.  The following options are supported:\n\n- `http`: takes a key/value list with options to configure the specified `:plug_adapter`.  Of particular usefulness:\n    - `ip`: IP address the server should bind to.  Should be a tuple in the format `{x,y,z,w}`.  Defaults to accepting connections on any IP address.\n    - `port`: port the server should listen on.  Defaults to 4000.\n    - `acceptors`: the number of acceptors for the listener.  Defaults to 100.\n    - `max_connections`: the maximum number of connections supported.  Defaults to `:infinity`.\n    - `compress`: whether or not the bodies of responses should be compressed.  Defaults to `false`.\n- `https`: takes a key/value list with the same options as `http`, or can be set to `false` if you don't want to enable HTTPS.  The following additional options(along with others from Erlang's \"ssl\" module) are supported:\n    - `password`: a plaintext, secret password for the private SSL key (if it's password-protected)\n    - `keyfile`: path to the PEM-format private key file to use\n    - `certfile`: path to the PEM-format certificate to use\n    - `otp_app` - If present, `certfile` and `keyfile` can be relative paths with respect to `otp_app`'s `priv` directory.\n\n\u003e Note: Create a self-signed certificate for easy HTTPS testing.\n\u003e\n\u003e ```\n\u003e # Generate a keyfile\n\u003e $ openssl genrsa -out key.pem 2048\n\u003e\n\u003e # Create a CSR\n\u003e $ openssl req -new -key key.pem -out request.pem\n\u003e\n\u003e # Generate a certfile that expires in $NUM_DAYS\n\u003e $ openssl x509 -req -days $NUM_DAYS -in request.pem -signkey key.pem -out cert.pem\n\u003e ```\n\n#### Example\n\n```elixir\nuse Mix.Config\n\nconfig :sugar, router: MyWebsite.Router\n\nconfig :sugar, MyWebsite.Router,\n  http: [\n    port: 80\n  ],\n  https: [\n    port: 443,\n    password: \"OMG_SUPER_SECRET\",\n\tkeyfile: \"/path/to/key.pem\",\n\tcertfile: \"/path/to/cert.pem\"\n  ]\n```\n\n### Routers\n\nBecause Sugar builds upon [Plug](https://github.com/elixir-lang/plug), it leverages `Plug.Router` to do the heavy lifting in routing your application, adding an alternate DSL.\n\nRoutes are defined with the form:\n\n    method route [guard], controller, action\n\n`method` is `get`, `post`, `put`, `patch`, `delete`, or `options`, each responsible for a single HTTP method. `method` can also be `any`, which will match on all HTTP methods. `controller` is any valid Elixir module name, and `action` is any valid function defined in the `controller` module.\n\n#### Example\n\n```elixir\ndefmodule MyWebsite.Router do\n  use Sugar.Router\n\n  get \"/\", Hello, :index\n  get \"/pages/:id\", Hello, :show\n  post \"/pages\", Hello, :create\n  put \"/pages/:id\" when id == 1, Hello, :show\nend\n```\n\n### Controllers\n\nAll controller actions should have an arrity of 2, with the first argument being a `Plug.Conn` representing the current connection and the second argument being a `Keyword` list of any parameters captured in the route path.\n\nSugar bundles these response helpers to assist in sending a response:\n\n- `render/2` - sends a normal response\n- `not_found/1` - sends a 404 (Not found) response\n\n#### Example\n\n```elixir\ndefmodule MyWebsite.Controllers.Hello do\n  use Sugar.Controller\n\n  def index(conn, []) do\n    render conn, \"index.html.eex\", []\n  end\n\n  def show(conn, args) do\n    render conn, \"show.html.eex\", args\n  end\n\n  def create(conn, []) do\n    render conn, \"create.html.eex\", []\n  end\nend\n```\n\n## Todo Items\n\n- basic authentication (?)\n- Development error page\n- Caching\n    - Compiled HTML\n    - Application Data\n    - Adapters\n        - ETS\n\n## Who's behind this?\n\nWhy, the [contributors](https://github.com/sugar-framework/sugar/graphs/contributors), of course! Would you consider being one? Please send a pull request :)\n\n## How to start contributing\n\nThe main product of this repository is the example terms in the file [CONTRIBUTING.md](https://github.com/sugar-framework/sugar/blob/master/CONTRIBUTING.md). This project uses those guidelines as the basis for its own development process. Please refer to that file.\n\n## License\n\nSugar is released under the MIT License.\n\nSee [LICENSE](https://github.com/sugar-framework/sugar/blob/master/LICENSE) for details.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsugar-framework%2Fsugar","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsugar-framework%2Fsugar","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsugar-framework%2Fsugar/lists"}