This project demonstrates how to build a modern note-taking application using Neon's Data API (powered by PostgREST), and Neon Auth for authentication. Instead of using traditional database access via a backend, this demo showcases how to leverage Neon's Data API for direct-to-database queries with a very elegant JS SDK.
Neon Data API (PostgREST-compatible)
- Instant REST API for your Postgres database
- Built-in filtering, pagination, and relationships
- Automatic OpenAPI documentation
This demo is built with:
Before you begin, ensure you have the following installed:
- Bun (v1.0 or newer)
- A Neon account and project, with Auth enabled
Follow these steps to run the demo:
-
Create a Neon project and enable the Data API
-
Copy the Data API URL and the Neon Auth variables
-
Install the dependencies:
bun install
-
Configure Environment Variables: Create a
.env
file in the project root with the following variables. Get them from the Neon console.# Neon Data API VITE_NEON_DATA_API_URL=your_neon_data_api_url # Neon Auth VITE_PUBLIC_STACK_PROJECT_ID=your_project_id VITE_PUBLIC_STACK_PUBLISHABLE_CLIENT_KEY=your_client_key
Optionally, you can configure a
DATABASE_URL
environment variable and runbun run db:migrate
to migrate your database. -
Start the Development Server:
bun dev
-
Build for Production:
bun run build
-
Create a Neon project and enable Data API:
bun run db:generate
-
Apply the schema:
bun run db:migrate
This application is configured for deployment on Vercel:
- Push your code to a Git repository
- Import the project in Vercel
- Configure environment variables:
- Neon Data API credentials
- Neon Auth credentials
- Deploy!