# Remix Postgres

A Remix Stack for deploying to Render with PostgreSQL, authentication, testing, linting, formatting, etc.

- Repository: https://github.com/render-examples/remix-postgres
- Stack: nodejs, postgresql, tailwind
- Tags: database, full-stack
- URL: https://render.com/templates/remix-postgres

## Why deploy Remix Postgres on Render?

Remix Postgres is a full-stack web application template that combines the Remix framework with a PostgreSQL database, pre-configured for deployment on Render. It solves the problem of setting up production-ready infrastructure by providing authentication, database ORM (Prisma), testing, and styling out of the box. The template is based on Remix's Indie Stack and includes a sample note-taking app to demonstrate the architecture.

This template pre-configures a complete Remix Indie Stack with Prisma ORM already wired to a managed PostgreSQL database, cookie-based authentication, and a healthcheck endpoint for zero-downtime deploys—all connected through Render's Blueprint so environment variables and database URLs are automatically set. Instead of manually provisioning a database, configuring connection strings, and setting up deployment scripts, you get a production-ready full-stack app with one click. Render's native Node.js environment handles builds and deploys automatically, and the managed Postgres means no database administration overhead.

## Architecture

```mermaid
flowchart LR
classDef default fill:#1a1a2e,stroke:#a78bfa,color:#fff

User([User]) -->|HTTP requests| remix[remix]
remix -->|queries| remixdb[(remixdb)]
```

## What you can build

After deploying, you'll have a working Remix application with a connected PostgreSQL database, user authentication via email and password, and a simple note-taking interface where users can create and delete notes. The app includes a healthcheck endpoint configured for zero-downtime deploys, so you can start iterating on the codebase immediately without additional infrastructure setup.

## Key features

- *Render Blueprint Deployment*: Infrastructure-as-code deployment via render.yaml that provisions both the Node.js service and managed PostgreSQL database with a single click.
- *Cookie-Based Authentication*: Built-in email/password authentication system using Remix's createCookieSessionStorage for secure session management.
- *Prisma ORM Integration*: Pre-configured database layer with Prisma including user and notes models, migrations, and a seed script with test data.
- *Cypress E2E Testing Utilities*: End-to-end testing setup with custom cy.login() helper for authenticated tests and cy.cleanupUser() for test isolation.
- *Zero Downtime Deploys*: Includes healthcheck endpoint configuration enabling Render's zero-downtime deployment strategy for production updates.

## Use cases

- Solo developer launches a note-taking SaaS with built-in auth on Render
- Bootcamp grad deploys their first full-stack Remix app with PostgreSQL
- Freelancer prototypes a client portal with email login and database persistence
- Startup founder validates an MVP idea using pre-configured testing and deployment

## What's included

| Service | Type | Purpose |
|---------|------|---------|
| remix | Web Service | Application service |
| remixdb | PostgreSQL | Primary database |

## Next steps

1. Open your app's .onrender.com URL and log in with rachel@remix.run / racheliscool — You should see the notes dashboard with the seeded user's existing notes
2. Create a new note with a title and body, then refresh the page — Your note should persist and appear in the notes list, confirming the PostgreSQL database connection is working
3. Test the logout button and try accessing /notes directly — You should be redirected to the login page, verifying cookie-based session authentication is protecting routes

## Resources

- [Remix official site](https://remix.run)
