{"id":20181849,"url":"https://github.com/nichoth/template-web-ssc","last_synced_at":"2025-05-07T03:30:32.383Z","repository":{"id":184562147,"uuid":"671601233","full_name":"nichoth/template-web-ssc","owner":"nichoth","description":"Build web apps and native apps from the same source code","archived":true,"fork":false,"pushed_at":"2024-12-14T04:20:44.000Z","size":371,"stargazers_count":4,"open_issues_count":0,"forks_count":0,"subscribers_count":3,"default_branch":"main","last_synced_at":"2025-03-07T16:07:45.411Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"JavaScript","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/nichoth.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,"governance":null,"roadmap":null,"authors":null}},"created_at":"2023-07-27T17:36:15.000Z","updated_at":"2025-02-08T02:26:46.000Z","dependencies_parsed_at":null,"dependency_job_id":"97e40d44-6124-4e13-8728-e0a82852c0e1","html_url":"https://github.com/nichoth/template-web-ssc","commit_stats":null,"previous_names":["nichoth/template-web-ssc"],"tags_count":0,"template":true,"template_full_name":"nichoth/template-tonic-spa","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nichoth%2Ftemplate-web-ssc","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nichoth%2Ftemplate-web-ssc/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nichoth%2Ftemplate-web-ssc/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nichoth%2Ftemplate-web-ssc/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/nichoth","download_url":"https://codeload.github.com/nichoth/template-web-ssc/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":252806322,"owners_count":21807188,"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-11-14T02:36:53.977Z","updated_at":"2025-05-07T03:30:32.093Z","avatar_url":"https://github.com/nichoth.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# template web ssc\n\nUse the same source code to build a website and a native app with [ssc](https://github.com/socketsupply/socket).\n\nThis uses [single-page application architecture](https://developer.mozilla.org/en-US/docs/Glossary/SPA) \u0026 client-side routing. Because [route-event](https://github.com/nichoth/route-event) listens for clicks on the document.body, URL-based routing will work, even though the native application does not have URLs.\n\n-------\n\n## develop\n\n### start a local web server\n```\nnpm start\n```\n\n### start an ssc project\n```\nnpm run start-ssc\n```\n\n## build\n`public` dir is for website, `dist` dir is for ssc app\n\n### build for browsers\n```\nnpm run build-web\n```\n\n### build a native app\nFirst compile code to `dist`, then run `ssc build`, with `dist` as the value for `copy` in `socket.ini`.\n\n```\nnpm run build-ssc\n```\n\n### build everything\n```\nnpm run build\n```\n\n\u003e [!NOTE]  \n\u003e We are using the `--bundle` flag with `esbuild` when building for `ssc` because trying to use an `importmap` in HTML results in this error:\n\n```\nTypeError: Module specifier, '@socketsupply/tonic' does not start with \"/\", \"./\", or \"../\". \n```\n\n-------\n\nIs there a better way to check at runtime if this is running via ssc or browser? We are checking the pathname in `index.js`\n\n```js\nroute: location.pathname.includes('Contents/Resources/index.html') ?\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnichoth%2Ftemplate-web-ssc","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fnichoth%2Ftemplate-web-ssc","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnichoth%2Ftemplate-web-ssc/lists"}