{"id":14118168,"url":"https://github.com/jamonholmgren/qub","last_synced_at":"2025-04-23T00:18:05.465Z","repository":{"id":209765612,"uuid":"724897223","full_name":"jamonholmgren/qub","owner":"jamonholmgren","description":"Qub is a CLI and QB64 web framework for building websites with QBasic. Star this repo!","archived":false,"fork":false,"pushed_at":"2024-08-05T05:57:52.000Z","size":2300,"stargazers_count":135,"open_issues_count":1,"forks_count":4,"subscribers_count":5,"default_branch":"main","last_synced_at":"2025-04-23T00:18:00.811Z","etag":null,"topics":["cli","framework","qb64","qbasic","web"],"latest_commit_sha":null,"homepage":"https://qub.jamon.dev","language":"Visual Basic 6.0","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/jamonholmgren.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}},"created_at":"2023-11-29T02:27:44.000Z","updated_at":"2025-04-13T00:37:41.000Z","dependencies_parsed_at":"2024-08-05T06:43:38.860Z","dependency_job_id":"0245fb90-eeeb-4a39-98f6-9e93bb109b9a","html_url":"https://github.com/jamonholmgren/qub","commit_stats":{"total_commits":53,"total_committers":2,"mean_commits":26.5,"dds":"0.037735849056603765","last_synced_commit":"637296292491441778fcc8764a7e4bacb1e0248c"},"previous_names":["jamonholmgren/qub"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jamonholmgren%2Fqub","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jamonholmgren%2Fqub/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jamonholmgren%2Fqub/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jamonholmgren%2Fqub/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/jamonholmgren","download_url":"https://codeload.github.com/jamonholmgren/qub/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":250343960,"owners_count":21415042,"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":["cli","framework","qb64","qbasic","web"],"created_at":"2024-08-14T19:01:34.303Z","updated_at":"2025-04-23T00:18:05.444Z","avatar_url":"https://github.com/jamonholmgren.png","language":"Visual Basic 6.0","funding_links":[],"categories":["Visual Basic 6.0"],"sub_categories":[],"readme":"# Qub -- QBasic Website Generator\n\nQub (pronounced \"cube\") is a CLI that generates a web server and framework for building websites in [QB64](https://qb64.com/) -- a more modern variant of QBasic.\n\n\u003ctable\u003e\u003ctr\u003e\u003ctd\u003e\n  \u003cimg alt=\"Screenshot of Qub running\" src=\"./.github/images/screenshot-cli.png\" width=\"350\" /\u003e\n\u003c/td\u003e\u003ctd\u003e\n  \u003cimg alt=\"Screenshot of Qub-powered website\" src=\"./.github/images/screenshot-website.png\" width=\"350\" /\u003e\n\u003c/td\u003e\u003c/tr\u003e\u003c/table\u003e\n\n## Getting started\n\n_(Note: macOS \u0026 Linux only)_\n\nTo get started, set up your `qub` alias first. This is the quick \u0026 easy way:\n\n```\nalias qub=\"source \u003c(curl -sSL https://raw.githubusercontent.com/jamonholmgren/qub/main/src/cli.sh)\"\n```\n\nHowever, some are understandably uncomfortable with running a script directly from the internet. If you'd like to run it locally, here's how:\n\n\u003cdetails\u003e\n\u003csummary\u003e\u003cstrong\u003eManual setup\u003c/strong\u003e\u003c/summary\u003e\nDownload it:\n\n```\ncurl -sSL https://raw.githubusercontent.com/jamonholmgren/qub/main/src/cli.sh \u003e ./qub.sh\n```\n\nOpen the `qub.sh` file in your editor and review it. If you're comfortable with what it's doing, alias it:\n\n```\nalias qub=\"source $PWD/qub.sh\"\n```\n\n\u003c/details\u003e\n\nNow, you should be able to run the CLI:\n\n```\nqub\nqub --version\nqub --help\nqub create\nqub update\n```\n\n_**Windows Support:** Qub has only been tested on macOS and Linux. It might work on Windows WSL (Windows Subsystem for Linux) or Git Bash on Windows. If you want to help test and make it run on Windows, please open an issue or PR!_\n\n## Creating a website\n\nTo create a website, run `qub create` and follow the prompts:\n\n```\nqub create\n```\n\nIt'll ask you for your domain name (e.g. jamon.dev) which doubles as your project's folder name. It will also ask if you want to install QB64 (I recommend you do).\n\nWhen done, you can CD into the new folder and run `./bin/build` to build the website. Then, run `./server` to start the web server. Visit [http://localhost:6464/](http://localhost:6464/) to view the website.\n\n## Modifying your website\n\nYour new website has the following folder structure:\n\n```\nbin\nqub\n  server.bas\n  qub.conf\nweb\n  pages\n    home.html\n    contact.html\n  static\n    scripts.js\n    styles.css\n  layout.html\nREADME.md\n```\n\n### qub/server.bas\n\nThis is the Qub web server. You can periodically update it by running `qub update`. Note this will blow away any modifications you've made, so be careful!\n\nQub's web server was originally based on [Yacy](https://github.com/smokingwheels/Yacy_front_end) by SmokingWheels, but has been heavily modified since. It comes with a number of features:\n\n- [x] Page routing (e.g. jamon.dev/links renders web/pages/links.html)\n- [x] Individual header and footer and \u003chead\u003e support\n- [x] Static file serving (css, js, etc)\n- [x] Binary file serving (images, fonts, etc)\n- [x] Custom 404 page support\n- [x] Basic dynamic variable support (e.g. `\u003c!--$YEAR--\u003e` in web/layout.html, etc)\n- [x] Custom port support (via ./qub.conf)\n- [ ] Customizable dynamic variable support (coming soon)\n- [ ] 301 redirects support (coming soon)\n- [ ] Custom 500 page support (coming soon)\n- [ ] More customizable templating support (coming soon)\n\nIt does not (and probably won't) support HTTPS or HTTP2. I recommend putting CloudFlare in front of it in production (more in the [deploy guide](#deploy-guide) below).\n\n### Common included files\n\nIn the `web` folder, you'll find a layout.html file.\n\nThis is the standard layout for your website, and includes your html's head and body sections,\nwith placeholder comments for dynamic content like what page is being rendered.\n\n```html\n\u003c!DOCTYPE html\u003e\n\u003chtml\u003e\n  \u003chead\u003e\n    \u003c!-- other stuff --\u003e\n    \u003ctitle\u003e\u003c!--$TITLE--\u003e\u003c/title\u003e\n  \u003c/head\u003e\n  \u003cbody\u003e\n    \u003c!-- whatever you want to wrap your page content with --\u003e\n    \u003c!--$BODY--\u003e\n    \u003c!-- footer content, etc --\u003e\n  \u003c/body\u003e\n\u003c/html\u003e\n```\n\n### web/pages\n\nThis is where your website's pages go. Each page is an HTML file. You can add as many as you want, and they'll be routed automatically (minus the .html extension).\n\nSo, for example, if you add `web/pages/links.html`, it will be available at `example.com/links`. If you add a folder it'll route to that as well, so `web/pages/blog/2023.html` will be available at `example.com/blog/2023`.\n\n### web/static\n\nYou'll put your static files here -- CSS, JS, images, fonts, etc. They'll be served at `example.com/static/` (e.g. `example.com/static/styles.css`). Any image files, fonts, PDFs, etc will be served as binary files (e.g. `example.com/static/logo.png`).\n\n### 404.html\n\nIf you want to customize your 404 page, you can do so by editing `web/pages/404.html`. This is shown if the router is unable to find a page for the given URL. It'll also respond with the proper 404 status code.\n\n## Deploy Guide\n\nCOMING SOON!\n\n## History\n\nWhen I was twelve, I built my first game in QBasic -- and kept building games and small apps (we called them \"programs\" in those days) for years. I have a lot of nostalgia and a special place in my heart for QBasic.\n\nA few years ago, I was talking about rebuilding my website in something different, just for a fun challenge, and my friend Mark Villacampa said [\"do it in BASIC you coward!\"](https://twitter.com/MarkVillacampa/status/1594426506754801664). I took on the challenge and built [jamon.dev](https://jamon.dev) in QB64.\n\nOnce I had a working website, I realized that I wanted to make it easier for other people to build websites in QB64, so I started building Qub, aided by [@knewter](https://github.com/knewter) who is another QBasic fan from way back.\n\nQub is not particularly important to modern technology in the grand scheme of things, but it's been a blast to work on. I hope you enjoy it!\n\n## Future\n\nI'd love to build more QBasic-powered server capabilities. I'm still learning how to utilize QB64 -- for example, in old QBasic, you couldn't include external files, but in QB64 you can.\n\n## TODO\n\n- [ ] Make the default template look nicer, better template README\n- [ ] YouTube video on Jamon's Code Quests\n\n## License\n\nMIT -- see [LICENSE](LICENSE) for details.\n\nQB64 is licensed under the [MIT](https://github.com/QB64Official/qb64/blob/master/licenses/COPYING.TXT) license.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjamonholmgren%2Fqub","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjamonholmgren%2Fqub","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjamonholmgren%2Fqub/lists"}