{"id":32294573,"url":"https://github.com/webarchery/archery","last_synced_at":"2026-02-22T15:32:39.316Z","repository":{"id":319344826,"uuid":"1066412996","full_name":"webarchery/archery","owner":"webarchery","description":"A fullstack web framework for dart","archived":false,"fork":false,"pushed_at":"2026-02-21T21:24:08.000Z","size":1279,"stargazers_count":7,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2026-02-22T02:32:13.426Z","etag":null,"topics":["dart-lang","framework","fullstack","web"],"latest_commit_sha":null,"homepage":"https://webarchery.dev","language":"Dart","has_issues":false,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"bsd-3-clause","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/webarchery.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":".github/FUNDING.yml","license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null},"funding":{"github":null,"patreon":null,"open_collective":null,"ko_fi":null,"tidelift":null,"community_bridge":null,"liberapay":null,"issuehunt":null,"lfx_crowdfunding":null,"polar":null,"buy_me_a_coffee":"webarchery","thanks_dev":null,"custom":null}},"created_at":"2025-09-29T12:59:27.000Z","updated_at":"2026-02-21T22:27:45.000Z","dependencies_parsed_at":null,"dependency_job_id":"aea028af-4e33-4b6b-a39e-4f713063bf0a","html_url":"https://github.com/webarchery/archery","commit_stats":null,"previous_names":["webarchery/archery"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/webarchery/archery","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/webarchery%2Farchery","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/webarchery%2Farchery/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/webarchery%2Farchery/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/webarchery%2Farchery/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/webarchery","download_url":"https://codeload.github.com/webarchery/archery/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/webarchery%2Farchery/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29717303,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-22T15:10:41.462Z","status":"ssl_error","status_checked_at":"2026-02-22T15:10:04.636Z","response_time":110,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"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":["dart-lang","framework","fullstack","web"],"created_at":"2025-10-23T03:45:49.687Z","updated_at":"2026-02-22T15:32:39.308Z","avatar_url":"https://github.com/webarchery.png","language":"Dart","funding_links":["https://buymeacoffee.com/webarchery"],"categories":[],"sub_categories":[],"readme":"\n---\n\n# Archery\n\nA Laravel-inspired, Dart-native web framework built directly on `dart:io`.\n\nArchery is a **stable alpha / early-production framework** focused on clarity, explicit architecture, and batteries-included fundamentals:\n\n* IoC container\n* Provider-based lifecycle\n* HTTP kernel + middleware pipeline\n* Router with groups and typed parameters\n* Blade-style templating\n* Multi-driver ORM (JSON, SQLite, Postgres, S3)\n* Session-based authentication\n* CSRF protection\n* Static file serving\n\nArchery is suitable for real deployments, and is still actively hardening and evolving toward a 2.0 production-focused milestone.\n\n---\n\n## Philosophy\n\nArchery aims to be:\n\n* **Explicit over magical**\n* **Framework, not micro-router**\n* **Dart-native**\n* **Readable and hackable**\n* **Opinionated but small**\n\nIt does not wrap another server framework. It is built directly on `dart:io`.\n\n---\n\n# Architecture Overview\n\nArchery follows a layered request lifecycle:\n\n```\nIncoming Request\n   ↓\ndart:io HTTP Server\n   ↓\nHTTP Kernel\n   ↓\nMiddleware Pipeline\n   ↓\nRouter\n   ↓\nController\n   ↓\nResponse\n```\n\nCore architectural components:\n\n* **Application** – central orchestrator\n* **Service Providers** – register and boot services\n* **IoC Container** – dependency resolution\n* **HTTP Kernel** – request handling entry point\n* **Middleware** – request/response pipeline\n* **Router** – route matching and dispatch\n* **Controllers** – application logic\n* **Models** – ORM-backed data layer\n* **Views** – templated HTML rendering\n\n---\n\n# Core Features\n\n## HTTP Layer\n\n* Route definitions by method\n* Route groups\n* Middleware chaining\n* Typed route parameters\n* Static file serving\n* CORS middleware\n\nExample:\n\n```dart\nrouter.get('/users/{id:int}', (req) async {\n  final id = RouteParam.get\u003cint\u003e('id');\n  return req.json({'id': id});\n});\n```\n\n---\n\n## Service Providers \u0026 IoC Container\n\nArchery uses a provider model similar to Laravel:\n\n```dart\nclass SomeServiceProvider extends Provider {\n  @override\n  void register() {\n    container.bind\u003cSomeService\u003e((c) =\u003e SomeService());\n  }\n\n  @override\n  void boot() {\n    // Runs after all providers are registered\n  }\n}\n```\n\nThe container supports dependency resolution across the framework.\n\n---\n\n## Authentication\n\nArchery includes session-based authentication:\n\n* Password hashing: **PBKDF2-HMAC-SHA256**\n* Versioned hash format (`pbkdf2-sha256$iterations$salt$hash`)\n* Constant-time hash comparison\n* Login / logout helpers\n* Auth session cookie\n\nAuthentication is built into the framework and integrated with sessions.\n\n---\n\n## Sessions\n\nArchery supports:\n\n* Guest sessions\n* Authenticated sessions\n* Server-side session storage\n* Cookie-based session identifiers\n\nSessions are used for:\n\n* Authentication\n* CSRF token binding\n* Flash data (if implemented)\n\n---\n\n## CSRF Protection\n\nArchery includes CSRF middleware:\n\n* Automatic token generation\n* Token stored in session\n* Token validation on state-changing requests\n* `@csrf` template directive\n\nExample:\n\n```html\n\u003cform method=\"POST\"\u003e\n  @csrf\n  ...\n\u003c/form\u003e\n```\n\n---\n\n## ORM\n\nArchery includes a built-in ORM with multiple drivers:\n\n### Supported Drivers\n\n* JSON (file-based)\n* SQLite\n* Postgres\n* S3-backed model storage\n\n### Features\n\n* CRUD operations\n* Relationships:\n\n    * `belongsTo`\n    * `hasMany`\n    * `hasOne`\n* Model mixins\n* Adapter-based storage abstraction\n\nExample:\n\n```dart\nclass User extends Model {}\n\n// uses default disk. in this e.g =\u003e .file\nfinal user = await Model.find\u003cUser\u003e(id: 1);\n\nfinal user2 = await Model.find\u003cUser\u003e(id: 1, disk: .sqlite);\n\nfinal user3 = await Model.find\u003cUser\u003e(id: 1, disk: .s3);\n\nfinal user4 = await Model.find\u003cUser\u003e(id: 1, disk: .pgsql);\n\nfinal user5 = User(name: \"Archer\", email: \"archer@example.com\", passwprd: \"password\");\n\nawait user5.save();\nawait user5.save(disk: .sqlite);\n```\n\nArchery’s ORM is functional and production-capable, though still evolving in terms of advanced query features and edge-case coverage.\n\n---\n\n## Templating Engine\n\nBlade-inspired templating:\n\n* Layouts\n* Includes\n* Directives\n* Escaped output\n* `@csrf` directive\n\nDesigned for server-rendered applications.\n\n---\n\n# Security Model (Current State)\n\nArchery currently provides:\n\n* PBKDF2-based password hashing\n* Constant-time hash comparison\n* Session-based CSRF protection\n* HttpOnly auth cookies\n* Middleware-based request validation\n\n### Production Recommendations\n\nWhen deploying:\n\n* Run behind HTTPS\n* Enable secure cookie flags\n* Use Postgres for production databases\n* Configure body size limits\n* Use reverse proxy (NGINX, Caddy, etc.)\n\nSecurity hardening is an active focus toward the 2.0 milestone.\n\n---\n\n# Database Guidance\n\n| Driver   | Recommended Use                 |\n| -------- |---------------------------------|\n| JSON     | Local dev, small apps           |\n| SQLite   | Small to medium apps            |\n| Postgres | Production workloads            |\n| S3       | Backups 0/ Experimental / Niche |\n\n---\n\n# Minimal Application Example\n\n```dart\nFuture\u003cvoid\u003e main() async {\n  final app = App();\n  \n  await app.boot();\n  \n  final router = app.container.make\u003cRouter\u003e();\n\n  router.get('/', (req) async {\n    return req.text('hello world');\n  });\n\n\n  final kernel = AppKernel(\n    router: router,\n  );\n\n  try {\n    HttpServer.bind(InternetAddress.loopbackIPv4, 5501).then((server) async {\n\n      await for (HttpRequest request in server) {\n        kernel.handle(request);\n      }\n    });\n  } catch (e, stack) {\n    print(\"Error booting server: $e\\n$stack\");\n    await app.shutdown();\n  }\n  \n  \n\n}\n```\n\n---\n\n# Production Status\n\nArchery is currently:\n\n**Stable Alpha / Early Production**\n\nThis means:\n\n* Suitable for real deployments\n* API mostly stable\n* Internals still evolving\n* Security hardening and test expansion ongoing\n* ORM and middleware features expanding\n\nIf you are building mission-critical infrastructure, evaluate carefully and follow production recommendations.\n\n---\n\n# Contributing\n\nArchery is actively evolving. Contributions, issues, and design discussions are welcome.\n\n---\n\n## License\n\n**BSD-3-Clause**\nSee LICENSE file for details.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwebarchery%2Farchery","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fwebarchery%2Farchery","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwebarchery%2Farchery/lists"}