Eclipse
Boilit
BoilitBoilitBeta
Boilerplates

Boilerplate

Next.js with Multi-Database Setup (PostgreSQL)

A full-stack boilerplate using Next.js App Router (frontend) and Next.js API Routes (backend), featuring a multi-database PostgreSQL setup with Docker Compose. This example demonstrates how to configure multiple databases inside a single PostgreSQL container by setting the POSTGRES_MULTIPLE_DATABASES environment variable. It also includes React Query on the frontend for efficient data fetching and state synchronization.

Features

  • Next.js App Router for modern frontend development.
  • Next.js API Routes for backend logic and APIs.
  • PostgreSQL multi-database setup with Docker Compose:
    • Multiple databases created automatically at container startup.
    • Controlled via POSTGRES_MULTIPLE_DATABASES environment variable.
    • Example: POSTGRES_MULTIPLE_DATABASES=development,test.
  • React Query for API integration and caching.
  • Clean project structure for easy extension.
  • TypeScript support for type-safe development.

Technical Stack

  • Frontend: Next.js (App Router) + React Query
  • Backend: Next.js API Routes
  • Database: PostgreSQL (multi-database Docker Compose setup)
  • Containerization: Docker Compose
  • Language: TypeScript

Use Case

Perfect for developers who need separate development and test databases within the same PostgreSQL container. This boilerplate is ideal for local development environments, CI pipelines, or projects that require isolated database contexts without running multiple containers. Combined with Next.js and React Query, it provides a solid foundation for building scalable applications with clean separation of environments. 🚀

Boilerplate details

  • Last update


    2 days ago
  • Boilerplate age


    2 days ago
Login to download