Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
Introduction to Basejump
Search
Sponsored
·
Your Podcast. Everywhere. Effortlessly.
Share. Educate. Inspire. Entertain. You do you. We'll handle the rest.
→
Ryan Paul
March 14, 2016
Programming
1.5k
1
Share
Introduction to Basejump
Build REST APIs on RethinkDB without writing code
Ryan Paul
March 14, 2016
More Decks by Ryan Paul
See All by Ryan Paul
Using Async Iterators in Node.js
segphault
0
1.1k
Realtime data visualization with RethinkDB and Epoch
segphault
1
790
Realtime web apps with RethinkDB and full-stack Ruby
segphault
2
350
Jupyter and RethinkDB
segphault
1
770
Using RethinkDB with Tornado & EventMachine
segphault
0
740
RethinkDB Training Course
segphault
3
480
RethinkDB Cluster Monitoring
segphault
0
820
Composing frontend Web applications with MontageJS
segphault
4
1.5k
Intro to MontageJS
segphault
1
230
Other Decks in Programming
See All in Programming
実践CRDT
tamadeveloper
0
590
CDK Deployのための ”反響定位”
watany
5
800
瑠璃の宝石に学ぶ技術の声の聴き方 / 【劇場版】アニメから得た学びを発表会2026 #エンジニアニメ
mazrean
0
270
書籍「ユーザーストーリーマッピング」が私のバイブル
asumikam
4
390
GitHubCopilotCLIをはじめよう.pdf
htkym
0
210
10 Tips of AWS ~Gen AI on AWS~
licux
5
430
JAWS-UG横浜 #100 祝・第100回スペシャルAWS は VPC レスの時代へ
maroon1st
0
160
mruby on C#: From VM Implementation to Game Scripting (RubyKaigi 2026)
hadashia
2
580
AWS re:Invent 2025の少し振り返り + DevOps AgentとBacklogを連携させてみた
satoshi256kbyte
3
170
Surviving Black Friday: 329 billion requests with Falcon!
ioquatix
0
730
Liberating Ruby's Parser from Lexer Hacks
ydah
2
1.9k
The Monolith Strikes Back: Why AI Agents ❤️ Rails Monoliths
serradura
0
340
Featured
See All Featured
Evolution of real-time – Irina Nazarova, EuRuKo, 2024
irinanazarova
9
1.3k
The Power of CSS Pseudo Elements
geoffreycrofte
82
6.2k
Mozcon NYC 2025: Stop Losing SEO Traffic
samtorres
0
210
Reflections from 52 weeks, 52 projects
jeffersonlam
356
21k
New Earth Scene 8
popppiees
3
2.1k
The Limits of Empathy - UXLibs8
cassininazir
1
310
Rails Girls Zürich Keynote
gr2m
96
14k
How Fast Is Fast Enough? [PerfNow 2025]
tammyeverts
3
540
16th Malabo Montpellier Forum Presentation
akademiya2063
PRO
0
110
How Software Deployment tools have changed in the past 20 years
geshan
0
33k
The AI Search Optimization Roadmap by Aleyda Solis
aleyda
1
5.7k
A designer walks into a library…
pauljervisheath
211
24k
Transcript
Basejump Build a REST API on RethinkDB
Ryan Paul RethinkDB Evangelist @segphault
API Anatomy Dissecting an API backend
API Anatomy • Server to parse & handle requests •
Routing to manage endpoints • Validation to sanitize user input • Persistence to store & retrieve data
API Anatomy RethinkDB NodeJS JOI Koa Vue Browser REST API
Koa Router W3C Fetch Real-world RethinkDB stack
API Anatomy Persistence Runtime Validation Server Frontend Framework Browser REST
API Router REST Client Real-world RethinkDB stack
API Anatomy • Lots of layers between persistence and requests
• More boilerplate than business logic • Repetitive code that is difficult to reuse
API Anatomy router.post("/api/event/:id/messages", function*(id) { this.checkBody("message").notEmpty(); if (this.errors) this.throw(400, {success:
false, errors: this.errors}); yield r.table("messages").insert({ created: r.now(), text: this.request.body.message, sender: sender, event: id}); this.body = {success: true}; });
Can we abstract away the boilerplate?
Project Basejump Attach queries to endpoints
Basejump • Visual tool for prototyping API backends • Dynamic
routing middleware for attaching queries to endpoints • Powered by declarative JSON description format
Basejump
{A} 1ST
Basejump Router • Database agnostic routing middleware • Uses Node’s
VM module to execute code • Integrates seamlessly with Koa and Socket.io • Swagger-based format to describe routes and actions
Swagger
Swagger • Standard format for describing APIs — can use
YAML or JSON • Uses JSON Schema for validation • Supported by many tools & frameworks • Extensible via vendor properties
Swagger paths: /test: get: parameters: - {in: query, name: count,
type: number} x-action: > r.table("test") .orderBy(r.desc("time")) .limit(params.count) post: parameters: - in: body name: body schema: $ref: "#/definitions/test" x-action: > r.table("test").insert(params.body)
Embed Basejump • Embed in your own Node app •
Pass custom objects into the execution context • Inherit and override the request handler • Custom pre & post processing on input and output
Embed Basejump const app = require("koa")(); const router = require("basejump-router");
const r = require("rethinkdbdash")(); app.use(require("kcors")()); app.use(require("koa-bodyparser")()); app.use(router.middleware.koa({ swagger: "routes.yaml", context: {r: r} })); app.listen(8000);
Project Basejump Status & Future Plans
Basejump • Not ready for adoption quite yet • API
and data format still subject to change • New features might necessitate additional format churn
Feature Roadmap • Support for embedding in Express • Interactive
Schema editing • Pluggable view system • Route collections and blueprints • Authentication and user management • Live API debugging
Feature Ideas • Generate client libraries for mobile & web
• Use schemas to generate input forms & data dashboard • Support for file uploads & multipart mime • Automatically generate tables and indexes from schemas
How does it compare to Fusion?
How does it compare to Fusion? Horizon?
Basejump vs Horizon • Basejump: backend-first development & REST APIs
• Horizon: frontend-first development & WebSockets
Basejump & Horizon • Embed Basejump and Horizon middleware in
the same Node app • Expose Basejump routes through Horizon custom endpoint • Converge authentication and schema validation?
• RethinkDB website: http://rethinkdb.com • Basejump Router: http://github.com/segphault/ basejump-router •
Follow me on Twitter: @segphault Resources