{"id":51261428,"url":"https://github.com/caasmo/restinpieces-js-sdk-example","last_synced_at":"2026-06-29T12:30:47.883Z","repository":{"id":352295279,"uuid":"1211632511","full_name":"caasmo/restinpieces-js-sdk-example","owner":"caasmo","description":null,"archived":false,"fork":false,"pushed_at":"2026-04-18T20:27:50.000Z","size":122,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"master","last_synced_at":"2026-04-18T22:25:19.253Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"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/caasmo.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,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2026-04-15T15:32:53.000Z","updated_at":"2026-04-18T20:27:54.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/caasmo/restinpieces-js-sdk-example","commit_stats":null,"previous_names":["caasmo/restinpieces-js-sdk-example"],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/caasmo/restinpieces-js-sdk-example","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/caasmo%2Frestinpieces-js-sdk-example","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/caasmo%2Frestinpieces-js-sdk-example/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/caasmo%2Frestinpieces-js-sdk-example/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/caasmo%2Frestinpieces-js-sdk-example/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/caasmo","download_url":"https://codeload.github.com/caasmo/restinpieces-js-sdk-example/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/caasmo%2Frestinpieces-js-sdk-example/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":34927673,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-06-29T02:00:05.398Z","response_time":58,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"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-06-29T12:30:46.749Z","updated_at":"2026-06-29T12:30:47.875Z","avatar_url":"https://github.com/caasmo.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"\n# RestInPieces JS SDK Example\n\nThis project serves as a comprehensive example of how to integrate the RestInPieces JS SDK within a Go-based web application. It demonstrates a typical project structure that bundles a frontend with a Go backend into a single, self-contained binary.\n\n## Standard Layout\n\nThis project follows a standard Go and frontend integration layout, designed to produce a self-contained binary.\n\n### Frontend (`/web`)\nThe `web/` directory contains the complete frontend environment:\n- **`src/`**: Source files including HTML, CSS, JavaScript, and React components.\n- **`dist/`**: Compiled, minified, and gzipped production assets.\n- **`package.json` \u0026 `vite.config.js`**: Frontend dependency management and bundling.\n- **`embed.go`**: Defines the `web` Go package and uses `//go:embed dist` to include the compiled assets in the binary via the `Assets` variable.\n\n### Backend\n- **Root Directory**: The core Go application logic resides in the root of the project.\n- **Entry Point (`/cmd`)**: The application entry point is located in `cmd/example/main.go`.\n- **Asset Integration**: The backend serves the bundled frontend by sub-mounting the `dist` directory from the embedded filesystem:\n  ```go\n  subFS, err := fs.Sub(web.Assets, \"dist\")\n  ```\n\n## Asset Generation\nTo bundle and optimize frontend assets (HTML, CSS, JavaScript) with minification and gzip compression:\n\n    go generate ./web/\n\nThis creates production-ready assets in `web/dist/` with both compressed (.gz) and uncompressed versions.\n\n### Custom Builder\nWhile modern frontend projects typically rely on external build tools like Vite or Webpack, this repository demonstrates a **custom builder** approach. \n\nThe build logic is implemented in Go using the [esbuild](https://github.com/evanw/esbuild) library, located at `gen/gogenerate-assets.go`. \n## Run\n\n    go run cmd/example/main.go -age-key age_key.txt -dbpath app.db\n\n## TODO\n- login otp\n- signup otp\n- otp workflows\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcaasmo%2Frestinpieces-js-sdk-example","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcaasmo%2Frestinpieces-js-sdk-example","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcaasmo%2Frestinpieces-js-sdk-example/lists"}