{"id":37439776,"url":"https://github.com/objectos/demo.sf","last_synced_at":"2026-01-16T06:43:48.723Z","repository":{"id":295491931,"uuid":"990256535","full_name":"objectos/demo.sf","owner":"objectos","description":"Source code for the \"Objectos Way In A Single File\" series.","archived":false,"fork":false,"pushed_at":"2025-07-07T12:08:33.000Z","size":36,"stargazers_count":1,"open_issues_count":0,"forks_count":1,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-07-07T13:25:56.572Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"Makefile","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/objectos.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"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}},"created_at":"2025-05-25T20:13:39.000Z","updated_at":"2025-07-07T12:07:18.000Z","dependencies_parsed_at":"2025-06-02T08:38:08.856Z","dependency_job_id":"9108aa04-34e7-47c8-a1c2-083a5018d3e6","html_url":"https://github.com/objectos/demo.sf","commit_stats":null,"previous_names":["objectos/demo.sfow","objectos/demo.sf"],"tags_count":6,"template":false,"template_full_name":null,"purl":"pkg:github/objectos/demo.sf","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/objectos%2Fdemo.sf","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/objectos%2Fdemo.sf/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/objectos%2Fdemo.sf/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/objectos%2Fdemo.sf/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/objectos","download_url":"https://codeload.github.com/objectos/demo.sf/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/objectos%2Fdemo.sf/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28477922,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-16T06:30:42.265Z","status":"ssl_error","status_checked_at":"2026-01-16T06:30:16.248Z","response_time":107,"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":[],"created_at":"2026-01-16T06:43:48.639Z","updated_at":"2026-01-16T06:43:48.708Z","avatar_url":"https://github.com/objectos.png","language":"Makefile","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Objectos Way In A Single File\n\nSource code for the \"Objectos Way In A Single File\" video series,\nwhere we'll develop a full Objectos Way application contained in a single Java source file.\n\nOf course, in regular development, you'd most likely structure your Objectos Way project around multiple classes and, if that's your thing, multiple packages.\nBut we hope to show that \"full-stack\" web development in Java can (and should) be simpler. \n\n## How to Run\n\nTo run the latest iteration of the application, you'll need:\n\n- JDK 23 or later.\n\nThen, in a work directory, run the following commands:\n\n```\nwget -q https://repo.maven.apache.org/maven2/br/com/objectos/objectos.way/0.2.5/objectos.way-0.2.5.jar\nwget -q https://raw.githubusercontent.com/objectos/demo.sf/refs/heads/main/main/Start.java\njava -p objectos.way-0.2.5.jar --add-modules objectos.way --enable-preview Start.java\n```\n\nFinally, browse to `http://localhost:8080`.\n\nAlternatively, you can run a previous iteration of the application by following the instructions on the relevant section below.\n\n## Iterations\n\nThis section lists all the iterations of the application in reverse chronological order.\n\n### OWIASF #006: Objectos HTML template inheritance\n\nRelease date: 2025-07-07\n\nIn order to remove some of the code duplication observed in the page classes,\nwe introduce a base template to our application. \n\nIn an Objectos Way application, HTML templates are regular Java classes.\nSo template inheritance is just regular Java class inheritance.\nIn this iteration, we showcase:\n\n- Creating a base template as an abstract Java class.\n- Using an abstract method directly to provide the page title.\n- Using the `f` instruction along with an abstract method.\n\nRequires JDK 23 or later.\nInstructions to run:\n\n```\nwget -q https://repo.maven.apache.org/maven2/br/com/objectos/objectos.way/0.2.5/objectos.way-0.2.5.jar\nwget -q https://raw.githubusercontent.com/objectos/demo.sf/refs/tags/v006/main/Start.java\njava -p objectos.way-0.2.5.jar --add-modules objectos.way --enable-preview Start.java\n```\n\n### OWIASF #005: Soft navigation between pages with Objectos Script\n\nRelease date: 2025-06-23\n[YouTube Video](https://www.youtube.com/watch?v=J5tcNEQ6HYE)\n\nWe link between pages of our application using the soft navigation feature of Objectos Script:\n\n- Including the JS library directly from Java code.\n- Creating an Objectos Script powered link using the `data-on-click` attribute.\n- Defining `data-frame` attributes.   \n\nRequires JDK 23 or later.\nInstructions to run:\n\n```\nwget -q https://repo.maven.apache.org/maven2/br/com/objectos/objectos.way/0.2.4/objectos.way-0.2.4.jar\nwget -q https://raw.githubusercontent.com/objectos/demo.sf/refs/tags/v005/main/Start.java\njava -p objectos.way-0.2.4.jar --add-modules objectos.way --enable-preview Start.java\n```\n\nAfter the server starts:\n\n- Browse to `http://localhost:8080` and click on the \"Objectos Script\" link.\n- Observe the changes in the page title, the browser URL and the page contents. \n- Browse to `http://localhost:8080/script.js` and see code of the included JS library.\n- Use the devtools of your browser, and see that navigations are initiated by the JS library. \n\n### OWIASF #004: Styling our application with Objectos CSS\n\nRelease date: 2025-06-16\n[YouTube Video](https://www.youtube.com/watch?v=Anp9Fysh1rs)\n\nWe style our home page with a CSS file generated by Objectos CSS:\n\n- Using the Objectos HTML `css` attribute.\n- Adding CSS utilities directly in Java code.\n- Configuring which classes Objectos CSS should scan. \n- Using Objectos CSS variants.\n- Defining and using theme variables.   \n\nRequires JDK 23 or later.\nInstructions to run:\n\n```\nwget -q https://repo.maven.apache.org/maven2/br/com/objectos/objectos.way/0.2.3/objectos.way-0.2.3.jar\nwget -q https://raw.githubusercontent.com/objectos/demo.sf/refs/tags/v004/main/Start.java\njava -p objectos.way-0.2.3.jar --add-modules objectos.way --enable-preview Start.java\n```\n\nAfter the server starts:\n\n- Browse to `http://localhost:8080` and see the styles applied.\n- Using your browser devtools, switch between light and dark mode and observe the changes. \n- Browse to `http://localhost:8080/styles.css` and see the generated CSS.\n\n### OWIASF #003: HTML template variables, conditional rendering and loops.\n\n[YouTube Video](https://www.youtube.com/watch?v=7dD9RI-Vr_M)\n\nWe add the `/objectos/html` route which showcases a number of Objectos HTML features:\n\n- HTML template variables.\n- Conditional rendering.\n- Loops: using the `f` instruction.\n\nRequires JDK 23 or later.\nInstructions to run:\n\n```\nwget -q https://repo.maven.apache.org/maven2/br/com/objectos/objectos.way/0.2.3/objectos.way-0.2.3.jar\nwget -q https://raw.githubusercontent.com/objectos/demo.sf/refs/tags/v003/main/Start.java\njava -p objectos.way-0.2.3.jar --add-modules objectos.way --enable-preview Start.java\n```\n\nAfter the server starts:\n\n- Browse to `http://localhost:8080/objectos/html` and see the default `400 Bad Request` response.\n- Browse to `http://localhost:8080/objectos/html?name=Objectos+Way` and see the template variable in action. \n- Browse to `http://localhost:8080/objectos/html?name=Objectos+Way\u0026show=on` and see the conditional rendering in action.\n- Browse to `http://localhost:8080/objectos/html?name=Objectos+Way\u0026show=on\u0026count=3` and see the loops / iteration in action.\n\n### OWIASF #002: HTML response using the `Html.Template` class \n\n[YouTube Video](https://www.youtube.com/watch?v=YUX07kbc2Ss)\n\nWe improve on the previous iteration,\nand we replace the text response \"home page\" with an HTML page generated by a `Html.Template` instance. \n\nRequires JDK 23 or later.\nInstructions to run:\n\n```\nwget -q https://repo.maven.apache.org/maven2/br/com/objectos/objectos.way/0.2.2/objectos.way-0.2.2.jar\nwget -q https://raw.githubusercontent.com/objectos/demo.sf/refs/tags/v002/main/Start.java\njava -p objectos.way-0.2.2.jar --add-modules objectos.way --enable-preview Start.java\n```\n\nAfter the server starts:\n\n- Browse to `http://localhost:8080` and it see the response generated by the `Start.Home` class.\n- Browse to any other path and it responds with \"Not Found\".\n\n### OWIASF #001: Single-Path Text-Response Web Server \n\n[YouTube Video](https://www.youtube.com/watch?v=OHPDPZG9y2k)\n\nConfigures and starts the web server:\n\n- Browse to `http://localhost:8080` and it responds with \"It Works!\".\n- Browse to any other path and it responds with \"Not Found\".\n\nRequires JDK 23 or later.\nInstructions to run:\n\n```\nwget -q https://repo.maven.apache.org/maven2/br/com/objectos/objectos.way/0.2.2/objectos.way-0.2.2.jar\nwget -q https://raw.githubusercontent.com/objectos/demo.sf/refs/tags/v001/main/Start.java\njava -p objectos.way-0.2.2.jar --add-modules objectos.way --enable-preview Start.java\n```\n\nAfter the server starts, browse to `http://localhost:8080`.\n\n## License\n\nCopyright (C) 2025 [Objectos Software LTDA](https://www.objectos.com.br)\n\nLicensed under the Apache License, Version 2.0.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fobjectos%2Fdemo.sf","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fobjectos%2Fdemo.sf","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fobjectos%2Fdemo.sf/lists"}