{"id":22712224,"url":"https://github.com/buildit/twig-api","last_synced_at":"2025-04-13T16:20:19.685Z","repository":{"id":14464598,"uuid":"88779508","full_name":"buildit/twig-api","owner":"buildit","description":"APIs for network diagramming since 2016","archived":false,"fork":false,"pushed_at":"2022-12-30T17:46:31.000Z","size":2557,"stargazers_count":1,"open_issues_count":20,"forks_count":5,"subscribers_count":14,"default_branch":"master","last_synced_at":"2024-04-14T12:32:23.908Z","etag":null,"topics":["api","graph"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/buildit.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2017-04-19T18:49:23.000Z","updated_at":"2019-06-17T21:32:16.000Z","dependencies_parsed_at":"2023-01-11T18:49:27.086Z","dependency_job_id":null,"html_url":"https://github.com/buildit/twig-api","commit_stats":null,"previous_names":[],"tags_count":34,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/buildit%2Ftwig-api","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/buildit%2Ftwig-api/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/buildit%2Ftwig-api/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/buildit%2Ftwig-api/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/buildit","download_url":"https://codeload.github.com/buildit/twig-api/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248741628,"owners_count":21154346,"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","graph"],"created_at":"2024-12-10T13:09:42.302Z","updated_at":"2025-04-13T16:20:19.666Z","avatar_url":"https://github.com/buildit.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Twig API\n\nTwig API is the API behind [Twig](https://github.com/buildit/twig), a browser-based single-page application using\n[D3](https://d3js.org/) to render graph visualisations.\n\n## Table of Contents\n\n* [Getting Started](#getting-started)\n    - [CouchDB](#couchdb)\n    - [Quick Start](#quick-start)\n    - [Documentation](#documentation)\n* [Description](#description)\n    - [What is Twig?](#what-is-twig)\n    - [What is Twig API?](#what-is-twig-api)\n* [Where is Twig API Deployed?](#where-is-it-deployed)\n* [Development](#development)\n    - [Testing](#testing)\n    - [Coding Standards](#coding-standards)\n    - [CI/CD](#cicd)\n    - [How To Contribute](#how-to-contribute)\n    - [Releasing](#releasing)\n* [Versioning](#versioning)\n* [Team](#team)\n* [License](#license)\n\n### Getting Started\n---\n#### CouchDB\n\nTwig API requires a data store. At this time that is [CouchDB](http://couchdb.apache.org/). Please install and have it\nrunning prior to using Twig and Twig API.\n\nTo install with brew:\n```Shell\nbrew install couchdb\n```\n\nTo install/run with Docker:\n```bash\n# expose it to the world on port 5984\ndocker run -d --rm -p 5984:5984 --name couchdb couchdb:1\n```\n\nOnce CouchDB is installed, it should be running at [http://localhost:5984](http://localhost:5984). If you open\nlocalhost:5984 you should see something along the lines of:\n```Shell\n{\"couchdb\": \"Welcome\",...}\n```\n\nYou also need to update the cross origin settings to allow local access.\n\n```Shell\nnpm install -g add-cors-to-couchdb\nadd-cors-to-couchdb\n```\n\n#### Quick Start\n\nAfter you have installed CouchDB, you are ready to get Twig API started. Clone this repository, then run\n\n```Shell\ncp .env.example .env\nnpm start\n```\n\nTwig API will run locally at localhost:3000.\n\nTo see a list of twiglets, navigate to http://localhost:3000/v2/twiglets.\n\nTo see a list of models, navigate to http://localhost:3000/v2/models.\n\n#### Docker Run\n\nTo run this project with no environment setup, you can run the following command from the root.\n\n`docker-compose up`\n\nWhen done run the following to teardown the contents running in the background.\n\n`docker-compose down`\n\nThis version of docker is purely meant for running this repo. It is not intended for live development\nand runs a production version of the project.\n\n#### Documentation\n\nTwig API is documented using [Swagger](http://swagger.io/). If running Twig API locally, navigate to http://localhost:3000/documentation to view the documentation.\n\n### Description\n---\n#### What is Twig?\n\n[Twig](https://github.com/buildit/twig) is a network diagramming tool that allows users to create twiglets (force graphs)\nthat model relationships between nodes and links and create a visual way to explore these relationships.\n\nFor a more detailed look at Twig, check out Twig's [GitHub page](https://github.com/buildit/twig) and the very awesome\nTwig [demo video](https://youtu.be/q4LWoQUeRjc).\n\n#### What is Twig API?\n\nThe API will enable CRUD operations on the Twig database. Users can create, edit, and delete twiglets, models, views on\ntwiglets, events and event sequences on twiglets, and edit a twiglet's model.\n\nIn order to use Twig locally, an instance of Twig API must be up and running.\n\n### Where is it deployed?\n---\nIn the Buildit Riglet:\n\n**Staging Environment**: https://staging-twig-api.buildit.tools - must be connected to Buildit Tools VPN/VPC\n\n**Production Environment**: http://twig-api.buildit.tools\n\n### Development\n---\n#### Testing\n\nTwig API uses [Mocha](https://mochajs.org/), [Chai](http://chaijs.com/), and [Sinon](http://sinonjs.org/) for testing. Want to make a change? Write a test. Write code until it passes. Make sure you didn't break any other tests.\n\nTo run tests (unit \u0026 e2e respectively)\n```Shell\nnpm test\nnpm run test:e2e\n```\n\n#### Coding Standards\n\nTwig API uses linting rules as defined in .eslintrc. By default all .js files are linted. These linting rules follow\nthe guidelines outlined in [Airbnb's JavaScript style guide](https://github.com/airbnb/javascript).\n\n#### CI/CD\n\nTwig API CI/CD assumes the use of [Jenkins](https://jenkins.io/) Pipeline features (see [Jenkinsfile](Jenkinsfile)).\n\n##### Opening an issue\n\nIf you find a bug, please open an issue [here](https://github.com/buildit/twig-api/issues). Please include the expected\nbehavior, actual behavior, and detailed steps to reproduce the bug.\n\n#### Releasing\n\nTo release a new version just bump the version with\n- `npm version [\u003cnewversion\u003e | major | minor | patch ]`\n\nThis will update package.json, commit the version update, git tag and push to master. The new tag will trigger the deployment build which will run the tests, static code analysis, build and deploy.\n\n### Versioning\n---\nTwig API is versioned via path http://example.com/v2/[route], etc.\n\n### Team\n---\nShahzain Badruddin\n\nPaul Karsten\n\nDavid Moss\n\nAndy Ochsner ([@aochsner](https://github.com/aochsner))\n\nAndrew Urmston\n\nHap Pearman ([@spotted-dog](https://github.com/spotted-dog))\n\nBen Hernandez ([@BenAychh](https://github.com/BenAychh))\n\nLizzie Szoke ([@lizziesz](https://github.com/lizziesz))\n\nMike Thomas ([@mathomas](https://github.com/mathomas))\n\n### License\n---\nSee the [LICENSE](LICENSE.md) file for license rights and limitations (Apache 2.0).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbuildit%2Ftwig-api","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbuildit%2Ftwig-api","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbuildit%2Ftwig-api/lists"}