{"id":25105135,"url":"https://github.com/hidaytrahman/preapi","last_synced_at":"2025-04-19T19:29:21.830Z","repository":{"id":74733632,"uuid":"575568647","full_name":"hidaytrahman/preapi","owner":"hidaytrahman","description":"A very simple API prototype file based database","archived":false,"fork":false,"pushed_at":"2024-08-18T14:52:39.000Z","size":333,"stargazers_count":3,"open_issues_count":2,"forks_count":1,"subscribers_count":3,"default_branch":"main","last_synced_at":"2025-03-29T12:11:54.006Z","etag":null,"topics":["api","crud-api","filedb","json","nodejs","rest-api"],"latest_commit_sha":null,"homepage":"https://preapi.vercel.app","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/hidaytrahman.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","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}},"created_at":"2022-12-07T20:06:39.000Z","updated_at":"2024-08-18T14:52:42.000Z","dependencies_parsed_at":"2024-02-11T23:21:38.392Z","dependency_job_id":"9292a2af-b1f1-4783-81ce-b9a54341b412","html_url":"https://github.com/hidaytrahman/preapi","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hidaytrahman%2Fpreapi","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hidaytrahman%2Fpreapi/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hidaytrahman%2Fpreapi/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hidaytrahman%2Fpreapi/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/hidaytrahman","download_url":"https://codeload.github.com/hidaytrahman/preapi/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":249779322,"owners_count":21324393,"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":["api","crud-api","filedb","json","nodejs","rest-api"],"created_at":"2025-02-07T22:42:03.823Z","updated_at":"2025-04-19T19:29:21.796Z","avatar_url":"https://github.com/hidaytrahman.png","language":"JavaScript","readme":"# Pre API\n\n## File Based Databse REST API\n\nA very simple prototype file based database REST API developed using \u003ccode\u003eNodejs\u003c/code\u003e, `ExpressJS`, its easy to use to any type of project\n\n### Usecases\n\n- Dont wait for BE you can use till BE is ready\n- Learn CRUD operations without having API dependencies\n- No real database required\n- Build Prototype based apps and more\n\n## Docs\n\n### How to use?\n\n1. [Download](https://github.com/hidaytrahman/preapi/archive/refs/heads/main.zip) or [fork it](https://github.com/hidaytrahman/preapi/fork)\n2. run `npm install`\n3. `npm start`\n\nThats it.\n\nIt can be accessible here : `http://localhost:3030/todos`\n\n_\\* Feel free to change port_\n\nFeel free to use `VSCode REST Client` extension docs are already available in `docs/API.rest` file\n\n---\n\n### Get Todos (anything)\n\n```\nGET: http://localhost:3030/todos\n```\n\n```json\n{\n  \"todos\": [\n    {\n      \"id\": \"eBPNbH6TOc40qu6DWcRv\",\n      \"todo\": \"Visit office space\",\n      \"isCompleted\": true,\n      \"created_at\": \"2022-12-07T19:10:39.106Z\"\n    }\n  ],\n  \"message\": \"Todo fetched successfully!\"\n}\n```\n\n### Create\n\n```javascript\nPOST http://localhost:3030/todo\nContent-Type: {{contentType}}\n\n{\n    \"todo\": \"New todo item\",\n    \"isCompleted\": true\n}\n```\n\nResponse\n\n```json\n{\n  \"todos\": [\n    {\n      \"id\": \"eBPNbH6TOc40qu6DWcRv\",\n      \"todo\": \"New todo item\",\n      \"isCompleted\": true,\n      \"created_at\": \"2022-12-07T19:10:39.106Z\"\n    }\n  ],\n  \"message\": \"Todo fetched successfully!\"\n}\n```\n\n### Delete\n\n```javascript\nDELETE http://localhost:3030/todo/{id}\nContent-Type: {{contentType}}\n```\n\nResponse (OK)\n\n```json\n{\n  \"message\": \"Deleted Successfully!\"\n}\n```\n\nResponse (Not exist)\n\n```json\n{\n  \"message\": \"Data doesn't exist or please check the id\"\n}\n```\n\n## File Database\n\nAll database files should be under `src/data/` folder\n\nExample database for Todo\n`src/data/data.json`\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhidaytrahman%2Fpreapi","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fhidaytrahman%2Fpreapi","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhidaytrahman%2Fpreapi/lists"}