{"id":18053850,"url":"https://github.com/danielstern/node-tdd-api","last_synced_at":"2025-04-05T08:21:46.955Z","repository":{"id":69958818,"uuid":"65482542","full_name":"danielstern/node-tdd-api","owner":"danielstern","description":"An API for messaging built on Node with Test-Driven Principles","archived":false,"fork":false,"pushed_at":"2016-08-13T16:27:53.000Z","size":35,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-02-10T15:50:55.853Z","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":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/danielstern.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,"publiccode":null,"codemeta":null}},"created_at":"2016-08-11T15:57:42.000Z","updated_at":"2016-08-11T15:58:09.000Z","dependencies_parsed_at":"2023-08-23T13:33:16.655Z","dependency_job_id":null,"html_url":"https://github.com/danielstern/node-tdd-api","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/danielstern%2Fnode-tdd-api","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/danielstern%2Fnode-tdd-api/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/danielstern%2Fnode-tdd-api/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/danielstern%2Fnode-tdd-api/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/danielstern","download_url":"https://codeload.github.com/danielstern/node-tdd-api/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247307329,"owners_count":20917449,"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":"2024-10-31T00:08:17.451Z","updated_at":"2025-04-05T08:21:46.928Z","avatar_url":"https://github.com/danielstern.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"#Short-Format Messaging Platform for Node.js\n## Introduction\nThis application is meant to be a demonstration of a Node.js implementation of a API using the following principles...\n- TDD\n- Event-Sourcing\n- Stateless principles\n- Centralized OAuth Usage\n\n## How to use this repository?\nThis repository makes an excellent-starting point for a reliable messaging application. The existing TDD-based structure is functionally correct but not too hard to understand.\nIt is also a good source of highly functional code samples.\nVery little extra or unnecessary functionality has been added.\n\n\n## Quick Start\nClone this application and install all dependencies.\n###Run tests\n`npm test`\n\n##Implementation\n### TDD\nThis application uses Test Driven Development throughout. A `test/` directory holds tests for almost every service and model.\nTests were written throughout this application's development, not just at the beginning. As such, all the components are testable by design.\nThis application is backed by 20 tests and so its functionality can always be tested.\n\n### Mocking\nIn order to test Facebook functionality, this application uses the `mock-fs` module to create a mock Facebook service.\n\n### Mocha\nTests are implemented in Mocha which allows for easy asynchronous testing. Further tests are written with `Supertest` in order to test the API.\n\n### Facebook-Based Authorization\nThis app foregoes the account-making process altogether. Instead, only sign-up through Facebook is allowed. There are numerous advantages to this...\n- Works nicely on all platforms\n- Users are already familiar with the Facebook interface\n- Facebook handles security, reducing the developer's liability\n- Can be implemented faster than writing own sign-up system\n- In the future, different authorizations (GitHub, Google+) can be added\n\n##Design\n\n### Event Sourcing\nAll user interactions (sign-up, posts) are stored in an event-sourced DB implementing Mongo on the back end. This means that data is never erased - instead it is stored as a series of events. Services then analyze relevant events to produce expected results (See `services/user/UserFollowerRetrievalService.js` for more info).\n#### Why Event Sourcing?\nEvent sourcing has numerous advantages...\n- More detailed analysis possible\n- Harder to accidentally delete data\n- Easier to regress state of the application\n- Only adding data never deleting means more streamlined databases can be used\n\n### Application Flow\nClient applications interact with the application through a standard REST API. Each route in the API is testable and stands on its own. The REST API then calls back-end services which streamline the use of the Event-Sourced DB.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdanielstern%2Fnode-tdd-api","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdanielstern%2Fnode-tdd-api","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdanielstern%2Fnode-tdd-api/lists"}