{"id":16355800,"url":"https://github.com/smurfix/deframed","last_synced_at":"2025-03-21T00:31:30.458Z","repository":{"id":62567520,"uuid":"259882446","full_name":"smurfix/deframed","owner":"smurfix","description":"A minimal web non-framework","archived":false,"fork":false,"pushed_at":"2022-07-14T07:05:54.000Z","size":102,"stargazers_count":23,"open_issues_count":0,"forks_count":1,"subscribers_count":5,"default_branch":"master","last_synced_at":"2025-03-01T01:15:27.581Z","etag":null,"topics":["web"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/smurfix.png","metadata":{"files":{"readme":"README.rst","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2020-04-29T09:31:26.000Z","updated_at":"2023-03-31T04:35:41.000Z","dependencies_parsed_at":"2022-11-03T16:30:32.499Z","dependency_job_id":null,"html_url":"https://github.com/smurfix/deframed","commit_stats":null,"previous_names":[],"tags_count":8,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/smurfix%2Fdeframed","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/smurfix%2Fdeframed/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/smurfix%2Fdeframed/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/smurfix%2Fdeframed/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/smurfix","download_url":"https://codeload.github.com/smurfix/deframed/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":244094274,"owners_count":20397020,"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","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":["web"],"created_at":"2024-10-11T01:41:48.986Z","updated_at":"2025-03-21T00:31:30.177Z","avatar_url":"https://github.com/smurfix.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"========\nDeFramed\n========\n\nWhat the …\n++++++++++\n\nDeframed is a non-framework for web programming. In fact it is the very\nantithesis of a web framework.\n\nHuh?\n----\n\nThe basic idea of building web pages, these days, is to delegate as much as\npossible to the client. The problem is that if you don't want to do that,\nbut still like to offer a single-page site to your user, you're on your\nown.\n\nWhy?\n----\n\nWell, maybe Javascript is a truly annoying language. To you, anyway. Maybe\nyour site logic is Secret Sauce and shouldn't end up in the browser. Maybe\nyour API shouldn't be exposed to the outside world. Maybe you want to tell\nthe browser what to display. Maybe you just want to build a Web UI that\nbehaves like any other UI, i.e. read events from the user and tell the\nscreen what to display, period end of story.\n\nWhatever your reason, DeFramed's purpose is to make sure that you won't\nhave to deal with programming on the browser side. No more than absolutely\nnecessary, anyway.\n\nPrinciple of operation\n++++++++++++++++++++++\n\nClient\n------\n\nDeFramed displays a generic initial page and starts a small Javascript\nhandler that connects to a web socket on your server. It then proxies a\nhandful of DOM manipulation functions and exports a few calls which your\nuser-facing interface elements can use to send events or data to the\nserver.\n\nThere's also basic support for a client-side spinner, a simple way to show\nalerts if/when the connection breaks, templating (with Mustache) so you\ndon't need to send redundant data, and rudimentary access to local data to\nstore the equivalent of a cookie and to stash templates on the client. Oh\nyes, and some rudimentary DOM manipulation, like adding a class to some\nelement.\n\nDeFramed also auto-adds \"onclick\" handlers to each button and \"onsubmit\"s\nto each form (assuming they have an ID and no existing handler), so you\ndon't have to.\n\nNote the absence of anything that could be interpreted as client-side\nlogic, which is why DeFramed is a non-framework.\n\nServer\n------\n\nIf there is zero client-side logic, the server needs to handle everything.\n(Which it has to do anyway.) Thus, DeFramed includes classes to support all\nof this.\n\nThe DeFramed server is based on Quart-Trio, thus it natively supports async\noperations. It uses Trio instead of asyncio: cleanly shutting down a\ncomplex asyncio application is a debugging exercise nobody should undergo.\nYou can ignore the async stuff, but as soon as you call out to a database\nyou probably don't want to.\n\nEach client's events are processed sequentially, though it's easy to run a\nbackground task – which is guaranteed to get terminated when the client\ndisconnects or times out.\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsmurfix%2Fdeframed","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsmurfix%2Fdeframed","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsmurfix%2Fdeframed/lists"}