{"id":29639148,"url":"https://github.com/neotomadb/tilia_api","last_synced_at":"2025-07-21T20:08:21.215Z","repository":{"id":42243262,"uuid":"126377071","full_name":"NeotomaDB/tilia_api","owner":"NeotomaDB","description":"A repository for the implementation of the Tilia/uploader API","archived":false,"fork":false,"pushed_at":"2025-04-24T16:36:49.000Z","size":310,"stargazers_count":0,"open_issues_count":13,"forks_count":1,"subscribers_count":5,"default_branch":"production","last_synced_at":"2025-04-24T17:44:06.059Z","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":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/NeotomaDB.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","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}},"created_at":"2018-03-22T18:13:49.000Z","updated_at":"2025-03-26T22:32:31.000Z","dependencies_parsed_at":"2023-12-19T17:02:31.742Z","dependency_job_id":"07dad466-52ef-4ca4-bbe3-d8a5998c4e7f","html_url":"https://github.com/NeotomaDB/tilia_api","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/NeotomaDB/tilia_api","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/NeotomaDB%2Ftilia_api","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/NeotomaDB%2Ftilia_api/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/NeotomaDB%2Ftilia_api/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/NeotomaDB%2Ftilia_api/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/NeotomaDB","download_url":"https://codeload.github.com/NeotomaDB/tilia_api/tar.gz/refs/heads/production","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/NeotomaDB%2Ftilia_api/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":266371486,"owners_count":23918862,"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","status":"online","status_checked_at":"2025-07-21T11:47:31.412Z","response_time":64,"last_error":null,"robots_txt_status":null,"robots_txt_updated_at":null,"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":"2025-07-21T20:08:15.618Z","updated_at":"2025-07-21T20:08:21.193Z","avatar_url":"https://github.com/NeotomaDB.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003c!-- badges: start --\u003e\n\n[![lifecycle](https://img.shields.io/badge/lifecycle-active-orange.svg)](https://www.tidyverse.org/lifecycle/#active)\n\n[![NSF-1550707](https://img.shields.io/badge/NSF-1550707-blue.svg)](https://nsf.gov/awardsearch/showAward?AWD_ID=1550707) [![NSF-1541002](https://img.shields.io/badge/NSF-1541002-blue.svg)](https://nsf.gov/awardsearch/showAward?AWD_ID=1541002)\n\n\u003c!-- badges: end --\u003e\n\n# Tilia API For Neotoma\n\nA repository for the implementation of the Tilia/uploader API. This API has replaced the earlier Tilia API which used SQL Server database and a .NET front end.\n\nThe API performs three main functions:\n\n  1. Query the active PostgreSQL database to return all function names and parameters required for the Tilia-related functions.\n  2. Provide endpoints of the format `Response/?FunctionName\u0026param1=xxxx\u0026param2=yyyy` that allow each individual function to be passed, and each parameter to be matched.\n  3. Provide an interactive wrapper for the API that wraps a JSON output and provides the opportunity to test and build the various API queries.\n\n## Development\n\n* [Simon Goring](http://goring.org): University of Wisconsin - Madison [![orcid](https://img.shields.io/badge/orcid-0000--0002--2700--4605-brightgreen.svg)](https://orcid.org/0000-0002-2700-4605)\n* Mike Stryker: Pennsylvania State University\n* The [Neotoma Paleoecological Base](http://neotomadb.org)\n\nPlease note that this project is released with a [Contributor Code of Conduct](CODE_OF_CONDUCT.md).  By participating in this project you agree to abide by its terms.\n\n## Components\n\nThe project uses a `node`/`express` backbone to support a single endpoint. \n\n### Installation\n\nTo start the project, clone the repository and install the required packages using:\n\n```bash\nnpm install\n```\n\nThis will install all required packages. The API can be started using one of three commands:\n\n```bash\nnpm run start # Run the API in production mode from the current directory\nnpm run dev_start # Run the API in development mode and serve from a ./bin/www directory\nnpm run dev_www # Run the API in development model\n```\n\nIn development mode the application listens on `PORT=3006`, and so the user can interact with the application using `localhost:3006`. The listening port can be changed in the file `tilia-api.js`.\n\n### Anatomy of an API call\n\nAll calls to `localhost:3006` (or its proxy) are processed within `tilia-api.js` and then pased to the routing methods within [`routes/data.js`](./routes/data.js).\n\nThe `routes/data.js` file first redirects to `/api/` to provide better identifiability of the URL calls (explicitly identifying them as API calls). The file recognizes multiple `GET`, `POST` and `DELETE` methods, and processes them in order. The format of the `router` calls is simply:\n\n```javascript\nrouter.VERB('PATH', function)\n```\n\nThe router object is providing the Router object that manages the user request. We define methods for each combination of [http method](https://developer.mozilla.org/en-US/docs/Web/HTTP/Methods) and path (`'PATH'`). For each method/path combination we define the function that will be used to manage that request.\n\nAll handling functions are found within the [`handlers`](/handlers) folder. Each function in the handler takes `req`, `res`, and `next` as parameters and should terminate in a Response that includes both a `200` success response and appropriate error responses.\n\n### Responses\n\nA client, sending a `GET` call to `/retrieve` (or `/retrieve/`) will obtain the following response (truncated):\n\n```json\n{\"status\":\"success\",\n \"data\":[{\"description\":\"**\",\n          \"name\":\"getagetypestable\",\n          \"detailsurl\":\"\u003ca href=\\\"?method=getagetypestable\u0026action=doc\\\" target=\\\"_BLANK\\\"\u003eDetails\u003c/a\u003e\",\n          \"params\":[{\"name\":null,\"type\":\"\"}]}, ... ]}\n```\n\nThis JSON response can be chained to a single-page app that may support an interface similar to the current [Tilia SQL app](https://tilia.neotomadb.org/Retrieve/doc2/).\n\n### Obtaining data from the Tilia name-space\n\nThe call to the new development API is structured as `method` \u0026 `parameter`:\n\n```\nGET retrieve/?method=tiliamethod\u0026param_a=value_a\u0026param_b=value_b\n```\n\nThis call invokes the `method` as a function in the Neotoma postgres database with the parameters as named parameters using the function call:\n\n```sql\nSELECT * FROM method(param_a:=value_a, ... )\n```\n\nAnd then returns the object as a JSON object. For example:\n\n```bash\nGET retrieve/?method=getchildtaxacount\u0026hitaxid=19\n```\n\nreturns\n\n```json\n{\"status\":\"success\",\n \"data\":[{\"getchildtaxacount\":\"0\"}],\n \"message\":\"Retrieved all tables\"}\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fneotomadb%2Ftilia_api","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fneotomadb%2Ftilia_api","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fneotomadb%2Ftilia_api/lists"}