{"id":16762430,"url":"https://github.com/tlack/qmvp","last_synced_at":"2026-03-18T22:03:47.808Z","repository":{"id":35868409,"uuid":"40153557","full_name":"tlack/qmvp","owner":"tlack","description":"qmvp is boiler plate for creating a Minimum Viable Product website in Q","archived":false,"fork":false,"pushed_at":"2015-08-19T21:33:30.000Z","size":140,"stargazers_count":9,"open_issues_count":1,"forks_count":2,"subscribers_count":5,"default_branch":"master","last_synced_at":"2025-01-22T22:25:44.641Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Nginx","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/tlack.png","metadata":{"files":{"readme":"README.md","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":"2015-08-03T23:52:43.000Z","updated_at":"2023-05-11T05:13:58.000Z","dependencies_parsed_at":"2022-08-26T15:22:34.668Z","dependency_job_id":null,"html_url":"https://github.com/tlack/qmvp","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tlack%2Fqmvp","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tlack%2Fqmvp/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tlack%2Fqmvp/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tlack%2Fqmvp/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/tlack","download_url":"https://codeload.github.com/tlack/qmvp/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243853618,"owners_count":20358451,"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":[],"created_at":"2024-10-13T04:44:44.116Z","updated_at":"2026-01-02T20:45:09.567Z","avatar_url":"https://github.com/tlack.png","language":"Nginx","funding_links":[],"categories":[],"sub_categories":[],"readme":"qmvp\n====\n\nQ Minimum Viable Product is a barebones boiler plate Q webserver that includes\ntemplating, serving from html/, index files, and logging. If you are playing\naround with a Q-based web site/service idea, this is a great place to start.\n\nAll of this is implemented in about 40 lines of code, with zero dependencies\nother than Q itself. By contrast, this README is already twice that size.\n\nThis is mostly an extract from the code used to run http://q4a.co/\n\nWhat is Q?\n----------\n\nQ is an insanely powerful programming language developed by \n(Kx Systems)[http://kx.com].\n\nConfiguration \u0026 Use\n-------------------\n\nThink of a name for your app. Be sure to make the name tacky or stupid.\n\nRename example.q to APPNAME.q.\n\nSet APPNAME and host/port bind details in config.sh. Keep this file bare\nminimum and don't use shell expressions - it is loaded by Q as well.\n\nexample.q/APPNAME.q\n-------------------\nThis file is ordered such that definitions of globals comes first, then\nlow level functions, then mid-level functions that manipulate data,\nand then the high level stuff that calls everything else, such as the\n.z.ph (HTTP GET) handler. It's written this way so that you can start\nfrom the top and read down, with full understanding of everything as you\ngo. \n\nThis isn't a framework. Feel free to remove anything you don't need from\nAPPNAME.q. Hack at will.\n\nA note on -l (logging mode)\n---------------------------\n\nI like using -l because I know I can be sloppy about my data and it will persist\nto the next session. -l is the default in the start scripts provided here.\n\nYou should be aware of the way it works because it has a \nfew odd caveats:\n\n* For updates to be logged, they must be sent to the currently running server\n  as so: ```0(upsert;`Table;row)```. Updates done at the console won't be logged.\n* As you do work interactively, be sure to flush your changes to disk with \\l.\n\tYou can set this to occur automatically every 60 seconds with\n\t```minutely:{system\"l\"}```\n* The log file is the name of your start script with .q replaced by .log. Keep\n  this in mind as you change your script name.\n\nI hope to write a more thorough version of this logging guide soon.\n\nTemplates\n---------\n.html files (served from .h.HOME) are interpreted and expressions within {{ and\n}} are evaluated as Q. \n\nTimers\n------\nDefine minutely[], hourly[], and daily[] - these are called automatically from our\n.z.ts handler, which dispatches every 60 seconds.\n\nBackups\n-------\nBackups of the entire environment are taken with daily[] and saved in\n/tmp/APPNAME[WD].qdb. WD is the week day number, from 0 to 6. By using this as\npart of the filename, we'll never overflow the disk, and you keep seven days of\nbackups too.\n\n\"Analytics\"\n-----------\nA log of hits is stored in HITS. isbot=1b if the user agent (available as UA)\nmatches \"*[Bb]ot*\".  This is available to the running script as ISBOT as well.\n\nAbout proxying\n--------------\nI tend to proxy my stuff through Nginx for safety and perceived static file serving\nperformance. An example config file can be found in nginx.conf.\n\nPerformance\n-----------\n\"Seems OK?\"\n\nI haven't had the need to try improving the performance of this software. It\nseems pretty quick to me.\n\nstart-prod.sh\n-------------\nStart the server (APPNAME.q) in production mode:\n- binds to 127.0.0.1:8888 (edit config.sh to change)\n- logging is on (-l)\n- output tee'd to /tmp/q-APPNAME.log\n- reporting client-side exceptions is off (-e 0)\n- if you are running this on a public IP and port 80, uncomment the first line\n\tof server.q so that .z.po is disabled and remote clients can't connect and wreak\n\thavoc\n\nstart-dev.sh\n------------\nStart the server (APPNAME.q) in development mode:\n- binds to 127.0.0.1:8889 (edit config.sh to change)\n- logging is on (-l)\n- output tee'd to /tmp/q-APPNAME-dev.log\n- reporting client-side exceptions is ON (-e 1). This will halt your REPL on\n\terror, good for debugging.\n\nStarting at system boot\n-----------------------\n\nThis seems to work in `/etc/rc.local`:\n\n```\ncd /home/APPNAME/app; \nnohup sh start-prod.sh 2\u003e\u00261\u0026\necho $! \u003e /var/run/q-APPNAME-prod.pid\n```\n\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftlack%2Fqmvp","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftlack%2Fqmvp","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftlack%2Fqmvp/lists"}