Skip to content

Examples

Welcome to the Basefloor examples section. Here you'll find practical examples of how to use Basefloor in real-world scenarios.

💡 Running Examples

All examples are located in the example/api/ directory. Each example includes a complete working implementation with configuration files and detailed comments.

Core Feature Examples

01 - Quick Setup

Get started with the absolute minimum configuration. Perfect for understanding the basics.

02 - Authentication

JWT-based authentication with user registration, login, and protected routes.

03 - MongoDB Integration

Complete database integration with models, CRUD operations, and data relationships.

04 - File Management

File upload, storage, processing, and serving with multiple provider support.

05 - AI Integration

OpenAI, Anthropic, and Google AI integrations for chat and text generation.

06 - Email Services

Email notifications with multiple providers (SendGrid, Postmark, Mailgun).

07 - Audio Transcription

Speech-to-text conversion with Google Cloud Speech API integration.

08 - Document Processing

Document conversion and processing with LibreOffice integration.

09 - Express-based Features

Advanced Express.js features including middleware, streaming, and Server-Sent Events.

Configuration Examples

Basic Config

Standard configuration for most applications.

Authentication Config

Focused on authentication and user management features.

Documents Config

Configuration for document processing and file conversion.

Transcription Config

Configuration for audio transcription services.

Comprehensive Config

Full-featured configuration with all services enabled.

Documentation Examples

Basic Setup

Step-by-step guide to creating your first Basefloor project.

Complete Configuration

Detailed walkthrough of all configuration options.

Blog API Example

Complete blog API tutorial with users, posts, and comments.

Getting Started

  1. Choose an example that matches your use case
  2. Copy the configuration and modify for your needs
  3. Run the example to see it in action
  4. Explore the code to understand the implementation

Running an Example

bash
# Navigate to the example directory
cd example/api

# Install dependencies
npm install

# Copy environment variables
cp .env-example .env

# Run a specific example
node 01-quick-setup.js

Environment Setup

Most examples require environment variables. See the environment setup guide for required variables.

Real-World Applications

These examples demonstrate patterns used in production applications:

  • Microservices Architecture - Multiple focused APIs
  • Multi-tenant SaaS - User isolation and data segregation
  • E-commerce Platforms - Product catalogs and order processing
  • Content Management - File handling and user-generated content
  • AI-Powered Applications - Intelligent features and automation

Released under the MIT License.