Skip to content

rush-db/examples

Repository files navigation

RushDB Examples

RushDB Logo

The Instant Graph Database for Modern Apps

This repository contains comprehensive code samples and projects demonstrating quick integration with RushDB across various use cases and programming languages.

About RushDB

RushDB transforms how you work with graph data โ€” no schema required, no complex queries, just push your data and go. Built on top of Neo4j, RushDB provides:

  • ๐Ÿš€ Instant Setup: Be productive in seconds, not days
  • ๐Ÿ“ Push Any JSON: Nested objects are automatically normalized into a graph
  • ๐Ÿ”„ Fractal API: Same query syntax everywhere - learn once, use everywhere
  • ๐Ÿ” Vector Search: Comprehensive similarity search for AI-powered applications
  • โšก Zero Schema Headaches: We handle the data structure so you can focus on building

Key Links

Prerequisites

Before running any examples, you'll need to obtain a RushDB API token:

1. Get Your RushDB API Token

  1. Sign up for RushDB Cloud (Free tier available):

    • Visit app.rushdb.com
    • Create a new account or sign in with Google OAuth
    • Navigate to your workspace dashboard
  2. Create API Token:

    • Go to your workspace settings
    • Generate a new API token
    • Copy the token (format: rushdb_***)
  3. Set Environment Variable:

    export RUSHDB_API_TOKEN="your_token_here"

    Or create a .env file in your project:

    RUSHDB_API_TOKEN=your_token_here

2. Alternative: Self-Hosted Setup

If you prefer to self-host RushDB:

docker run -p 3000:3000 \
  --name rushdb \
  -e NEO4J_URL='neo4j+s://your-instance.neo4j.io' \
  -e NEO4J_USERNAME='neo4j' \
  -e NEO4J_PASSWORD='password' \
  rushdb/platform

Requirements for self-hosting:

  • Neo4j version 5.25.1 or higher
  • APOC Plugin (required)
  • Graph Data Science Plugin (for vector search)

Available Examples

Backend APIs

  • Express REST API | ๐Ÿ“ README

    Complete REST API built with Express and TypeScript showcasing RushDB SDK integration. Features hierarchical data modeling (Company โ†’ Department โ†’ Employee), CRUD operations, advanced aggregation queries, and comprehensive endpoint examples with Postman collection.

Frontend Applications

  • Next.js Dynamic Filters Demo | ๐Ÿ“ README

    Interactive Next.js application demonstrating dynamic UI components with RushDB integration. Features real-time filtering, search functionality, server-side pagination, data grid visualization, and debug tools for tracking RushDB operations.

  • Next.js CMS | ๐Ÿ“ README

    Content Management System built with Next.js and RushDB. Features page management, post creation, media handling, and administrative dashboard functionality.

  • Next.js Simple Waitlist | ๐Ÿ“ README

    Clean and responsive waitlist application built with Next.js and RushDB. Features email validation, duplicate prevention, RushDB integration for data storage.

  • Vite React Form | ๐Ÿ“ README

    Professional registration form built with Vite, React, and TypeScript using React Hook Form and Zod validation. Features comprehensive form validation, dynamic skill management, complex nested data structures, mock data filling, and seamless RushDB integration for data storage.

AI & RAG Applications

  • Simple Python RAG | ๐Ÿ“ README

    Minimal RAG (Retrieval-Augmented Generation) implementation using RushDB for vector storage. Features document ingestion, automatic chunking, vector embeddings with sentence transformers, semantic search, and FastAPI interface.

  • Generic Books RAG API | ๐Ÿ“ README

    Advanced RAG system for processing any text records in RushDB. Features generic record vectorization, embedding integration directly into existing records, vector similarity search, and scalable FastAPI architecture.

Data Import Utilities

  • Python CSV Import | ๐Ÿ“ README

    Simple utility for importing CSV data into RushDB. Demonstrates bulk data import functionality and basic RushDB Python SDK usage.

Technology Stack Coverage

Languages & Frameworks

  • Backend: TypeScript, JavaScript, Python
  • Frontend: Next.js, React, Vite
  • API: Express.js, FastAPI, REST APIs
  • Database: RushDB (Neo4j-based Graph Database)

