{"id":28805936,"url":"https://github.com/geekyants/geekymodel","last_synced_at":"2025-10-18T00:03:22.939Z","repository":{"id":39459106,"uuid":"197564022","full_name":"GeekyAnts/geekymodel","owner":"GeekyAnts","description":"GeekyModel - Opinionated State Container for Remote and Local Storage with a Database-like API powered by MobX","archived":false,"fork":false,"pushed_at":"2023-01-04T05:11:12.000Z","size":2018,"stargazers_count":6,"open_issues_count":24,"forks_count":3,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-06-16T08:15:02.274Z","etag":null,"topics":["front-end","mobx","orm-framework","react","state-management"],"latest_commit_sha":null,"homepage":"","language":"TypeScript","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/GeekyAnts.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":"2019-07-18T10:17:33.000Z","updated_at":"2022-04-08T10:49:09.000Z","dependencies_parsed_at":"2023-02-01T22:32:11.148Z","dependency_job_id":null,"html_url":"https://github.com/GeekyAnts/geekymodel","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/GeekyAnts/geekymodel","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/GeekyAnts%2Fgeekymodel","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/GeekyAnts%2Fgeekymodel/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/GeekyAnts%2Fgeekymodel/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/GeekyAnts%2Fgeekymodel/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/GeekyAnts","download_url":"https://codeload.github.com/GeekyAnts/geekymodel/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/GeekyAnts%2Fgeekymodel/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":260537176,"owners_count":23024557,"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":["front-end","mobx","orm-framework","react","state-management"],"created_at":"2025-06-18T10:43:55.594Z","updated_at":"2025-10-18T00:03:22.933Z","avatar_url":"https://github.com/GeekyAnts.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# 🗄 GeekyModel\n\n\u003e ## ⚠️️️️️ ⚠️️️️️ ⚠️️️️️ Not for production use ⚠️️️️️ ⚠️️️️️ ⚠️️️️️\n\n## What is 🗄 GeekyModel?\n\nGeekyModel is an opinionated State Container with a Database-like API powered by MobX.\n\nThe Data Models can later be mapped to a Remote service like Firebase, REST API, GraphQL etc.\n\n## Features ⚡\n\n- Build your front-end models **without worrying about the back-end**. GeekyModel works with LocalStorage by default.\n\n- **Offline First**: Connect to any **back-end at a later stage**, like\n\n  - Firebase / Firestore\n  - GraphQL\n  - REST APIs\n\n- Write request and response **middlewares to map** the differences in the front-end and the back-end models.\n\n- Built-in standard **validation** and option to add custom validators.\n\n- **Model Relationships**: Relate models with References and Foreign Keys.\n\n- **Built-in Fake Data**: Populate your UI with Fake Data automatically.\n\n## Getting started\n\n```\nyarn add geekymodel\n```\n\nOR\n\n```\nnpm install geekymodel --save\n```\n\n## Writing your first model\n\n```typescript\nimport { createModel } from \"geekymodel\";\n\nconst Todo = createModel({\n  table: \"todos\",\n  fields: [\"caption\", \"isCompleted\"]\n});\n```\n\n#### Creating a new Todo\n\n```ts\nconst newTodo = Todo.create();\n\nnewTodo.setField(\"caption\", \"Buy milk\");\nnewTodo.setField(\"isCompleted\", \"false\");\n\nnewTodo.save();\n\n// newTodo.saving gets populated which is a MobX ObservableValue\n```\n\n#### Fetching all the todos and wiring with React\n\n```tsx\n\n@observable\nclass TodoApp extends Component {\n\n    componentWillMount() {\n        this.todos = Todo.findAll();\n    }\n\n    render() {\n\n        const { data, loading } = this.todos;\n\n        if (loading)\n            return \u003cspan\u003eLoading\u003c/span\u003e;\n\n        return \u003cul\u003e\n            {data.map(item) =\u003e \u003cli\u003e{item.getField('caption')}\u003c/li\u003e}\n        \u003c/ul\u003e\n    }\n\n}\n\n```\n\n#### Adding query params\n\n```tsx\nconst allCompleted = Todo.where(\"isCaption\", \"=\", true).get();\n```\n\n## Roadmap\n\n- [x] Model creation with Schema\n- [ ] Convert to monorepo\n- [x] Injectable Transport Layer\n- [ ] Connection\n\n  - [ ] FakeConnection\n    - [x] Improve FakeConnection to request and response on Schema\n    - [ ] WIP: Implement get(), find(), insert(), update() and delete() with FakeConnection()\n  - [ ] LocalStorageConnection\n  - [ ] RuntimeStorageConnection\n  - [ ] RuntimeMiddlewareConnection\n  - [ ] FirestoreConnection\n  - [ ] GraphQLConnection\n  - [ ] RestConnection\n\n- [ ] Normalization\n- [ ] Validation\n- [ ] Middlewares:\n\n  - [x] Builder: For each method get(), find(), insert(), update() and delete()\n  - [ ] Connection: Request and Response\n\n- [x] Namespace Global variables in Database\n- [ ] Build script\n- [ ] Middlewares\n- [ ] Relationships\n- [ ] Examples:\n\n  - [ ] Todo app\n  - [ ] Hacker news clone\n  - [ ] Shopping cart\n\n## Decisions\n\n- DatabaseSchema to be forwarded from top level to the connection\n\n## Open Questions\n\n- How would it work with offline first database which syncs later?\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgeekyants%2Fgeekymodel","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fgeekyants%2Fgeekymodel","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgeekyants%2Fgeekymodel/lists"}