PitchHut logo
Unified backend services for seamless development.
Pitch

Syntra offers a self-hosted Backend-as-a-Service platform that simplifies development with a unified API. It encompasses authentication, databases, storage, and serverless functions, all seamlessly integrated. Built on cutting-edge technology like Bun and Postgres, Syntra enhances productivity while ensuring flexibility and control.

Description

Syntra is a self-hosted Backend-as-a-Service (BaaS) platform that provides a comprehensive suite of features including authentication, database management, storage, real-time capabilities, serverless functions, AI integration, and scheduled jobs, all accessible through a single unified API.

Key Features

  • Full-Stack Architecture: Built on a modern stack that includes Bun for runtime, Hono for the HTTP framework, PostgreSQL for database management, and Deno for serverless functions.
  • Real-Time Communication: Utilizes Bun WebSockets and PostgreSQL LISTEN/NOTIFY for instant updates and notifications.
  • Robust Authentication: Incorporates JWT for secure authentication and Argon2 for password hashing, ensuring secure access to resources.
  • AI Integration: Leverages OpenRouter for AI functionalities such as chat completions and image generation.
  • Versatile Storage Options: Offers both local filesystem storage and integration with AWS S3 and CloudFront for scalable object storage capabilities.

Project Structure

The project structure is organized into key directories, making it easy to navigate:

syntra/
├── packages/
│   ├── backend/            # Main API server (Bun + Hono)
│   └── shared/             # Shared types, Zod schemas, constants
├── functions/              # Deno serverless functions runtime
├── deploy/
│   └── docker-init/db/     # PostgreSQL init scripts
├── docker-compose.yml      # PostgreSQL + Syntra + Deno
└── .env.example

API Reference

Syntra provides a robust set of APIs categorized into various modules for ease of use:

  • Authentication: Manage user sessions, profiles, and OAuth providers.
  • Database Management: Create and manage tables, query records, and execute stored functions.
  • Storage Management: Create buckets, upload and download objects, and manage signed URLs for secure access.
  • Real-Time Capabilities: Create and manage channels for real-time communication and messaging.
  • AI Functionalities: Interact with AI models for various use cases, including chat and embeddings.
  • Scheduled Tasks: Manage jobs and their execution logs for automated tasks.

Installation Prerequisites

Before getting started, ensure that the following dependencies are installed:

  • Bun: A modern JavaScript runtime.
  • Docker and Docker Compose: For managing containerized services, especially PostgreSQL.
  • PostgreSQL: Required only if not utilizing Docker for database management.

Security

Syntra emphasizes security with features including:

  • Password storage using Argon2 for strong protection against breaches.
  • Encrypted secrets stored using AES-256-GCM.
  • Implementation of row-level security policies to protect user data.
  • Parameterized queries to prevent SQL injection attacks.

Conclusion

Syntra serves as a powerful solution for developers seeking a flexible, secure, and scalable backend service. Ideal for projects requiring real-time data handling, comprehensive authentication, and AI-driven capabilities, Syntra streamlines the backend process, allowing developers to focus on building engaging front-end experiences.

0 comments

No comments yet.

Sign in to be the first to comment.