Merge pull request #6 from johndoe6345789/copilot/fix-postgresql-database-creation

Fix PostgreSQL database creation error in Dockerfile and add database management roadmap with multi-database support
This commit is contained in:
2026-01-08 02:17:22 +00:00
committed by GitHub
3 changed files with 610 additions and 626 deletions

View File

@@ -12,7 +12,7 @@ RUN apt-get update && apt-get install -y \
USER postgres
RUN /etc/init.d/postgresql start && \
psql --command "CREATE USER docker WITH SUPERUSER PASSWORD 'docker';" && \
createdb -O docker postgres
psql --command "ALTER DATABASE postgres OWNER TO docker;"
# Switch back to root
USER root

848
README.md
View File

@@ -1,686 +1,284 @@
# Boilerplate and Starter for Next.js 16+, Tailwind CSS 4, and TypeScript.
# Next.js Application with Multi-Database Support
<p align="center">
<a href="https://demo.nextjs-boilerplate.com">
<img
src="public/assets/images/nextjs-starter-banner.png?raw=true"
alt="Next js starter banner"
style="max-width: 100%; height: auto;"
/>
</a>
</p>
A production-ready Next.js 16 application with database management capabilities, built with TypeScript, Tailwind CSS, and DrizzleORM for connecting to multiple database backends.
🚀 Boilerplate and Starter for Next.js with App Router, Tailwind CSS, and TypeScript ⚡️ Prioritizing developer experience first: Next.js, TypeScript, ESLint, Prettier, Lefthook (replacing Husky), Lint-Staged, Vitest (replacing Jest), Testing Library, Playwright, Commitlint, VSCode, Tailwind CSS, Authentication with [Clerk](https://clerk.com?utm_source=github&utm_medium=sponsorship&utm_campaign=nextjs-boilerplate), Database with DrizzleORM (PostgreSQL, SQLite, and MySQL), Local database with PGlite and production with Neon (PostgreSQL), Error Monitoring with [Sentry](https://sentry.io/for/nextjs/?utm_source=github&utm_medium=paid-community&utm_campaign=general-fy25q1-nextjs&utm_content=github-banner-nextjsboilerplate-logo), Logging with LogTape (replacing Pino.js) and Log Management, Monitoring as Code, Storybook, Multi-language (i18n), AI-powered code reviews with CodeRabbit, Secure with [Arcjet](https://launch.arcjet.com/Q6eLbRE) (Bot detection, Rate limiting, Attack protection, etc.), and more.
## Overview
Clone this project and use it to create your own Next.js project. You can check out the live demo at [Next.js Boilerplate](https://demo.nextjs-boilerplate.com), which includes a working authentication system.
This project is a full-stack web application featuring:
- **Next.js 16** with App Router for server-side rendering and static site generation
- **DrizzleORM** for type-safe database operations with support for PostgreSQL, MySQL, and SQLite
- **PostgreSQL 15** included as default database in Docker container
- **Multi-database support** - Connect to external PostgreSQL, MySQL, or SQLite servers
- **Authentication** using Clerk with support for multiple auth providers
- **TypeScript** for type safety across the entire stack
- **Tailwind CSS 4** for modern, responsive styling
- **Docker** support for easy deployment
- **Comprehensive testing** with Vitest, Playwright, and Storybook
## Sponsors
## Features
<table width="100%">
<tr height="187px">
<td align="center" width="33%">
<a href="https://clerk.com?utm_source=github&utm_medium=sponsorship&utm_campaign=nextjs-boilerplate">
<picture>
<source media="(prefers-color-scheme: dark)" srcset="https://github.com/ixartz/SaaS-Boilerplate/assets/1328388/6fb61971-3bf1-4580-98a0-10bd3f1040a2">
<source media="(prefers-color-scheme: light)" srcset="https://github.com/ixartz/SaaS-Boilerplate/assets/1328388/f80a8bb5-66da-4772-ad36-5fabc5b02c60">
<img alt="Clerk Authentication & User Management for Next.js" src="https://github.com/ixartz/SaaS-Boilerplate/assets/1328388/f80a8bb5-66da-4772-ad36-5fabc5b02c60">
</picture>
</a>
</td>
<td align="center" width="33%">
<a href="https://www.coderabbit.ai?utm_source=next_js_starter&utm_medium=github&utm_campaign=next_js_starter_oss_2025">
<picture>
<source media="(prefers-color-scheme: dark)" srcset="public/assets/images/coderabbit-logo-dark.svg?raw=true">
<source media="(prefers-color-scheme: light)" srcset="public/assets/images/coderabbit-logo-light.svg?raw=true">
<img alt="CodeRabbit" src="public/assets/images/coderabbit-logo-light.svg?raw=true">
</picture>
</a>
</td>
<td align="center" width="33%">
<a href="https://sentry.io/for/nextjs/?utm_source=github&utm_medium=paid-community&utm_campaign=general-fy25q1-nextjs&utm_content=github-banner-nextjsboilerplate-logo">
<picture>
<source media="(prefers-color-scheme: dark)" srcset="public/assets/images/sentry-white.png?raw=true">
<source media="(prefers-color-scheme: light)" srcset="public/assets/images/sentry-dark.png?raw=true">
<img alt="Sentry" src="public/assets/images/sentry-dark.png?raw=true">
</picture>
</a>
<a href="https://about.codecov.io/codecov-free-trial/?utm_source=github&utm_medium=paid-community&utm_campaign=general-fy25q1-nextjs&utm_content=github-banner-nextjsboilerplate-logo">
<picture>
<source media="(prefers-color-scheme: dark)" srcset="public/assets/images/codecov-white.svg?raw=true">
<source media="(prefers-color-scheme: light)" srcset="public/assets/images/codecov-dark.svg?raw=true">
<img alt="Codecov" src="public/assets/images/codecov-dark.svg?raw=true">
</picture>
</a>
</td>
</tr>
<tr height="187px">
<td align="center" width="33%">
<a href="https://launch.arcjet.com/Q6eLbRE">
<picture>
<source media="(prefers-color-scheme: dark)" srcset="public/assets/images/arcjet-dark.svg?raw=true">
<source media="(prefers-color-scheme: light)" srcset="public/assets/images/arcjet-light.svg?raw=true">
<img alt="Arcjet" src="public/assets/images/arcjet-light.svg?raw=true">
</picture>
</a>
</td>
<td align="center" width="33%">
<a href="https://sevalla.com/">
<picture>
<source media="(prefers-color-scheme: dark)" srcset="public/assets/images/sevalla-dark.png">
<source media="(prefers-color-scheme: light)" srcset="public/assets/images/sevalla-light.png">
<img alt="Sevalla" src="public/assets/images/sevalla-light.png">
</picture>
</a>
</td>
<td align="center" width="33%">
<a href="https://l.crowdin.com/next-js">
<picture>
<source media="(prefers-color-scheme: dark)" srcset="public/assets/images/crowdin-white.png?raw=true">
<source media="(prefers-color-scheme: light)" srcset="public/assets/images/crowdin-dark.png?raw=true">
<img alt="Crowdin" src="public/assets/images/crowdin-dark.png?raw=true">
</picture>
</a>
</td>
</tr>
<tr height="187px">
<td align="center" width="33%">
<a href="https://betterstack.com/?utm_source=github&utm_medium=sponsorship&utm_campaign=next-js-boilerplate">
<picture>
<source media="(prefers-color-scheme: dark)" srcset="public/assets/images/better-stack-white.png?raw=true">
<source media="(prefers-color-scheme: light)" srcset="public/assets/images/better-stack-dark.png?raw=true">
<img alt="Better Stack" src="public/assets/images/better-stack-dark.png?raw=true">
</picture>
</a>
</td>
<td align="center" width="33%">
<a href="https://posthog.com/?utm_source=github&utm_medium=sponsorship&utm_campaign=next-js-boilerplate">
<picture>
<source media="(prefers-color-scheme: dark)" srcset="https://posthog.com/brand/posthog-logo-white.svg">
<source media="(prefers-color-scheme: light)" srcset="https://posthog.com/brand/posthog-logo.svg">
<img alt="PostHog" src="https://posthog.com/brand/posthog-logo.svg">
</picture>
</a>
</td>
<td align="center" width="33%">
<a href="https://www.checklyhq.com/?utm_source=github&utm_medium=sponsorship&utm_campaign=next-js-boilerplate">
<picture>
<source media="(prefers-color-scheme: dark)" srcset="public/assets/images/checkly-logo-dark.png?raw=true">
<source media="(prefers-color-scheme: light)" srcset="public/assets/images/checkly-logo-light.png?raw=true">
<img alt="Checkly" src="public/assets/images/checkly-logo-light.png?raw=true">
</picture>
</a>
</td>
</tr>
<tr height="187px">
<td align="center" style=width="33%">
<a href="https://nextjs-boilerplate.com/pro-saas-starter-kit">
<img src="public/assets/images/nextjs-boilerplate-saas.png?raw=true" alt="Next.js SaaS Boilerplate with React" />
</a>
</td>
<td align="center" width="33%">
<a href="mailto:contact@creativedesignsguru.com">
Add your logo here
</a>
</td>
</tr>
</table>
-**Next.js 16** with App Router support
- 🔥 **TypeScript** for type safety
- 💎 **Tailwind CSS 4** for styling
- 🔒 **Clerk Authentication** with social login support
- 📦 **DrizzleORM** - Support for PostgreSQL, MySQL, and SQLite
- 🔌 **Multi-Database Support** - Connect to custom database servers
- 🐳 **Docker** with included PostgreSQL 15 (default option)
- 🧪 **Testing Suite** - Vitest for unit tests, Playwright for E2E
- 🎨 **Storybook** for UI component development
- 📏 **ESLint & Prettier** for code quality
- 🔍 **TypeScript strict mode**
- 🌐 **Multi-language (i18n)** support with next-intl
- 🚨 **Error Monitoring** with Sentry
- 🔐 **Security** with Arcjet (bot detection, rate limiting)
### Demo
## Quick Start
**Live demo: [Next.js Boilerplate](https://demo.nextjs-boilerplate.com)**
### Prerequisites
- Node.js 20+ and npm
- Docker (optional, for containerized deployment)
| Sign Up | Sign In |
| --- | --- |
| [![Next.js Boilerplate SaaS Sign Up](public/assets/images/nextjs-boilerplate-sign-in.png)](https://demo.nextjs-boilerplate.com/sign-up) | [![Next.js Boilerplate SaaS Sign In](public/assets/images/nextjs-boilerplate-sign-in.png)](https://demo.nextjs-boilerplate.com/sign-in) |
### Local Development
### Features
1. Clone the repository:
```bash
git clone https://github.com/johndoe6345789/postgres.git
cd postgres
```
Developer experience first, extremely flexible code structure and only keep what you need:
- ⚡ [Next.js](https://nextjs.org) with App Router support
- 🔥 Type checking [TypeScript](https://www.typescriptlang.org)
- 💎 Integrate with [Tailwind CSS](https://tailwindcss.com)
- ✅ Strict Mode for TypeScript and React 19
- 🔒 Authentication with [Clerk](https://clerk.com?utm_source=github&utm_medium=sponsorship&utm_campaign=nextjs-boilerplate): Sign up, Sign in, Sign out, Forgot password, Reset password, and more.
- 👤 Passwordless Authentication with Magic Links, Multi-Factor Auth (MFA), Social Auth (Google, Facebook, Twitter, GitHub, Apple, and more), Passwordless login with Passkeys, User Impersonation
- 📦 Type-safe ORM with DrizzleORM, compatible with PostgreSQL, SQLite, and MySQL
- 💽 Offline and local development database with PGlite
- ☁️ Remote and production database with Neon (PostgreSQL)
- 🌐 Multi-language (i18n) with next-intl and [Crowdin](https://l.crowdin.com/next-js)
- ♻️ Type-safe environment variables with T3 Env
- ⌨️ Form handling with React Hook Form
- 🔴 Validation library with Zod
- 📏 Linter with [ESLint](https://eslint.org) (default Next.js, Next.js Core Web Vitals, Tailwind CSS and Antfu configuration)
- 💖 Code Formatter with Prettier
- 🦊 Husky for Git Hooks (replaced by Lefthook)
- 🚫 Lint-staged for running linters on Git staged files
- 🚓 Lint git commit with Commitlint
- 📓 Write standard compliant commit messages with Commitizen
- 🔍 Unused files and dependencies detection with Knip
- 🌍 I18n validation and missing translation detection with i18n-check
- 🦺 Unit Testing with Vitest and Browser mode (replacing React Testing Library)
- 🧪 Integration and E2E Testing with Playwright
- 👷 Run tests on pull request with GitHub Actions
- 🎉 Storybook for UI development
- 🐰 AI-powered code reviews with [CodeRabbit](https://www.coderabbit.ai?utm_source=next_js_starter&utm_medium=github&utm_campaign=next_js_starter_oss_2025)
- 🚨 Error Monitoring with [Sentry](https://sentry.io/for/nextjs/?utm_source=github&utm_medium=paid-community&utm_campaign=general-fy25q1-nextjs&utm_content=github-banner-nextjsboilerplate-logo)
- 🔍 Local development error monitoring with Sentry Spotlight
- ☂️ Code coverage with [Codecov](https://about.codecov.io/codecov-free-trial/?utm_source=github&utm_medium=paid-community&utm_campaign=general-fy25q1-nextjs&utm_content=github-banner-nextjsboilerplate-logo)
- 📝 Logging with LogTape and Log Management with [Better Stack](https://betterstack.com/?utm_source=github&utm_medium=sponsorship&utm_campaign=next-js-boilerplate)
- 🖥️ Monitoring as Code with [Checkly](https://www.checklyhq.com/?utm_source=github&utm_medium=sponsorship&utm_campaign=next-js-boilerplate)
- 🔐 Security and bot protection ([Arcjet](https://launch.arcjet.com/Q6eLbRE))
- 📊 Analytics with PostHog
- 🎁 Automatic changelog generation with Semantic Release
- 🔍 Visual regression testing
- 💡 Absolute Imports using `@` prefix
- 🗂 VSCode configuration: Debug, Settings, Tasks and Extensions
- 🤖 SEO metadata, JSON-LD and Open Graph tags
- 🗺️ Sitemap.xml and robots.txt
- 👷 Automatic dependency updates with Dependabot
- ⌘ Database exploration with Drizzle Studio and CLI migration tool with Drizzle Kit
- ⚙️ Bundler Analyzer
- 🌈 Include a FREE minimalist theme
- 💯 Maximize lighthouse score
Built-in features from Next.js:
- ☕ Minify HTML & CSS
- 💨 Live reload
- ✅ Cache busting
Optional features (easy to add):
- 🔑 Multi-tenancy, Role-based access control (RBAC)
- 🔐 OAuth for Single Sign-On (SSO), Enterprise SSO, SAML, OpenID Connect (OIDC), EASIE
- 🔗 Web 3 (Base, MetaMask, Coinbase Wallet, OKX Wallet)
### Philosophy
- Nothing is hidden from you, allowing you to make any necessary adjustments to suit your requirements and preferences.
- Dependencies are regularly updated on a monthly basis
- Start for free without upfront costs
- Easy to customize
- Minimal code
- Unstyled template
- SEO-friendly
- 🚀 Production-ready
### Requirements
- Node.js 22+ and npm
### Getting started
Run the following command on your local environment:
```shell
git clone --depth=1 https://github.com/ixartz/Next-js-Boilerplate.git my-project-name
cd my-project-name
2. Install dependencies:
```bash
npm install
```
For your information, all dependencies are updated every month.
3. Set up environment variables:
Create a `.env.local` file:
```env
# Database
DATABASE_URL=postgresql://docker:docker@localhost:5432/postgres
Then, you can run the project locally in development mode with live reload by executing:
# Clerk Authentication
NEXT_PUBLIC_CLERK_PUBLISHABLE_KEY=your_key
CLERK_SECRET_KEY=your_secret
```shell
# Optional: Admin user creation
CREATE_ADMIN_USER=true
ADMIN_USERNAME=admin
ADMIN_PASSWORD=admin123
```
4. Run the development server:
```bash
npm run dev
```
Open http://localhost:3000 with your favorite browser to see your project. For your information, the project is already pre-configured with a database.
5. Open http://localhost:3000 in your browser.
> [!WARNING]
> Next.js Boilerplate ships with a fully working Postgres database for your local environment. This database is **temporary** and will expire after **72 hours** if you don't claim it.
>
> Once expired, the project won't be able to connect to the database, and it'll throw connection errors.
>
> To avoid the connection errors and make the database **persistent**, run `npm run neon:claim`. After claiming it, the database becomes persistent and suitable for production use as well.
### Docker Deployment
> [!CAUTION]
> The authentication system requires environment variables to be set up. Please refer to the [Set up authentication](#set-up-authentication) section.
The Docker container includes PostgreSQL 15 as the default database option. You can also connect to external database servers.
Need advanced features? Multi-tenancy & Teams, Roles & Permissions, Shadcn UI, End-to-End Typesafety with oRPC, Stripe Payment, Light / Dark mode. Try [Next.js Boilerplate Pro](https://nextjs-boilerplate.com/pro-saas-starter-kit).
Build and run with included PostgreSQL:
### Set up authentication
To get started, you will need to create a Clerk account at [Clerk.com](https://clerk.com?utm_source=github&utm_medium=sponsorship&utm_campaign=nextjs-boilerplate) and create a new application in the Clerk Dashboard. Once you have done that, copy the `NEXT_PUBLIC_CLERK_PUBLISHABLE_KEY` and `CLERK_SECRET_KEY` values and add them to the `.env.local` file (not tracked by Git):
```shell
NEXT_PUBLIC_CLERK_PUBLISHABLE_KEY=your_clerk_pub_key
CLERK_SECRET_KEY=your_clerk_secret_key
```bash
docker build -t postgres-app .
docker run -p 3000:3000 -p 5432:5432 \
-e JWT_SECRET=your_secret_here \
postgres-app
```
Now you have a fully functional authentication system with Next.js, including features such as sign up, sign in, sign out, forgot password, reset password, update profile, update password, update email, delete account, and more.
Or connect to an external database:
### Set up remote database
The project uses DrizzleORM, a type-safe ORM that is compatible with PostgreSQL, SQLite, and MySQL databases. By default, the project is configured to seamlessly work with PostgreSQL, and you have the flexibility to choose any PostgreSQL database provider of your choice.
When you launch the project locally for the first time, it automatically creates a temporary PostgreSQL database. This allows you to work with a PostgreSQL database without Docker or any additional setup.
This temporary database will **expire after 72 hours** if you don't claim it. To avoid connection errors and **make the database persistent**, simply run the following command:
```shell
npm run neon:claim
```bash
docker run -p 3000:3000 \
-e DATABASE_URL="postgresql://username:password@your-external-db:5432/mydb" \
-e JWT_SECRET=your_secret_here \
postgres-app
```
Then, follow the instructions provided in the terminal to complete the claiming process.
The Docker container includes both PostgreSQL and the Next.js application, but PostgreSQL is optional - you can connect to any external PostgreSQL, MySQL, or SQLite database.
Once claimed, the database is suitable for production use. You can create separate database branches for development, staging, and production environments to keep data isolated.
## Project Structure
#### Create a fresh and empty database
If you want to create a fresh and empty database, you just need to remove the following environment variables: `DATABASE_URL`, `DATABASE_URL_DIRECT` and `PUBLIC_INSTAGRES_CLAIM_URL` from the `.env.local` file.
Then, run the following command to create a new temporary database:
```shell
npm run dev
```
├── src/
│ ├── app/ # Next.js App Router pages
│ ├── components/ # React components
│ ├── models/ # Database models (DrizzleORM schemas)
│ ├── utils/ # Utility functions
│ ├── libs/ # Third-party library configurations
│ └── locales/ # i18n translations
├── tests/
│ ├── integration/ # Integration tests
│ └── e2e/ # End-to-end tests
├── migrations/ # Database migrations
├── public/ # Static assets
├── Dockerfile # Docker configuration
└── docker-compose.yml # Docker Compose setup
```
After the database is created, the connection strings will be automatically added to your `.env.local` file. And, don't forget to claim the database with `npm run neon:claim`.
## Available Scripts
### Translation (i18n) setup
### Development
- `npm run dev` - Start development server with live reload
- `npm run build` - Build production bundle
- `npm run start` - Start production server
- `npm run build-local` - Build with local database
For translation, the project uses `next-intl` combined with [Crowdin](https://l.crowdin.com/next-js). As a developer, you only need to take care of the English (or another default language) version. Translations for other languages are automatically generated and handled by Crowdin. You can use Crowdin to collaborate with your translation team or translate the messages yourself with the help of machine translation.
To set up translation (i18n), create an account at [Crowdin.com](https://l.crowdin.com/next-js) and create a new project. In the newly created project, you will be able to find the project ID. You will also need to create a new Personal Access Token by going to Account Settings > API. Then, in your GitHub Actions, you need to define the following environment variables: `CROWDIN_PROJECT_ID` and `CROWDIN_PERSONAL_TOKEN`.
After defining the environment variables in your GitHub Actions, your localization files will be synchronized with Crowdin every time you push a new commit to the `main` branch.
### Project structure
```shell
.
├── README.md # README file
├── .github # GitHub folder
│ ├── actions # Reusable actions
│ └── workflows # GitHub Actions workflows
├── .storybook # Storybook folder
├── .vscode # VSCode configuration
├── migrations # Database migrations
├── public # Public assets folder
├── src
│ ├── app # Next JS App (App Router)
│ ├── components # React components
│ ├── libs # 3rd party libraries configuration
│ ├── locales # Locales folder (i18n messages)
│ ├── models # Database models
│ ├── styles # Styles folder
│ ├── templates # Templates folder
│ ├── types # Type definitions
│ ├── utils # Utilities folder
│ └── validations # Validation schemas
├── tests
│ ├── e2e # E2E tests, also includes Monitoring as Code
│ └── integration # Integration tests
├── next.config.ts # Next JS configuration
└── tsconfig.json # TypeScript configuration
```
### Customization
You can easily configure Next js Boilerplate by searching the entire project for `FIXME:` to make quick customizations. Here are some of the most important files to customize:
- `public/apple-touch-icon.png`, `public/favicon.ico`, `public/favicon-16x16.png` and `public/favicon-32x32.png`: your website favicon
- `src/utils/AppConfig.ts`: configuration file
- `src/templates/BaseTemplate.tsx`: default theme
- `next.config.ts`: Next.js configuration
- `.env`: default environment variables
You have full access to the source code for further customization. The provided code is just an example to help you start your project. The sky's the limit 🚀.
### Change database schema
To modify the database schema in the project, you can update the schema file located at `./src/models/Schema.ts`. This file defines the structure of your database tables using the Drizzle ORM library.
After making changes to the schema, generate a migration by running the following command:
```shell
npm run db:generate
```
This will create a migration file that reflects your schema changes.
After making sure your database is running, you can apply the generated migration using:
```shell
npm run db:migrate
```
There is no need to restart the Next.js server for the changes to take effect.
### Commit Message Format
The project follows the [Conventional Commits](https://www.conventionalcommits.org/) specification, meaning all commit messages must be formatted accordingly. To help you write commit messages, the project provides an interactive CLI that guides you through the commit process. To use it, run the following command:
```shell
npm run commit
```
One of the benefits of using Conventional Commits is the ability to automatically generate GitHub releases. It also allows us to automatically determine the next version number based on the types of commits that are included in a release.
### CodeRabbit AI Code Reviews
The project uses [CodeRabbit](https://www.coderabbit.ai?utm_source=next_js_starter&utm_medium=github&utm_campaign=next_js_starter_oss_2025), an AI-powered code reviewer. CodeRabbit monitors your repository and automatically provides intelligent code reviews on all new pull requests using its powerful AI engine.
Setting up CodeRabbit is simple, visit [coderabbit.ai](https://www.coderabbit.ai?utm_source=next_js_starter&utm_medium=github&utm_campaign=next_js_starter_oss_2025), sign in with your GitHub account, and add your repository from the dashboard. That's it!
### Database
- `npm run db:generate` - Generate database migrations
- `npm run db:migrate` - Apply database migrations
- `npm run db:studio` - Open Drizzle Studio (database GUI)
- `npm run db:seed-admin` - Seed admin user
### Testing
- `npm run test` - Run unit tests
- `npm run test:e2e` - Run end-to-end tests
- `npm run storybook` - Start Storybook for component development
All unit tests are located alongside the source code in the same directory, making them easier to find. The unit test files follow this format: `*.test.ts` or `*.test.tsx`. The project uses Vitest and React Testing Library for unit testing. You can run the tests with the following command:
### Code Quality
- `npm run lint` - Run ESLint
- `npm run lint:fix` - Fix linting issues automatically
- `npm run check:types` - Type check with TypeScript
- `npm run check:deps` - Check for unused dependencies
- `npm run check:i18n` - Validate translations
```shell
### Utilities
- `npm run commit` - Interactive commit message generator (Conventional Commits)
- `npm run generate:password` - Generate secure passwords
## Database Schema
This application uses [DrizzleORM](https://orm.drizzle.team/) which supports multiple database backends:
- **PostgreSQL** (default, included in Docker container)
- **MySQL/MariaDB** (connect to external server)
- **SQLite** (for local development)
Database schemas are defined in `src/models/Schema.ts` using DrizzleORM. To modify the schema:
1. Edit `src/models/Schema.ts`
2. Generate migration: `npm run db:generate`
3. Apply migration: `npm run db:migrate`
### Connecting to Different Databases
The included PostgreSQL in Docker is just the default option. You can connect to any database by setting the `DATABASE_URL` environment variable:
**PostgreSQL:**
```env
DATABASE_URL=postgresql://username:password@localhost:5432/mydb
```
**MySQL:**
```env
DATABASE_URL=mysql://username:password@localhost:3306/mydb
```
**SQLite:**
```env
DATABASE_URL=file:./local.db
```
## Authentication
This project uses [Clerk](https://clerk.com) for authentication. To set up:
1. Create a Clerk account and application
2. Copy your API keys to `.env.local`:
```env
NEXT_PUBLIC_CLERK_PUBLISHABLE_KEY=pk_...
CLERK_SECRET_KEY=sk_...
```
Features include:
- Email/password authentication
- Social login (Google, GitHub, etc.)
- Multi-factor authentication (MFA)
- User management dashboard
## Testing
### Unit Tests
Run unit tests with Vitest:
```bash
npm run test
```
### Integration & E2E Testing
Unit tests are located alongside source files with `.test.ts` or `.test.tsx` extensions.
The project uses Playwright for integration and end-to-end (E2E) testing. Integration test files use the `*.spec.ts` extension, while E2E test files use the `*.e2e.ts` extension. You can run the tests with the following commands:
```shell
npx playwright install # Only for the first time in a new environment
### E2E Tests
Run end-to-end tests with Playwright:
```bash
npx playwright install # First time only
npm run test:e2e
```
### Storybook
E2E tests are in the `tests/e2e` directory with `.e2e.ts` extensions.
Storybook is configured for UI component development and testing. The project uses Storybook with Next.js and Vite integration, including accessibility testing and documentation features.
Stories are located alongside your components in the `src` directory and follow the pattern `*.stories.ts` or `*.stories.tsx`.
You can run Storybook in development mode with:
```shell
### Component Development
Use Storybook for isolated component development:
```bash
npm run storybook
```
This will start Storybook on http://localhost:6006 where you can view and interact with your UI components in isolation.
## Deployment
To run Storybook tests in headless mode, you can use the following command:
### Environment Variables
```shell
npm run storybook:test
Required environment variables for production:
- `DATABASE_URL` - PostgreSQL connection string
- `NEXT_PUBLIC_CLERK_PUBLISHABLE_KEY` - Clerk public key
- `CLERK_SECRET_KEY` - Clerk secret key
- `JWT_SECRET` - Secret for JWT token signing
- `NODE_ENV=production`
Optional:
- `CREATE_ADMIN_USER` - Set to `true` to create admin user on startup
- `ADMIN_USERNAME` - Admin username (default: admin)
- `ADMIN_PASSWORD` - Admin password (default: admin123)
### Docker
The application can be deployed using the included Dockerfile:
```bash
# Build image
docker build -t postgres-app .
# Run container
docker run -d \
-p 3000:3000 \
-e DATABASE_URL="postgresql://..." \
-e CLERK_SECRET_KEY="sk_..." \
-e NEXT_PUBLIC_CLERK_PUBLISHABLE_KEY="pk_..." \
-e JWT_SECRET="your-secret" \
postgres-app
```
### Local Production Build
## Contributing
Generate an optimized production build locally using a temporary in-memory Postgres database:
1. Fork the repository
2. Create a feature branch (`git checkout -b feature/amazing-feature`)
3. Commit your changes using conventional commits (`npm run commit`)
4. Push to the branch (`git push origin feature/amazing-feature`)
5. Open a Pull Request
```shell
npm run build-local
### Commit Convention
This project follows [Conventional Commits](https://www.conventionalcommits.org/). Use the interactive commit tool:
```bash
npm run commit
```
This command:
## Roadmap
- Starts a temporary in-memory Database server
- Runs database migrations with Drizzle Kit
- Builds the Next.js app for production
- Shuts down the temporary DB when the build finishes
See [ROADMAP.md](ROADMAP.md) for planned features and improvements.
Notes:
## License
- By default, it uses a local database, but you can also use `npm run build` with a remote database.
- This only creates the build, it doesn't start the server. To run the build locally, use `npm run start`.
Licensed under the MIT License. See [LICENSE](LICENSE) for more information.
### Deploy to production
## Support
During the build process, database migrations are automatically executed, so there's no need to run them manually. However, you must define `DATABASE_URL` in your environment variables.
Then, you can generate a production build with:
```shell
$ npm run build
```
It generates an optimized production build of the boilerplate. To test the generated build, run:
```shell
$ npm run start
```
You also need to defined the environment variables `CLERK_SECRET_KEY` using your own key.
This command starts a local server using the production build. You can now open http://localhost:3000 in your preferred browser to see the result.
### Deploy to Sevalla
You can deploy a Next.js application along with its database on a single platform. First, create an account on [Sevalla](https://sevalla.com).
After registration, you will be redirected to the dashboard. From there, navigate to `Database > Create a database`. Select PostgreSQL and and use the default settings for a quick setup. For advanced users, you can customize the database location and resource size. Finally, click on `Create` to complete the process.
Once the database is created and ready, return to the dashboard and click `Application > Create an App`. After connecting your GitHub account, select the repository you want to deploy. Keep the default settings for the remaining options, then click `Create`.
Next, connect your database to your application by going to `Networking > Connected services > Add connection` and select the database you just created. You also need to enable the `Add environment variables to the application` option, and rename `DB_URL` to `DATABASE_URL`. Then, click `Add connection`.
Go to `Environment variables > Add environment variable`, and define the environment variables `NEXT_PUBLIC_CLERK_PUBLISHABLE_KEY` and `CLERK_SECRET_KEY` from your Clerk account. Click `Save`.
Finally, initiate a new deployment by clicking `Overview > Latest deployments > Deploy now`. If everything is set up correctly, your application will be deployed successfully with a working database.
### Error Monitoring
The project uses [Sentry](https://sentry.io/for/nextjs/?utm_source=github&utm_medium=paid-community&utm_campaign=general-fy25q1-nextjs&utm_content=github-banner-nextjsboilerplate-logo) to monitor errors.
#### Local development with Sentry and Spotlight
In the development environment, no additional setup is required: Next.js Boilerplate comes pre-configured with Sentry and Spotlight (Sentry for Development). All errors are automatically captured by your local Spotlight instance, enabling testing without sending data to Sentry Cloud.
You can inspect captured events, view stack traces, and analyze errors in the Spotlight UI at `http://localhost:8969`.
#### Production setup with Sentry
For production environment, you'll need to create a Sentry account and a new project. Then, in `.env.production`, you need to update the following environment variables:
```shell
NEXT_PUBLIC_SENTRY_DSN=
SENTRY_ORGANIZATION=
SENTRY_PROJECT=
```
You also need to create a environment variable `SENTRY_AUTH_TOKEN` in your hosting provider's dashboard.
### Code coverage
Next.js Boilerplate relies on [Codecov](https://about.codecov.io/codecov-free-trial/?utm_source=github&utm_medium=paid-community&utm_campaign=general-fy25q1-nextjs&utm_content=github-banner-nextjsboilerplate-logo) for code coverage reporting solution. To enable Codecov, create a Codecov account and connect it to your GitHub account. Your repositories should appear on your Codecov dashboard. Select the desired repository and copy the token. In GitHub Actions, define the `CODECOV_TOKEN` environment variable and paste the token.
Make sure to create `CODECOV_TOKEN` as a GitHub Actions secret, do not paste it directly into your source code.
### Logging
The project uses LogTape for logging. In the development environment, logs are displayed in the console by default.
For production, the project is already integrated with [Better Stack](https://betterstack.com/?utm_source=github&utm_medium=sponsorship&utm_campaign=next-js-boilerplate) to manage and query your logs using SQL. To use Better Stack, you need to create a [Better Stack](https://betterstack.com/?utm_source=github&utm_medium=sponsorship&utm_campaign=next-js-boilerplate) account and create a new source: go to your Better Stack Logs Dashboard > Sources > Connect source. Then, you need to give a name to your source and select Node.js as the platform.
After creating the source, you will be able to view and copy your source token. In your environment variables, paste the token into the `NEXT_PUBLIC_BETTER_STACK_SOURCE_TOKEN` variable. You'll also need to define the `NEXT_PUBLIC_BETTER_STACK_INGESTING_HOST` variable, which can be found in the same place as the source token.
Now, all logs will automatically be sent to and ingested by Better Stack.
### Checkly monitoring
The project uses [Checkly](https://www.checklyhq.com/?utm_source=github&utm_medium=sponsorship&utm_campaign=next-js-boilerplate) to ensure that your production environment is always up and running. At regular intervals, Checkly runs the tests ending with `*.check.e2e.ts` extension and notifies you if any of the tests fail. Additionally, you have the flexibility to execute tests from multiple locations to ensure that your application is available worldwide.
To use Checkly, you must first create an account on [their website](https://www.checklyhq.com/?utm_source=github&utm_medium=sponsorship&utm_campaign=next-js-boilerplate). After creating an account, generate a new API key in the Checkly Dashboard and set the `CHECKLY_API_KEY` environment variable in GitHub Actions. Additionally, you will need to define the `CHECKLY_ACCOUNT_ID`, which can also be found in your Checkly Dashboard under User Settings > General.
To complete the setup, update the `checkly.config.ts` file with your own email address and production URL.
### Arcjet security and bot protection
The project uses [Arcjet](https://launch.arcjet.com/Q6eLbRE), a security as code product that includes several features that can be used individually or combined to provide defense in depth for your site.
To set up Arcjet, [create a free account](https://launch.arcjet.com/Q6eLbRE) and get your API key. Then add it to the `ARCJET_KEY` environment variable.
Arcjet is configured with two main features: bot detection and the Arcjet Shield WAF:
- [Bot detection](https://docs.arcjet.com/bot-protection/concepts) is configured to allow search engines, preview link generators e.g. Slack and Twitter previews, and to allow common uptime monitoring services. All other bots, such as scrapers and AI crawlers, will be blocked. You can [configure additional bot types](https://docs.arcjet.com/bot-protection/identifying-bots) to allow or block.
- [Arcjet Shield WAF](https://docs.arcjet.com/shield/concepts) will detect and block common attacks such as SQL injection, cross-site scripting, and other OWASP Top 10 vulnerabilities.
Arcjet is configured with a central client at `src/libs/Arcjet.ts` that includes the Shield WAF rules. Additional rules are applied when Arcjet is called in `proxy.ts`.
### Useful commands
### Code Quality and Validation
The project includes several commands to ensure code quality and consistency. You can run:
- `npm run lint` to check for linting errors
- `npm run lint:fix` to automatically fix fixable issues from the linter
- `npm run check:types` to verify type safety across the entire project
- `npm run check:deps` help identify unused dependencies and files
- `npm run check:i18n` ensures all translations are complete and properly formatted
#### Bundle Analyzer
Next.js Boilerplate includes a built-in bundle analyzer. It can be used to analyze the size of your JavaScript bundles. To begin, run the following command:
```shell
npm run build-stats
```
By running the command, it'll automatically open a new browser window with the results.
#### Database Studio
The project is already configured with Drizzle Studio to explore the database. You can run the following command to open the database studio:
```shell
npm run db:studio
```
Then, you can open https://local.drizzle.studio with your favorite browser to explore your database.
### VSCode information (optional)
If you are VSCode user, you can have a better integration with VSCode by installing the suggested extension in `.vscode/extension.json`. The starter code comes up with Settings for a seamless integration with VSCode. The Debug configuration is also provided for frontend and backend debugging experience.
With the plugins installed in your VSCode, ESLint and Prettier can automatically fix the code and display errors. The same applies to testing: you can install the VSCode Vitest extension to automatically run your tests, and it also shows the code coverage in context.
Pro tips: if you need a project wide-type checking with TypeScript, you can run a build with <kbd>Cmd</kbd> + <kbd>Shift</kbd> + <kbd>B</kbd> on Mac.
### Contributions
Everyone is welcome to contribute to this project. Feel free to open an issue if you have any questions or find a bug. Totally open to suggestions and improvements.
### License
Licensed under the MIT License, Copyright © 2025
See [LICENSE](LICENSE) for more information.
## Sponsors
<table width="100%">
<tr height="187px">
<td align="center" width="33%">
<a href="https://clerk.com?utm_source=github&utm_medium=sponsorship&utm_campaign=nextjs-boilerplate">
<picture>
<source media="(prefers-color-scheme: dark)" srcset="https://github.com/ixartz/SaaS-Boilerplate/assets/1328388/6fb61971-3bf1-4580-98a0-10bd3f1040a2">
<source media="(prefers-color-scheme: light)" srcset="https://github.com/ixartz/SaaS-Boilerplate/assets/1328388/f80a8bb5-66da-4772-ad36-5fabc5b02c60">
<img alt="Clerk Authentication & User Management for Next.js" src="https://github.com/ixartz/SaaS-Boilerplate/assets/1328388/f80a8bb5-66da-4772-ad36-5fabc5b02c60">
</picture>
</a>
</td>
<td align="center" width="33%">
<a href="https://www.coderabbit.ai?utm_source=next_js_starter&utm_medium=github&utm_campaign=next_js_starter_oss_2025">
<picture>
<source media="(prefers-color-scheme: dark)" srcset="public/assets/images/coderabbit-logo-dark.svg?raw=true">
<source media="(prefers-color-scheme: light)" srcset="public/assets/images/coderabbit-logo-light.svg?raw=true">
<img alt="CodeRabbit" src="public/assets/images/coderabbit-logo-light.svg?raw=true">
</picture>
</a>
</td>
<td align="center" width="33%">
<a href="https://sentry.io/for/nextjs/?utm_source=github&utm_medium=paid-community&utm_campaign=general-fy25q1-nextjs&utm_content=github-banner-nextjsboilerplate-logo">
<picture>
<source media="(prefers-color-scheme: dark)" srcset="public/assets/images/sentry-white.png?raw=true">
<source media="(prefers-color-scheme: light)" srcset="public/assets/images/sentry-dark.png?raw=true">
<img alt="Sentry" src="public/assets/images/sentry-dark.png?raw=true">
</picture>
</a>
<a href="https://about.codecov.io/codecov-free-trial/?utm_source=github&utm_medium=paid-community&utm_campaign=general-fy25q1-nextjs&utm_content=github-banner-nextjsboilerplate-logo">
<picture>
<source media="(prefers-color-scheme: dark)" srcset="public/assets/images/codecov-white.svg?raw=true">
<source media="(prefers-color-scheme: light)" srcset="public/assets/images/codecov-dark.svg?raw=true">
<img alt="Codecov" src="public/assets/images/codecov-dark.svg?raw=true">
</picture>
</a>
</td>
</tr>
<tr height="187px">
<td align="center" width="33%">
<a href="https://launch.arcjet.com/Q6eLbRE">
<picture>
<source media="(prefers-color-scheme: dark)" srcset="public/assets/images/arcjet-dark.svg?raw=true">
<source media="(prefers-color-scheme: light)" srcset="public/assets/images/arcjet-light.svg?raw=true">
<img alt="Arcjet" src="public/assets/images/arcjet-light.svg?raw=true">
</picture>
</a>
</td>
<td align="center" width="33%">
<a href="https://sevalla.com/">
<picture>
<source media="(prefers-color-scheme: dark)" srcset="public/assets/images/sevalla-dark.png">
<source media="(prefers-color-scheme: light)" srcset="public/assets/images/sevalla-light.png">
<img alt="Sevalla" src="public/assets/images/sevalla-light.png">
</picture>
</a>
</td>
<td align="center" width="33%">
<a href="https://l.crowdin.com/next-js">
<picture>
<source media="(prefers-color-scheme: dark)" srcset="public/assets/images/crowdin-white.png?raw=true">
<source media="(prefers-color-scheme: light)" srcset="public/assets/images/crowdin-dark.png?raw=true">
<img alt="Crowdin" src="public/assets/images/crowdin-dark.png?raw=true">
</picture>
</a>
</td>
</tr>
<tr height="187px">
<td align="center" width="33%">
<a href="https://betterstack.com/?utm_source=github&utm_medium=sponsorship&utm_campaign=next-js-boilerplate">
<picture>
<source media="(prefers-color-scheme: dark)" srcset="public/assets/images/better-stack-white.png?raw=true">
<source media="(prefers-color-scheme: light)" srcset="public/assets/images/better-stack-dark.png?raw=true">
<img alt="Better Stack" src="public/assets/images/better-stack-dark.png?raw=true">
</picture>
</a>
</td>
<td align="center" width="33%">
<a href="https://posthog.com/?utm_source=github&utm_medium=sponsorship&utm_campaign=next-js-boilerplate">
<picture>
<source media="(prefers-color-scheme: dark)" srcset="https://posthog.com/brand/posthog-logo-white.svg">
<source media="(prefers-color-scheme: light)" srcset="https://posthog.com/brand/posthog-logo.svg">
<img alt="PostHog" src="https://posthog.com/brand/posthog-logo.svg">
</picture>
</a>
</td>
<td align="center" width="33%">
<a href="https://www.checklyhq.com/?utm_source=github&utm_medium=sponsorship&utm_campaign=next-js-boilerplate">
<picture>
<source media="(prefers-color-scheme: dark)" srcset="public/assets/images/checkly-logo-dark.png?raw=true">
<source media="(prefers-color-scheme: light)" srcset="public/assets/images/checkly-logo-light.png?raw=true">
<img alt="Checkly" src="public/assets/images/checkly-logo-light.png?raw=true">
</picture>
</a>
</td>
</tr>
<tr height="187px">
<td align="center" style=width="33%">
<a href="https://nextjs-boilerplate.com/pro-saas-starter-kit">
<img src="public/assets/images/nextjs-boilerplate-saas.png?raw=true" alt="Next.js SaaS Boilerplate with React" />
</a>
</td>
<td align="center" width="33%">
<a href="mailto:contact@creativedesignsguru.com">
Add your logo here
</a>
</td>
</tr>
</table>
---
Made with ♥ by [CreativeDesignsGuru](https://creativedesignsguru.com) [![Twitter](https://img.shields.io/twitter/url/https/twitter.com/cloudposse.svg?style=social&label=Follow%20%40Ixartz)](https://twitter.com/ixartz)
Looking for a custom boilerplate to kick off your project? I'd be glad to discuss how I can help you build one. Feel free to reach out anytime at contact@creativedesignsguru.com!
[![Sponsor Next JS Boilerplate](https://cdn.buymeacoffee.com/buttons/default-red.png)](https://github.com/sponsors/ixartz)
For issues, questions, or contributions, please open an issue on the GitHub repository.

386
ROADMAP.md Normal file
View File

@@ -0,0 +1,386 @@
# Roadmap
This document outlines the planned features, improvements, and technical debt items for the project. Items are organized by priority and implementation timeline.
## Current Status
**Completed**
- Next.js 16 with App Router
- PostgreSQL 15 integration (included as default in Docker)
- DrizzleORM for database operations (supports PostgreSQL, MySQL, SQLite)
- Basic authentication system (Clerk integration available)
- Docker containerization with optional embedded PostgreSQL
- Unit testing with Vitest
- E2E testing with Playwright
- Storybook for component development
- TypeScript strict mode
- ESLint and Prettier configuration
- Multi-language support (i18n)
- Error monitoring with Sentry
- Security with Arcjet
## Short Term (Next 1-3 Months)
### High Priority
- [ ] **Database CRUD Operations**
- Create schema management interface
- Implement table creation/editing UI
- Add column type management (add, modify, delete columns)
- Implement record CRUD operations (Create, Read, Update, Delete)
- Add data validation and constraints management
- Build query builder interface
- Add foreign key relationship management
- Implement index management UI
- Add table migration history viewer
- Create database backup/restore UI
- [ ] **Multi-Database Server Support** 🔌
- **Connection Management**
- Add custom database servers to connection list
- Server dropdown selector in UI
- Save connection configurations securely
- Quick switch between database servers
- Connection status indicators (connected/disconnected)
- Test connection before saving
- **Multi-Database Backend Support**
- PostgreSQL support (current)
- MySQL/MariaDB support via Drizzle ORM
- SQLite support via Drizzle ORM
- Database type auto-detection
- Driver-specific features and optimizations
- **Connection Details**
- Host, port, database name configuration
- Username/password authentication
- SSL/TLS connection options
- Connection pooling settings
- Custom connection string support
- Import/export connection profiles
- [ ] **Simple Authentication UI**
- Build clean login screen with username/password
- Create user registration page
- Add password reset flow
- Implement "Remember me" functionality
- Add basic form validation
- Create user profile page
- Add password change functionality
- Session timeout handling
- [ ] **Improve Docker Build**
- ✅ Fixed PostgreSQL database initialization errors
- Optimize container image size
- Add health checks for PostgreSQL and Next.js
- Document Docker environment variables
- Add multi-stage builds for smaller images
- [ ] **Expand Test Coverage**
- Add integration tests for database operations
- Add E2E tests for authentication flows
- Add API route tests
- Add CRUD operation tests
- Increase unit test coverage to 80%+
- Add visual regression tests
- [ ] **Documentation Improvements**
- Create architecture documentation
- Add API documentation (if applicable)
- Document database schema and migrations
- Create deployment guides for major cloud providers
- Add troubleshooting guide
- [ ] **Performance Optimization**
- Implement caching strategies (Redis)
- Optimize database queries
- Add database indexing
- Implement image optimization
- Add bundle size monitoring
### Medium Priority
- [ ] **Developer Experience**
- Add more pre-commit hooks
- Improve error messages
- Add debugging guides
- Create development environment setup script
- Add VS Code extension recommendations
- [ ] **Security Enhancements**
- Implement rate limiting on sensitive endpoints
- Add CSRF protection
- Implement security headers
- Add dependency vulnerability scanning in CI
- Regular security audits
- Encrypt stored database credentials
- Secure connection string storage with environment variables
- [ ] **CI/CD Pipeline**
- Add automated deployment workflows
- Add automated database backup
- Implement staging environment
- Add performance benchmarking in CI
- Add accessibility testing in CI
## Medium Term (3-6 Months)
### Feature Development
- [ ] **User Management**
- User profile management
- User roles and permissions (RBAC)
- User activity logging
- Account deletion and data export
- Email notifications system
- [ ] **Admin Dashboard**
- Admin panel for user management
- Analytics and reporting
- System health monitoring
- Configuration management
- Audit logs
- [ ] **API Development**
- RESTful API endpoints
- API documentation with Swagger/OpenAPI
- API versioning
- API rate limiting
- API key management
- [ ] **Data Management**
- **Schema Management**
- Create/rename/delete database schemas
- Schema permissions management
- Schema cloning functionality
- **Table Operations**
- Visual table designer
- Bulk table operations
- Table cloning/duplication
- Table truncate with safety checks
- Table statistics and metadata viewer
- **Column Management**
- Add/modify/delete columns with validation
- Change column types with data migration
- Set default values and constraints
- Nullable/Not Nullable toggles
- Auto-increment/sequence management
- **Relationships & Constraints**
- Primary key management
- Foreign key creation and visualization
- Unique constraints
- Check constraints
- Cascade delete/update options
- **Data Operations**
- Bulk insert functionality
- CSV/JSON import
- Data export (CSV, JSON, SQL)
- Bulk update operations
- Bulk delete with filters
- Data validation improvements
- Soft delete functionality
- Data archiving
- **Advanced Features**
- SQL query editor with syntax highlighting
- Saved queries library
- Query execution history
- Query performance analysis
- Database triggers management
- Stored procedures interface
- Views creation and management
### Infrastructure
- [ ] **Monitoring and Observability**
- Application performance monitoring (APM)
- Log aggregation and analysis
- Metrics dashboard
- Alerting system
- Uptime monitoring
- [ ] **Database Improvements**
- Database connection pooling
- Read replicas for scaling
- Database performance monitoring
- Automated backup strategy
- Migration rollback procedures
- **Schema Version Control**
- Track schema changes over time
- Schema diff tool
- Rollback capabilities for migrations
- Branching for schema development
- **Database Documentation**
- Auto-generate schema documentation
- ERD (Entity Relationship Diagram) generator
- Table relationships visualization
- Column descriptions and metadata
## Long Term (6-12 Months)
### Advanced Features
- [ ] **Visual Database Designer** 🎨
- **Drag-and-Drop Table Builder**
- Intuitive canvas for designing tables
- Add/remove columns by dragging components
- Visual column type selector
- Constraint badges (PK, FK, UNIQUE, NOT NULL)
- Table resize and positioning
- Auto-arrange tables in clean layout
- **Visual Relationship Editor**
- Drag lines to connect tables and create foreign keys
- Visual representation of one-to-one, one-to-many, many-to-many relationships
- Relationship lines with cardinality indicators
- Hover to see relationship details
- Click to edit cascade rules and constraints
- Color-coded relationships by type
- **Interactive ERD Canvas**
- Zoom and pan for large schemas
- Minimap for navigation
- Grid snapping for alignment
- Export to PNG/SVG
- Dark/light theme support
- Collaboration mode (real-time updates)
- **Schema Templates & Generation**
- Pre-built schema templates (e-commerce, blog, SaaS, etc.)
- Generate SQL from visual design
- Import existing database to visual canvas
- Version control for schema designs
- [ ] **Database Administration Tools**
- **Advanced CRUD Features**
- Inline editing for table data
- Spreadsheet-like data grid
- Advanced filtering and sorting
- Full-text search across tables
- Pagination for large datasets
- Batch operations with progress tracking
- **Database Inspector**
- Table size and row count analytics
- Index usage statistics
- Slow query analyzer
- Dead rows and bloat detection
- Dependency tree viewer
- **Migration Tools**
- Visual migration builder
- Migration testing environment
- Automated migration generation from schema changes
- Migration conflict resolution
- Parallel migration execution
- [ ] **Multi-Tenancy**
- Organization/team support
- Multi-tenant data isolation
- Tenant-specific customization
- Billing and subscription management
- Per-tenant database schemas
- [ ] **Authentication Improvements**
- Simple username/password login screen
- User registration form
- Password reset functionality
- Remember me option
- Session timeout configuration
- Account lockout after failed attempts
- Password strength requirements
- Basic user profile management
- [ ] **Real-Time Features**
- WebSocket support
- Real-time notifications
- Live data updates
- Collaborative features
- Chat functionality
- [ ] **Mobile Support**
- Responsive design improvements
- Progressive Web App (PWA)
- Mobile app (React Native)
- Push notifications
- Offline support
### Scalability
- [ ] **Horizontal Scaling**
- Load balancer configuration
- Session management for distributed systems
- Distributed caching
- Microservices architecture evaluation
- Queue system for background jobs
- [ ] **Performance at Scale**
- CDN integration
- Edge computing deployment
- GraphQL API layer
- Database sharding strategy
- Caching layer improvements
## Future Considerations
### Research & Exploration
- [ ] **AI/ML Integration**
- AI-powered features
- Machine learning models
- Natural language processing
- Recommendation systems
- [ ] **Blockchain Integration**
- Web3 wallet support
- Smart contract integration
- Decentralized storage
- [ ] **Advanced Analytics**
- Business intelligence dashboard
- Predictive analytics
- Custom reporting
- Data visualization
## Technical Debt
### Code Quality
- [ ] Refactor legacy components
- [ ] Improve type safety across codebase
- [ ] Reduce bundle size
- [ ] Remove unused dependencies
- [ ] Standardize error handling
- [ ] Improve code documentation
### Dependencies
- [ ] Regular dependency updates
- [ ] Remove deprecated packages
- [ ] Audit and reduce package count
- [ ] Evaluate alternative libraries
- [ ] License compliance check
## Contributing
We welcome contributions to any of the items on this roadmap! Here's how you can help:
1. **Pick an item** - Choose something you're interested in working on
2. **Create an issue** - Discuss your approach before starting
3. **Submit a PR** - Follow our contribution guidelines
4. **Review** - Participate in code reviews
### Priority Labels
- 🔴 **Critical** - Must be addressed immediately
- 🟠 **High** - Should be completed soon
- 🟡 **Medium** - Important but not urgent
- 🟢 **Low** - Nice to have
### Status Labels
- 📋 **Planned** - On the roadmap but not started
- 🏗️ **In Progress** - Currently being worked on
-**Completed** - Finished and merged
- 🧊 **On Hold** - Paused for now
-**Cancelled** - No longer planned
## Feedback
Have suggestions for the roadmap? Please open an issue with the `roadmap` label to discuss new features or improvements.
---
*Last Updated: January 2026*