Key Features Demonstrated

  • ๐Ÿ”„ CRUD Operations: Complete Create, Read, Update, Delete workflows
  • ๐Ÿ” Vector Search: AI-powered similarity search and embeddings
  • ๐Ÿค– RAG Systems: Retrieval-Augmented Generation implementations
  • ๐Ÿ“Š Data Import: Bulk data import and CSV processing
  • โšก Real-time Filtering: Dynamic UI components with live data
  • โœ… Form Validation: React Hook Form with Zod schema validation
  • ๐Ÿ“ Content Management: Full CMS with page and post management

Tools & Libraries

  • SDKs: @rushdb/javascript-sdk, rushdb-python
  • Testing: Postman Collections included
  • Package Management: npm, pnpm, UV Package Manager
  • Validation: React Hook Form, Zod
  • AI/ML: Sentence Transformers, Vector Embeddings
  • UI: Tailwind CSS, shadcn/ui components

Quick Start Example

Here's how simple it is to get started with RushDB:

TypeScript/JavaScript

import RushDB from "@rushdb/javascript-sdk";

const db = new RushDB(process.env.RUSHDB_API_TOKEN);

// Push nested JSON - auto-normalized into graph
await db.records.createMany({
  label: "COMPANY",
  payload: {
    name: "Tech Corp",
    DEPARTMENT: [
      {
        name: "Engineering",
        EMPLOYEE: [
          {
            name: "Alice Smith",
            role: "Senior Developer",
          },
        ],
      },
    ],
  },
});

// Query with relationship traversal
const developers = await db.records.find({
  labels: ["EMPLOYEE"],
  where: {
    role: { $contains: "Developer" },
    DEPARTMENT: { COMPANY: { name: "Tech Corp" } },
  },
});

Python

from rushdb import RushDB

db = RushDB(os.getenv("RUSHDB_API_TOKEN"))

# Same data structure, same simplicity
db.records.create_many("COMPANY", {
    "name": "Tech Corp",
    "DEPARTMENT": [{
        "name": "Engineering",
        "EMPLOYEE": [{
            "name": "Alice Smith",
            "role": "Senior Developer"
        }]
    }]
})

# Consistent query syntax across languages
developers = db.records.find({
    "labels": ["EMPLOYEE"],
    "where": {
        "role": {"$contains": "Developer"},
        "DEPARTMENT": {"COMPANY": {"name": "Tech Corp"}}
    }
})

Getting Started

Each example includes its own README with detailed setup instructions, API documentation, and usage examples. Most examples include:

  • ๐Ÿ“‹ Prerequisites: Required dependencies and environment setup
  • โš™๏ธ Environment Configuration: .env file templates and variable explanations
  • ๐Ÿ“ฆ Installation Instructions: Step-by-step dependency installation
  • ๐Ÿš€ Usage Guides: How to run and test the application
  • ๐Ÿ“– API Documentation: Endpoint descriptions and request/response examples
  • ๐Ÿ“ฎ Postman Collections: Ready-to-import API testing collections (where applicable)
  • ๐ŸŽฏ Sample Data: Test datasets and example records for immediate experimentation

Recommended Learning Path

  1. Start Simple: Begin with Python CSV Import to understand basic RushDB operations
  2. Build APIs: Explore Express REST API for comprehensive backend development
  3. Create UIs: Try Next.js Dynamic Filters for interactive frontend development
  4. Add AI: Implement Python RAG Systems for AI-powered applications
  5. Go Advanced: Build a complete CMS or complex forms

Common Setup Steps

  1. Clone the repository:

    git clone https://github.com/rush-db/examples.git
    cd examples
  2. Navigate to your chosen example:

    cd express-rushdb-sdk  # or any other example
  3. Follow the example-specific README for detailed setup instructions

Getting Help

Feel free to explore each example to see how RushDB can simplify data modeling, querying, and AI-powered applications for modern development.

About

Code samples and projects demonstrating quick RushDB integration across various use cases

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published