rapidjs / Rapid.js
An ORM-like Interface and a Router For Your API Requests
Stars: ✭ 700
Programming Languages
Projects that are alternatives of or similar to Rapid.js
Elasticsearch
The missing elasticsearch ORM for Laravel, Lumen and Native php applications
Stars: ✭ 375 (-46.43%)
Mutual labels: orm, laravel, model
Flowa
🔥Service level control flow for Node.js
Stars: ✭ 66 (-90.57%)
Mutual labels: api, promise, router
Laravel Orion
The simplest way to create REST API with Laravel
Stars: ✭ 481 (-31.29%)
Mutual labels: api, laravel
Cms
Decoupled CMS for any Laravel app, gain control of: pages, blogs, galleries, events, images, custom modules and more.
Stars: ✭ 498 (-28.86%)
Mutual labels: api, laravel
Atomic
A tiny, Promise-based vanilla JS Ajax/HTTP plugin with great browser support.
Stars: ✭ 526 (-24.86%)
Mutual labels: promise, ajax
Laravel Blade Javascript
A Blade directive to export variables to JavaScript
Stars: ✭ 485 (-30.71%)
Mutual labels: api, laravel
V8 Archive
Directus Database API — Wraps Custom SQL Databases with a REST/GraphQL API
Stars: ✭ 486 (-30.57%)
Mutual labels: api, api-wrapper
Laravel Model Status
Easily add statuses to your models
Stars: ✭ 510 (-27.14%)
Mutual labels: laravel, model
Larapi
An API-friendly fork of Laravel. Authentication, error handling, resource filtering, sorting, pagination and much more included
Stars: ✭ 397 (-43.29%)
Mutual labels: api, laravel
Befriended
Eloquent Befriended brings social media-like features like following, blocking and filtering content based on following or blocked models.
Stars: ✭ 596 (-14.86%)
Mutual labels: laravel, model
Python Poloniex
Poloniex API wrapper for Python 2.7 & 3
Stars: ✭ 557 (-20.43%)
Mutual labels: api, api-wrapper
Youtube
🔥 Laravel PHP Facade/Wrapper for the Youtube Data API
Stars: ✭ 610 (-12.86%)
Mutual labels: api, laravel
Gearbox
Gearbox ⚙️ is a web framework written in Go with a focus on high performance
Stars: ✭ 455 (-35%)
Mutual labels: api, router
Iris
The fastest HTTP/2 Go Web Framework. AWS Lambda, gRPC, MVC, Unique Router, Websockets, Sessions, Test suite, Dependency Injection and more. A true successor of expressjs and laravel | 谢谢 https://github.com/kataras/iris/issues/1329 |
Stars: ✭ 21,587 (+2983.86%)
Mutual labels: laravel, router
Laravel Api Response Builder
Builds nice, normalized and easy to consume Laravel REST API JSON responses.
Stars: ✭ 433 (-38.14%)
Mutual labels: api, laravel
Laravel Mongodb
A MongoDB based Eloquent model and Query builder for Laravel (Moloquent)
Stars: ✭ 5,860 (+737.14%)
Mutual labels: orm, laravel
Polr
🚡 A modern, powerful, and robust URL shortener
Stars: ✭ 4,147 (+492.43%)
Mutual labels: api, laravel
Diet
A tiny, fast and modular node.js web framework. Good for making fast & scalable apps and apis.
Stars: ✭ 394 (-43.71%)
Mutual labels: api, router
An ORM-like Interface and a Router For Your API Requests
Create simple, reusable, and cleaner wrappers, define custom routes, and more for your API requests.
Read the official docs at https://rapidjs.io.
Installation
Pick your poison:
yarn add rapid.js
npm i -S rapid.js
npm install --save rapid.js
Overview
- Define Simple Models
- Easily Customize Your API Requests
- Create Reusable Base Models
- Write API Wrappers For Your Endpoints
- Define Custom Routes (New!)
Define Simple Models
const post = new Rapid({ modelName: 'Post' });
post.find(1).then((response) => {
// GET => /api/post/1
});
post.collection.findBy('category', 'featured').then((response) => {
// GET => /api/posts/category/featured
});
post.withParams({ limit: 20, order: 'desc' }).all().then((response) => {
// GET => /api/posts?limit=20&order=desc
});
post.update(25, { title: 'Rapid JS Is Awesome!' })
// POST => /api/posts/25/update
post.destroy(9)
// POST => /api/posts/9/destroy
post.restore(9)
// POST => /api/posts/9/restore
Read more about Rapid Basics.
Easily Customize Your API Requests
const post = new Rapid({
modelName: 'Post',
suffixes: {
destroy: '',
update: 'save'
},
methods: {
destroy: 'delete'
},
trailingSlash: true
});
post.update(25, { title: 'Rapid JS Is Awesome!' })
// POST => /api/posts/25/save/
post.destroy(9)
// DELETE => /api/posts/9/
Read more about Customizing Your Requests.
Create Reusable Base Models
class Base extends Rapid {
boot () {
this.baseURL = 'https://myapp.com/api';
this.config.globalParameters = { key: 'MY_API_KEY' }
}
}
const photo = new Base({ modelName: 'Photo' });
const gallery = new Base({ modelName: 'Gallery' });
const tag = new Base({ modelName: 'Tag' });
photo.find(1)
// GET => https://myapp.com/api/photo/1?key=MY_API_KEY
tag.collection.findBy('color', 'red')
// GET => https://myapp.com/api/tags/color/red?key=MY_API_KEY
gallery.id(23).get('tags', 'nature')
// GET => https://myapp.com/api/gallery/23/tag/nature?key=MY_API_KEY
Read more about Base Models.
Write API Wrappers For Your Endpoints
class GalleryWrapper extends Rapid {
boot () {
this.baseURL = 'https://myapp.com/gallery/api';
this.modelName = 'Gallery';
}
tagSearch (query) {
return this.url('tagsearch').withParam('query', query);
}
json () {
return this.url('json');
}
}
const gallery = new GalleryWrapper({
globalParameters: { key: 'MY_API_KEY' }
});
gallery.tagSearch('nature').json().get().then(...);
// GET https://myapp.com/gallery/api/tagsearch/json?query=nature&key=MY_API_KEY
// GET https://myapp.com/gallery/api/tagsearch/json?query=nature&key=MY_API_KEY
Read more about Making a Wrapper.
Define Custom Routes
const customRoutes = [
{
name: 'web_get_user_preferences',
type: 'get',
url: '/user/preferences',
},
{
name: 'web_save_user_preferences',
type: 'post',
url: '/user/{id}/save/preferences'
}
];
const router = new Rapid({ customRoutes, baseURL: '/api' });
router.route('web_get_user_preferences').then((response) => {});
// GET => /api/user/preferences
router.route('web_save_user_preferences', { id: 12 }, /* { request data } */).then((response) => {});
// POST => /api/user/12/save/preferences
Using Your Own HTTP Service
import http from 'some-http-service';
const customRoutes = [
{
name: 'web_login',
url: '/login'
},
{
name: 'api_save_user_preferences',,
url: '/user/{id}/save/preferences'
}
];
const rapid = new Rapid({ customRoutes, baseURL: '' });
rapid.generate('web_login')
// returns '/login'
// use your own service
http.post(rapid.generate('api_save_user_preferences', { id: 1 }), { data }).then()...
Read more about Custom Routes.
Read the official docs at https://rapidjs.io.
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].