All Projects → pedsmoreira → premiere

pedsmoreira / premiere

Licence: MIT license
A simple way to consume APIs with Javascript.

Programming Languages

typescript
32286 projects
javascript
184084 projects - #8 most used programming language

Projects that are alternatives of or similar to premiere

Micro Server Own
基于SpringCloud 的微服务,订单,支付,商场(活动),工作流,用户,短信,极光
Stars: ✭ 195 (+191.04%)
Mutual labels:  restful
Flasgger
Easy OpenAPI specs and Swagger UI for your Flask API
Stars: ✭ 2,825 (+4116.42%)
Mutual labels:  restful
Http Fake Backend
Build a fake backend by providing the content of JSON files or JavaScript objects through configurable routes.
Stars: ✭ 253 (+277.61%)
Mutual labels:  restful
Flight
An extensible micro-framework for PHP
Stars: ✭ 2,396 (+3476.12%)
Mutual labels:  restful
Wok
A cherrypy framework for multi-purpose plug-ins
Stars: ✭ 215 (+220.9%)
Mutual labels:  restful
Jersey 2.x User Guide
Jersey 2.x User Guide《Jersey 2.x 用户指南》 ,中文翻译
Stars: ✭ 235 (+250.75%)
Mutual labels:  restful
Go Chassis
a microservice framework for rapid development of micro services in Go with rich eco-system
Stars: ✭ 2,428 (+3523.88%)
Mutual labels:  restful
rest
REST webservices for TYPO3 CMS
Stars: ✭ 78 (+16.42%)
Mutual labels:  restful
Flask Restplus
Fully featured framework for fast, easy and documented API development with Flask
Stars: ✭ 2,585 (+3758.21%)
Mutual labels:  restful
Php Crud Api
Single file PHP script that adds a REST API to a SQL database
Stars: ✭ 2,904 (+4234.33%)
Mutual labels:  restful
Lanblog
懒人博客,前后端分离,Vue+Beego Restful api 开箱即用,部署简单,后台管理系统简洁美观。好了,我编不下去了🤣
Stars: ✭ 212 (+216.42%)
Mutual labels:  restful
Nohttprxutils
🐠 本库是一款Android-Http标准协议网络通讯框架,基于RxJava+NoHttp封装。支持文件上传和断点续传、文件下载和断点下载、Http协议和Https协议队列网络请求、网络请求轮询。
Stars: ✭ 214 (+219.4%)
Mutual labels:  restful
Clevergo
👅 CleverGo is a lightweight, feature rich and high performance HTTP router for Go.
Stars: ✭ 246 (+267.16%)
Mutual labels:  restful
Blogbackendproject
Backend code for my blogs, develop with Django Rest framework.
Stars: ✭ 204 (+204.48%)
Mutual labels:  restful
gorest
RESTful Server Systems [DEPRECATED]
Stars: ✭ 34 (-49.25%)
Mutual labels:  restful
Mxisd
Federated Matrix Identity Server
Stars: ✭ 194 (+189.55%)
Mutual labels:  restful
Tourism Demo
Flutter app backed by Redux, shows animations, internationalization (i18n), ClipPath, fonts and others...
Stars: ✭ 232 (+246.27%)
Mutual labels:  restful
go-zero
A cloud-native Go microservices framework with cli tool for productivity.
Stars: ✭ 23,294 (+34667.16%)
Mutual labels:  restful
accountbook server
📔 记账本 Django 后端
Stars: ✭ 20 (-70.15%)
Mutual labels:  restful
Adnc
微服务框架,同时也适用于单体架构系统的开发。支持经典三层与DDD架构开发模式、集成了一系列主流稳定的微服务配套技术栈。一个前后端分离的框架,前端基于Vue、后端基于.Net Core 3.1构建。
Stars: ✭ 223 (+232.84%)
Mutual labels:  restful

Premiere

npm version Build Status Code Climate Test Coverage

⚠️ This package is no longer maintained

A simple way to consume APIs with Javascript.

Premiere helps you reducing the amount of boilerplate necessary to consume APIs. Here's an example of how it looks like:

const todoList = new TodoList();
todoList.title = 'Daily routine';
todoList.save();

// Get user by todo list
const user = await todoList.user;

// Get items from todo list
const items = await todoList.items;

// List all todo lists by user
const lists = TodoList.byUser(1);
  • Friendly syntax, inspired by Eloquent (Laravel) and ActiveRecord (Rails)
  • Normalization
    • Normalize data coming from the API
    • Denormalize data before sending to the API
  • Smart Caching to speed up your app
    • Automatic request and result caching
    • Automatic cache removal (for lists) upon saving a record
  • Support to Foreign keys
  • Support to HTTP Header settings
    • JWT token helper
    • CSRF token helper

Workflow

Workflow

** For more about how promises work, check out Dave Atchley's article

Installation

Using npm:

npm install premiere --save

Getting Started

Setting API url

import { api };
api.base = 'http://api.com'

Creating a new model

import { api, Model } from 'premiere';
import User from './User';
import TodoItem from './TodoItem';

// Set your api base
api.base = 'http://my-api.com';

// Define your model
export default class TodoList extends Model {
  path = 'todo-item';
  
  user_id: number;
  title: string;
  created_at: Date;
  
  get user(): Promise<User> {
    return this.belongsTo(User);
  }
  
  static byUser(key: number) {
    return this.belongsTo(User, key);
  }
  
  get items(): Promise<TodoItem> {
    return this.hasMany(TodoItem);
  }
  
  normalizeCreatedAt(value: string): Date {
    return new Date(value);
  }
  
  denormalizeCreatedAt(value: Date): string {
    return value.toISOString();
  }
}

// Create new todo list
const todoList = new TodoList();
todoList.user_id = 1;
todoList.title = 'Daily routine';
todoList.save();

// Get user by todo list
const user = await todoList.user;

// Get items from todo list
const items = await todoList.items;

// List all todo lists by user
const lists = TodoList.byUser(1);

Tutorials

The tutorials are written in TypeScript.

Dependencies

  • axios for handling HTTP Requests.

Resources

Articles

Motivation

Premiere is inspired by Laravel (Eloquent) and Rails (Active Record).

Because of frameworks like these, building Restful APIs is a much smoother path.

The goal of Premiere is to provide the same facility and power that these libraries provide, just this time on the client side.

License

MIT

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].