{"id":25961709,"url":"https://github.com/ttab/elephant-chrome","last_synced_at":"2026-05-28T20:31:26.775Z","repository":{"id":199881530,"uuid":"703993841","full_name":"ttab/elephant-chrome","owner":"ttab","description":null,"archived":false,"fork":false,"pushed_at":"2024-04-12T13:17:11.000Z","size":1302,"stargazers_count":0,"open_issues_count":3,"forks_count":1,"subscribers_count":6,"default_branch":"main","last_synced_at":"2024-04-12T16:44:56.985Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"TypeScript","has_issues":false,"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/ttab.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}},"created_at":"2023-10-12T10:17:39.000Z","updated_at":"2024-04-15T13:02:32.679Z","dependencies_parsed_at":"2023-12-20T14:10:31.350Z","dependency_job_id":"4809aa9d-35d8-4aea-9304-7c9cfb6d1e2b","html_url":"https://github.com/ttab/elephant-chrome","commit_stats":null,"previous_names":["ttab/elephant-chrome"],"tags_count":26,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ttab%2Felephant-chrome","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ttab%2Felephant-chrome/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ttab%2Felephant-chrome/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ttab%2Felephant-chrome/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ttab","download_url":"https://codeload.github.com/ttab/elephant-chrome/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":241912995,"owners_count":20041457,"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":"2025-03-04T19:41:03.688Z","updated_at":"2026-05-28T20:31:26.744Z","avatar_url":"https://github.com/ttab.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Elephant Chrome\n\nThis is the main Elephant application. Start using `npm run dev:web` \u0026\u0026 `npm run dev:css`\n\n# Development info\n\n## Structure in **elephant-chrome**\n\n### Directory structure\n\nViews that can function in their own right should be in `src/views/`, components in `src/commponents/` and support \"library\" functions in `src/lib/` as per below example.\n\nExample structure.\n\n```\nsrc/\n  context/\n    ThemeProvider.tsx\n  hooks/\n    useTheme.tsx\n  lib\n    auth\n      handlLogin.ts\n      handleLogout.ts\n  views/\n    index.tsx\n    Editor/\n      Editor.tsx\n      Editable.tsx\n    Planning\n      Planning.tsx\n      lib/\n        sortPlanning.ts\n        filterPlanning.ts\n      hooks/\n        usePlanningFilter.tsx\n        usePlanningSort.tsx\n  components\n    ItemCard\n      ItemCard.tsx\n      ItemCardHeader.tsx\n      ItemCardFooter.tsx\n    ItemList\n      ItemList.tsx\n    Usermenu\n      Usermenu.tsx\n```\n\n### Component naming and structure\n\nComponent and view filenames should use _PascalCase_, both for folder and main file. Exported name from a file should be same as filename. Parent directories should have an `index.tsx` with all views, components, lib files, etc.\n\nSupport functions in component files should use _camelCase_ (i.e `myFunction()` and never be exported.\n\nComponents should be declared using fat arrow functions but regular _function()_ style for support functions below component function if applicable. Sub components should be broken out to their own files and exported through the main file.\n\n```js\n// src/components/my-component/index.tsx example structure\n\nexport { MySubComponent } from '@/components/my-component/my-sub-component'\n\nexport interface MyComponentProps {\n  variant: string\n}\n\nexport const MyComponent = (): JSX.Element =\u003e {\n   return (\n      \u003cdiv\u003e\n         {allIsOk() \u0026\u0026 (\n            \u003cMySubComponent\u003eAll is ok\u003c/MySubComponent\u003e\n         )}\n      \u003c/div\u003e\n   )\n}\n\nfunction allIsOk(): boolean {\n   return true\n}\n```\n\n### Hooks and lib naming\n\nAll hooks and support functions in _hooks/_ and _lib/_ should all use _camelCase_ naming. Hooks should always use `.tsx` as suffix to separate them from other type of function files in _lib/_.\n\n### Import aliases\n\nUse `@/lib/...`, `@/components/`, `@/hooks/` and `@/views/` etc to import components and functions.\n\n## Other resources\n\n`elephant-chrome` depends on other packages:\n\n* elephant-ui - components and styles\n* textbit - text editor\n* textbit-plugins - plugins for textbit editor\n\nTo link these packages there's a utility script in `./tooling` named link. Which can be executed\nwith `npm run link:elephant-ui` to hassle free link the packages during development.\n\n```json\n    \"link:elephant-ui\": \"./tooling/link.sh ../elephant-ui\",\n    \"unlink:elephant-ui\": \"./tooling/unlink.sh ../elephant-ui\"\n```\n\nthe link/unlink scripts takes a relative path to the package as argument.\n\n## Running multiple dev instances with Caddy\n\n`npm run dev:multi` kicks off `tooling/multi.sh`, which ensures `concurrently` + `caddy` exist before launching both dev stacks and the proxy from `Caddyfile`.\n\n* Instance A: `PORT=5183`, `VITE_DEV_SERVER_PORT=5173`, `VITE_HMR_PORT=6000`\n* Instance B: `PORT=5283`, `VITE_DEV_SERVER_PORT=5273`, `VITE_HMR_PORT=5000`\n* Caddy listens on `http://localhost:3333` and round-robins HTTP + websockets between both\n\nEdit `tooling/multi.sh` (and `Caddyfile`) to change ports; run the script directly or stick with npm.\nFor single-instance work, just run `npm run dev` with your own env vars.\nTo install caddy:\n\n```bash\nbrew install caddy #MacOS\nsudo apt install caddy #Debian/Ubuntu\nnix-shell -p caddy #Nixos\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fttab%2Felephant-chrome","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fttab%2Felephant-chrome","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fttab%2Felephant-chrome/lists"}