Telepat

Telepat是一个开源API平台,旨在为客户提供实时信息和信息更新,同时允许灵活部署和简单扩展。(Telepat is an open-source API platform, designed to deliver information and information updates in real-time to clients, while allowing for flexible deployment and simple scaling.)

Github stars Tracking Chart

Telepat是一个开源API平台,旨在为客户提供实时信息和信息更新,同时允许灵活部署和简单扩展。

让我们把它分解:

开源

我们相信,我们在过去几十年中目睹的大量自由软件正在改变我们所知道的世界面貌。今天的开源组件 -- 由国际社区创建、测试和维护 -- 是支持无数新产品和服务崛起的主要驱动力。如果不依赖这些组件提供的坚实基础, 就永远不可能以如此敏捷的方式迭代或缩放。

API平台

存储、检索和操作数据的操作构成了当今大多数软件产品的核心层。该层的现代多平台实施例是API。虽然这基本上是各种数据库,处理和传输服务之间的协调器,但是在设置所有连接样板代码时需要付出巨大的努力。所需的样板量使得测试多个数据库组件变得不可行,例如,找到适合特定用例的完美匹配。虽然现在有很多服务和堆栈可以显着加速这部分开发,但是大多数服务和堆栈都没有为幕后使用的特定组件提供任何选择。

即时的

多年来一直支持Web服务的标准模型是基于拉式的 - 也就是说,客户端向服务器询问他们需要的信息,服务器使用标记交易结束的数据的静态快照进行响应。刷新此陈旧数据意味着客户端需要在另一个事务中再次请求所有信息。虽然到目前为止在大多数情况下这已足够,但社交网络和按需经济的兴起标志着向新范式的过渡,数据需要从后端主动推送到所有订阅客户实时。

灵活部署

处理后端服务的软件组件为开发人员提供了极大的价值,因为它们显着减少了设置新项目所需的工作量。但是,需要同等程度的关注将这些项目从早期开发转移到后期生产阶段,其中应用程序需要部署在各种基础架构上,从自我管理的机器到云提供商。组件选择的模块化和灵活性需要通过部署选项的灵活性来补充,以便为整个项目生命周期提供安全性和简便性。

简单的缩放

在具有实时目标的系统设计中,最重要的方面可能是能够以一种响应系统即时工作负载的模式快速轻松地扩展架构的每个级别。从数据库到服务请求的工作人员,构成系统的所有节点都需要具有可靠的基础扩展策略,即使在快速流量激增的情况下也要关注正常运行时间和可用性。


Overview

Name With Ownertelepat-io/telepat-api
Primary LanguageJavaScript
Program languageJavaScript (Language Count: 2)
PlatformLinux, Mac, Windows
License:Other
Release Count20
Last Release Namev0.4.4 (Posted on 2017-07-07 12:10:18)
First Release Namev0.1 (Posted on )
Created At2015-06-26 14:22:28
Pushed At2017-08-25 09:26:24
Last Commit At2017-07-07 11:21:57
Stargazers Count332
Watchers Count19
Fork Count21
Commits Count659
Has Issues Enabled
Issues Count14
Issue Open Count5
Pull Requests Count6
Pull Requests Open Count1
Pull Requests Close Count2
Has Wiki Enabled
Is Archived
Is Fork
Is Locked
Is Mirror
Is Private

Build Status Test Coverage Code Climate David

Telepat API

This is the Telepat API where all api calls are made. CRUD operations are not processed here directly. Messages are
sent to the Telepat workers where CRUD operations are being taken care of along with client communication (notifications)

Quick startup guide

To start the API server all you need to do is run one command:

./bin/www

You can optionally tell the server to listen another port (default is 3000) by setting the environment variable PORT.
The API server will try and connect to each of the services until they are available (kafka, couchbase, elasticsearch).

Configuring

There are two ways to configure: either by using the config.example.json config file (rename it into config.json)
or by setting up environment variables (this method is the most convenient):

  • TP_MSG_QUE: Name of the messaging client you want to use. Should be the same as the exported variable in
    telepat-models
  • TP_MAIN_DB: Name of the main database which to use. Should be the same as the exported variable in telepat-models
  • TP_PW_SALT: Password salt used for hashing passwords

Important: You need to set up the other config variables specified in the telepat-models README file for resources
that you're using.

Testing

To run just the tests using mocha (make sure you have installed globally npm install mocha):

  • mocha api.js in the test folder
  • npm test in the root folder will also run istanbul (make sure you install it globally) code coverage tool

Notice: the testing suite automatically starts the API server but NOT the telepat workers. You should start them
before running the tests.

API documentation can be found here: http://docs.telepat.io/api-docs.html

To the top