{
8 | return await this.sql`SELECT * FROM ${this.sql.unsafe(name)}`;
9 | }
10 | }
11 |
--------------------------------------------------------------------------------
/ai/aws-bedrock/chatbot-nextjs/next.config.mjs:
--------------------------------------------------------------------------------
1 | /** @type {import('next').NextConfig} */
2 | const nextConfig = {
3 | webpack: (config) => {
4 | config.resolve.alias = {
5 | ...config.resolve.alias,
6 | sharp$: false,
7 | 'onnxruntime-node$': false,
8 | }
9 | return config
10 | },
11 | }
12 |
13 | export default nextConfig
14 |
--------------------------------------------------------------------------------
/ai/llamaindex/chatbot-nextjs/next.config.mjs:
--------------------------------------------------------------------------------
1 | /** @type {import('next').NextConfig} */
2 | const nextConfig = {
3 | webpack: (config) => {
4 | config.resolve.alias = {
5 | ...config.resolve.alias,
6 | sharp$: false,
7 | 'onnxruntime-node$': false,
8 | }
9 | return config
10 | },
11 | }
12 |
13 | export default nextConfig
14 |
--------------------------------------------------------------------------------
/with-fastify/plugins/support.js:
--------------------------------------------------------------------------------
1 | 'use strict'
2 |
3 | const fp = require('fastify-plugin')
4 |
5 | // the use of fastify-plugin is required to be able
6 | // to export the decorators to the outer scope
7 |
8 | module.exports = fp(async function (fastify, opts) {
9 | fastify.decorate('someSupport', function () {
10 | return 'hugs'
11 | })
12 | })
13 |
--------------------------------------------------------------------------------
/with-sveltekit/src/app.d.ts:
--------------------------------------------------------------------------------
1 | // See https://kit.svelte.dev/docs/types#app
2 | // for information about these interfaces
3 | declare global {
4 | namespace App {
5 | // interface Error {}
6 | // interface Locals {}
7 | // interface PageData {}
8 | // interface PageState {}
9 | // interface Platform {}
10 | }
11 | }
12 |
13 | export {}
14 |
--------------------------------------------------------------------------------
/with_elixir_postgrex/lib/with_elixir_postgrex.ex:
--------------------------------------------------------------------------------
1 | defmodule WithElixirPostgrex do
2 | @moduledoc """
3 | Documentation for `WithElixirPostgrex`.
4 | """
5 |
6 | @doc """
7 | Hello world.
8 |
9 | ## Examples
10 |
11 | iex> WithElixirPostgrex.hello()
12 | :world
13 |
14 | """
15 | def hello do
16 | :world
17 | end
18 | end
19 |
--------------------------------------------------------------------------------
/ai/llamaindex/chat-with-pdf-nextjs/next.config.mjs:
--------------------------------------------------------------------------------
1 | /** @type {import('next').NextConfig} */
2 | const nextConfig = {
3 | webpack: (config) => {
4 | config.resolve.alias = {
5 | ...config.resolve.alias,
6 | sharp$: false,
7 | 'onnxruntime-node$': false,
8 | }
9 | return config
10 | },
11 | }
12 |
13 | export default nextConfig
14 |
--------------------------------------------------------------------------------
/ai/llamaindex/semantic-search-nextjs/next.config.mjs:
--------------------------------------------------------------------------------
1 | /** @type {import('next').NextConfig} */
2 | const nextConfig = {
3 | webpack: (config) => {
4 | config.resolve.alias = {
5 | ...config.resolve.alias,
6 | sharp$: false,
7 | 'onnxruntime-node$': false,
8 | }
9 | return config
10 | },
11 | }
12 |
13 | export default nextConfig
14 |
--------------------------------------------------------------------------------
/with-electricsql/react-app/src/App.tsx:
--------------------------------------------------------------------------------
1 | import { useShape } from "@electric-sql/react";
2 |
3 | function Component() {
4 | const { data } = useShape({
5 | url: `http://localhost:3000/v1/shape/foo`,
6 | });
7 | return (
8 | <>
9 | {JSON.stringify(data, null, 2)};
10 | >
11 | );
12 | }
13 |
14 | export default Component;
15 |
--------------------------------------------------------------------------------
/with-fastify/routes/root.js:
--------------------------------------------------------------------------------
1 | "use strict";
2 |
3 | module.exports = async function (fastify, opts) {
4 | fastify.get("/", function (req, reply) {
5 | fastify.pg.query(
6 | "SELECT * FROM playing_with_neon",
7 | [],
8 | function onResult(err, result) {
9 | reply.send(err || result.rows);
10 | }
11 | );
12 | });
13 | };
14 |
--------------------------------------------------------------------------------
/with-laravel/.editorconfig:
--------------------------------------------------------------------------------
1 | root = true
2 |
3 | [*]
4 | charset = utf-8
5 | end_of_line = lf
6 | indent_size = 4
7 | indent_style = space
8 | insert_final_newline = true
9 | trim_trailing_whitespace = true
10 |
11 | [*.md]
12 | trim_trailing_whitespace = false
13 |
14 | [*.{yml,yaml}]
15 | indent_size = 2
16 |
17 | [docker-compose.yml]
18 | indent_size = 4
19 |
--------------------------------------------------------------------------------
/with-analog/.editorconfig:
--------------------------------------------------------------------------------
1 | # Editor configuration, see https://editorconfig.org
2 | root = true
3 |
4 | [*]
5 | charset = utf-8
6 | indent_style = space
7 | indent_size = 2
8 | insert_final_newline = true
9 | trim_trailing_whitespace = true
10 |
11 | [*.ts]
12 | quote_type = single
13 |
14 | [*.md]
15 | max_line_length = off
16 | trim_trailing_whitespace = false
17 |
--------------------------------------------------------------------------------
/with-angular/.editorconfig:
--------------------------------------------------------------------------------
1 | # Editor configuration, see https://editorconfig.org
2 | root = true
3 |
4 | [*]
5 | charset = utf-8
6 | indent_style = space
7 | indent_size = 2
8 | insert_final_newline = true
9 | trim_trailing_whitespace = true
10 |
11 | [*.ts]
12 | quote_type = single
13 |
14 | [*.md]
15 | max_line_length = off
16 | trim_trailing_whitespace = false
17 |
--------------------------------------------------------------------------------
/with-laravel/.gitignore:
--------------------------------------------------------------------------------
1 | /.phpunit.cache
2 | /node_modules
3 | /public/build
4 | /public/hot
5 | /public/storage
6 | /storage/*.key
7 | /vendor
8 | .env
9 | .env.backup
10 | .env.production
11 | .phpactor.json
12 | .phpunit.result.cache
13 | Homestead.json
14 | Homestead.yaml
15 | auth.json
16 | npm-debug.log
17 | yarn-error.log
18 | /.fleet
19 | /.idea
20 | /.vscode
21 |
--------------------------------------------------------------------------------
/with-micronaut-kotlin/src/main/resources/db/migration/V1__create_book_table.sql:
--------------------------------------------------------------------------------
1 | CREATE TABLE IF NOT EXISTS book (
2 | id SERIAL PRIMARY KEY,
3 | title VARCHAR(255) NOT NULL,
4 | author VARCHAR(255) NOT NULL
5 | );
6 |
7 | INSERT INTO book (title, author) VALUES ('The Hobbit', 'J.R.R. Tolkien');
8 | INSERT INTO book (title, author) VALUES ('1984', 'George Orwell');
9 |
--------------------------------------------------------------------------------
/with-sveltekit/src/app.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 | %sveltekit.head%
7 |
8 |
9 | %sveltekit.body%
10 |
11 |
12 |
--------------------------------------------------------------------------------
/with-wasp/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "with-wasp",
3 | "dependencies": {
4 | "@neondatabase/serverless": "^1.0.0",
5 | "react": "^18.2.0",
6 | "wasp": "file:.wasp/out/sdk/wasp"
7 | },
8 | "devDependencies": {
9 | "@types/react": "^18.0.37",
10 | "prisma": "4.16.2",
11 | "typescript": "^5.1.0",
12 | "vite": "^4.3.9"
13 | }
14 | }
15 |
--------------------------------------------------------------------------------
/auth/with-authjs-next/.env.example:
--------------------------------------------------------------------------------
1 | # Postgres URL retrieved from https://console.neon.tech
2 | DATABASE_URL="postgresql://neondb_owner:...@ep-...us-east-1.aws.neon.tech/neondb?sslmode=require"
3 |
4 | # API key generated at https://resend.com/api-keys
5 | AUTH_RESEND_KEY="YOUR_RESEND_API_KEY"
6 |
7 | # Secret generated using `npx auth secret`
8 | AUTH_SECRET="YOUR_AUTH_SECRET"
9 |
--------------------------------------------------------------------------------
/with-nestjs/src/app.controller.ts:
--------------------------------------------------------------------------------
1 | import { Controller, Get } from '@nestjs/common';
2 | import { AppService } from './app.service';
3 |
4 | @Controller('/')
5 | export class AppController {
6 | constructor(private readonly appService: AppService) {}
7 |
8 | @Get()
9 | async getTable() {
10 | return this.appService.getTable('playing_with_neon');
11 | }
12 | }
13 |
--------------------------------------------------------------------------------
/with-nuxt/nuxt.config.ts:
--------------------------------------------------------------------------------
1 | export default defineNuxtConfig({
2 | compatibilityDate: '2024-04-03',
3 | devtools: {
4 | enabled: true,
5 | },
6 | future: {
7 | compatibilityVersion: 4
8 | },
9 | modules: [
10 | '@nuxtjs/tailwindcss',
11 | '@nuxt/icon',
12 | ],
13 | runtimeConfig: {
14 | databaseUrl: process.env.DATABASE_URL,
15 | },
16 | })
--------------------------------------------------------------------------------
/with-sveltekit-feature-flags/src/app.d.ts:
--------------------------------------------------------------------------------
1 | // See https://kit.svelte.dev/docs/types#app
2 | // for information about these interfaces
3 | declare global {
4 | namespace App {
5 | // interface Error {}
6 | // interface Locals {}
7 | // interface PageData {}
8 | // interface PageState {}
9 | // interface Platform {}
10 | }
11 | }
12 |
13 | export {}
14 |
--------------------------------------------------------------------------------
/with-angular/src/index.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | WithAngular
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
--------------------------------------------------------------------------------
/with-fastapi/main.py:
--------------------------------------------------------------------------------
1 | from fastapi import FastAPI
2 |
3 | from app.api import songs
4 | from app.db import database
5 |
6 | app = FastAPI()
7 |
8 | @app.on_event("startup")
9 | async def startup():
10 | await database.connect()
11 |
12 | @app.on_event("shutdown")
13 | async def shutdown():
14 | await database.disconnect()
15 |
16 | app.include_router(songs.router)
17 |
--------------------------------------------------------------------------------
/with-nextjs-drizzle-local-vercel/tailwind.config.js:
--------------------------------------------------------------------------------
1 | /** @type {import('tailwindcss').Config} */
2 | module.exports = {
3 | content: ['./pages/**/*.{js,ts,jsx,tsx}', './components/**/*.{js,ts,jsx,tsx}', './app/**/*.{js,ts,jsx,tsx}'],
4 | theme: {
5 | extend: {
6 | fontFamily: {
7 | default: ['var(--font-inter)'],
8 | },
9 | },
10 | },
11 | }
12 |
--------------------------------------------------------------------------------
/with-tanstack-start/app/ssr.tsx:
--------------------------------------------------------------------------------
1 | import {
2 | createStartHandler,
3 | defaultStreamHandler,
4 | } from "@tanstack/start/server";
5 | import { getRouterManifest } from "@tanstack/start/router-manifest";
6 |
7 | import { createRouter } from "./router";
8 |
9 | export default createStartHandler({
10 | createRouter,
11 | getRouterManifest,
12 | })(defaultStreamHandler);
13 |
--------------------------------------------------------------------------------
/ai/langchain/rag-nextjs/.env.example:
--------------------------------------------------------------------------------
1 | # Postgres URL retrieved here: https://console.neon.tech
2 | POSTGRES_URL="postgresql://neondb_owner:...@ep-...us-east-1.aws.neon.tech/neondb?sslmode=require"
3 |
4 | # OpenAI key retrieved here: https://platform.openai.com/api-keys
5 | OPENAI_API_KEY="sk-..."
6 |
7 | # If want to use Ollama as LLM (OpenAI API key still needed)
8 | OLLAMA_ENDPOINT=""
9 |
--------------------------------------------------------------------------------
/ai/llamaindex/rag-nextjs/.env.example:
--------------------------------------------------------------------------------
1 | # Postgres URL retrieved here: https://console.neon.tech
2 | POSTGRES_URL="postgresql://neondb_owner:...@ep-...us-east-1.aws.neon.tech/neondb?sslmode=require"
3 |
4 | # OpenAI key retrieved here: https://platform.openai.com/api-keys
5 | OPENAI_API_KEY="sk-..."
6 |
7 | # If want to use Ollama as LLM (OpenAI API key still needed)
8 | OLLAMA_ENDPOINT=""
9 |
--------------------------------------------------------------------------------
/with-analog/.vscode/launch.json:
--------------------------------------------------------------------------------
1 | {
2 | // For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
3 | "version": "0.2.0",
4 | "configurations": [
5 | {
6 | "name": "ng serve",
7 | "type": "chrome",
8 | "request": "launch",
9 | "preLaunchTask": "npm: start",
10 | "url": "http://localhost:5173/"
11 | }
12 | ]
13 | }
14 |
--------------------------------------------------------------------------------
/with-nextjs-prisma-cloudflare-workers/tailwind.config.js:
--------------------------------------------------------------------------------
1 | /** @type {import('tailwindcss').Config} */
2 | module.exports = {
3 | content: ['./pages/**/*.{js,ts,jsx,tsx}', './components/**/*.{js,ts,jsx,tsx}', './app/**/*.{js,ts,jsx,tsx}'],
4 | theme: {
5 | extend: {
6 | fontFamily: {
7 | default: ['var(--font-inter)'],
8 | },
9 | },
10 | },
11 | }
12 |
--------------------------------------------------------------------------------
/with-sveltekit-feature-flags/src/app.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 | %sveltekit.head%
7 |
8 |
9 | %sveltekit.body%
10 |
11 |
12 |
--------------------------------------------------------------------------------
/ai/langchain/chatbot-nextjs/.env.example:
--------------------------------------------------------------------------------
1 | # Postgres URL retrieved here: https://console.neon.tech
2 | POSTGRES_URL="postgresql://neondb_owner:...@ep-...us-east-1.aws.neon.tech/neondb?sslmode=require"
3 |
4 | # OpenAI key retrieved here: https://platform.openai.com/api-keys
5 | OPENAI_API_KEY="sk-..."
6 |
7 | # If want to use Ollama as LLM (OpenAI API key still needed)
8 | OLLAMA_ENDPOINT=""
9 |
--------------------------------------------------------------------------------
/ai/llamaindex/chatbot-nextjs/.env.example:
--------------------------------------------------------------------------------
1 | # Postgres URL retrieved here: https://console.neon.tech
2 | POSTGRES_URL="postgresql://neondb_owner:...@ep-...us-east-1.aws.neon.tech/neondb?sslmode=require"
3 |
4 | # OpenAI key retrieved here: https://platform.openai.com/api-keys
5 | OPENAI_API_KEY="sk-..."
6 |
7 | # If want to use Ollama as LLM (OpenAI API key still needed)
8 | OLLAMA_ENDPOINT=""
9 |
--------------------------------------------------------------------------------
/with-nextjs-drizzle-edge/tailwind.config.js:
--------------------------------------------------------------------------------
1 | /** @type {import('tailwindcss').Config} */
2 | module.exports = {
3 | content: ['./pages/**/*.{js,ts,jsx,tsx}', './components/**/*.{js,ts,jsx,tsx}', './app/**/*.{js,ts,jsx,tsx}'],
4 | theme: {
5 | extend: {
6 | fontFamily: {
7 | default: ['var(--font-inter)'],
8 | },
9 | },
10 | },
11 | plugins: [],
12 | }
13 |
--------------------------------------------------------------------------------
/with-nextjs-prisma-cloudflare-workers/next.config.mjs:
--------------------------------------------------------------------------------
1 | import { setupDevPlatform } from '@cloudflare/next-on-pages/next-dev'
2 |
3 | /** @type {import('next').NextConfig} */
4 | const nextConfig = {
5 | images: {
6 | domains: ['images.ctfassets.net'],
7 | },
8 | }
9 |
10 | if (process.env.NODE_ENV === 'development') await setupDevPlatform()
11 |
12 | export default nextConfig
13 |
--------------------------------------------------------------------------------
/with-nextjs-prisma-edge/tailwind.config.js:
--------------------------------------------------------------------------------
1 | /** @type {import('tailwindcss').Config} */
2 | module.exports = {
3 | content: ['./pages/**/*.{js,ts,jsx,tsx}', './components/**/*.{js,ts,jsx,tsx}', './app/**/*.{js,ts,jsx,tsx}'],
4 | theme: {
5 | extend: {
6 | fontFamily: {
7 | default: ['var(--font-inter)'],
8 | },
9 | },
10 | },
11 | plugins: [],
12 | }
13 |
--------------------------------------------------------------------------------
/with-nextjs-server-components/app/page.tsx:
--------------------------------------------------------------------------------
1 | import { neon } from "@neondatabase/serverless";
2 |
3 | async function getData() {
4 | const sql = neon(process.env.DATABASE_URL);
5 | const response = await sql`SELECT version()`;
6 | return response[0].version;
7 | }
8 |
9 | export default async function Page() {
10 | const data = await getData();
11 | return <>{data}>
12 | }
13 |
--------------------------------------------------------------------------------
/ai/langchain/chat-with-pdf-nextjs/.env.example:
--------------------------------------------------------------------------------
1 | # Postgres URL retrieved here: https://console.neon.tech
2 | POSTGRES_URL="postgresql://neondb_owner:...@ep-...us-east-1.aws.neon.tech/neondb?sslmode=require"
3 |
4 | # OpenAI key retrieved here: https://platform.openai.com/api-keys
5 | OPENAI_API_KEY="sk-..."
6 |
7 | # If want to use Ollama as LLM (OpenAI API key still needed)
8 | OLLAMA_ENDPOINT=""
9 |
--------------------------------------------------------------------------------
/ai/llamaindex/chat-with-pdf-nextjs/.env.example:
--------------------------------------------------------------------------------
1 | # Postgres URL retrieved here: https://console.neon.tech
2 | POSTGRES_URL="postgresql://neondb_owner:...@ep-...us-east-1.aws.neon.tech/neondb?sslmode=require"
3 |
4 | # OpenAI key retrieved here: https://platform.openai.com/api-keys
5 | OPENAI_API_KEY="sk-..."
6 |
7 | # If want to use Ollama as LLM (OpenAI API key still needed)
8 | OLLAMA_ENDPOINT=""
9 |
--------------------------------------------------------------------------------
/ai/llamaindex/semantic-search-nextjs/.env.example:
--------------------------------------------------------------------------------
1 | # Postgres URL retrieved here: https://console.neon.tech
2 | POSTGRES_URL="postgresql://neondb_owner:...@ep-...us-east-1.aws.neon.tech/neondb?sslmode=require"
3 |
4 | # OpenAI key retrieved here: https://platform.openai.com/api-keys
5 | OPENAI_API_KEY="sk-..."
6 |
7 | # If want to use Ollama as LLM (OpenAI API key still needed)
8 | OLLAMA_ENDPOINT=""
9 |
--------------------------------------------------------------------------------
/deploy-with-cloudflare-workers/my-neon-worker/src/index.js:
--------------------------------------------------------------------------------
1 | import { Client } from '@neondatabase/serverless';
2 |
3 | export default {
4 | async fetch(request, env, ctx) {
5 | const client = new Client(env.DATABASE_URL);
6 | await client.connect();
7 | const { rows } = await client.query('SELECT * FROM books_to_read;');
8 | return new Response(JSON.stringify(rows));
9 | },
10 | };
11 |
--------------------------------------------------------------------------------
/with-electricsql/react-app/.gitignore:
--------------------------------------------------------------------------------
1 | # Logs
2 | logs
3 | *.log
4 | npm-debug.log*
5 | yarn-debug.log*
6 | yarn-error.log*
7 | pnpm-debug.log*
8 | lerna-debug.log*
9 |
10 | node_modules
11 | dist
12 | dist-ssr
13 | *.local
14 |
15 | # Editor directories and files
16 | .vscode/*
17 | !.vscode/extensions.json
18 | .idea
19 | .DS_Store
20 | *.suo
21 | *.ntvs*
22 | *.njsproj
23 | *.sln
24 | *.sw?
25 |
--------------------------------------------------------------------------------
/with-fastify/plugins/sensible.js:
--------------------------------------------------------------------------------
1 | 'use strict'
2 |
3 | const fp = require('fastify-plugin')
4 |
5 | /**
6 | * This plugins adds some utilities to handle http errors
7 | *
8 | * @see https://github.com/fastify/fastify-sensible
9 | */
10 | module.exports = fp(async function (fastify, opts) {
11 | fastify.register(require('@fastify/sensible'), {
12 | errorHandler: false
13 | })
14 | })
15 |
--------------------------------------------------------------------------------
/with-nestjs/src/app.module.ts:
--------------------------------------------------------------------------------
1 | import { Module } from '@nestjs/common';
2 | import { AppController } from './app.controller';
3 | import { AppService } from './app.service';
4 | import { DatabaseModule } from './database/database.module';
5 |
6 | @Module({
7 | imports: [DatabaseModule],
8 | controllers: [AppController],
9 | providers: [AppService],
10 | })
11 | export class AppModule {}
12 |
--------------------------------------------------------------------------------
/with-tanstack-start/app.config.ts:
--------------------------------------------------------------------------------
1 | import { defineConfig } from "@tanstack/start/config";
2 | import tsConfigPaths from "vite-tsconfig-paths";
3 | import tailwindcss from "@tailwindcss/vite";
4 |
5 | export default defineConfig({
6 | vite: {
7 | plugins: [
8 | tailwindcss(),
9 | tsConfigPaths({
10 | projects: ["./tsconfig.json"],
11 | }),
12 | ],
13 | },
14 | });
15 |
--------------------------------------------------------------------------------
/with-wasp/.gitignore:
--------------------------------------------------------------------------------
1 | .wasp/
2 | node_modules/
3 | **/.DS_Store
4 |
5 | # We ignore env files recognized and used by Wasp.
6 | .env.server
7 | .env.client
8 |
9 | # To be extra safe, we by default ignore any files with `.env` extension in them.
10 | # If this is too agressive for you, consider allowing specific files with `!` operator,
11 | # or modify/delete these two lines.
12 | *.env
13 | *.env.*
14 |
--------------------------------------------------------------------------------
/with-nextjs-edge-functions/app/api/route.ts:
--------------------------------------------------------------------------------
1 | export const runtime = "edge";
2 |
3 | import { neon } from "@neondatabase/serverless";
4 |
5 | export async function GET() {
6 | if (!process.env.DATABASE_URL) return new Response(null, { status: 500 });
7 | const sql = neon(process.env.DATABASE_URL);
8 | const response = await sql`SELECT version()`;
9 | return new Response(response[0].version);
10 | }
11 |
--------------------------------------------------------------------------------
/ai/inngest/auto-embeddings-nextjs/src/inngest/client.ts:
--------------------------------------------------------------------------------
1 | import { Inngest } from "inngest";
2 |
3 | export const inngest = new Inngest({ id: "Auto Embeddings App" });
4 |
5 | // Define event types
6 | export type GenerateEmbeddingEvent = {
7 | name: "db/documents.inserted";
8 | data: {
9 | new: {
10 | id: number;
11 | title: string;
12 | content: string;
13 | };
14 | };
15 | };
16 |
--------------------------------------------------------------------------------
/deploy-with-cloudflare-pages/my-neon-page/.gitignore:
--------------------------------------------------------------------------------
1 | # Logs
2 | logs
3 | *.log
4 | npm-debug.log*
5 | yarn-debug.log*
6 | yarn-error.log*
7 | pnpm-debug.log*
8 | lerna-debug.log*
9 |
10 | node_modules
11 | dist
12 | dist-ssr
13 | *.local
14 |
15 | # Editor directories and files
16 | .vscode/*
17 | !.vscode/extensions.json
18 | .idea
19 | .DS_Store
20 | *.suo
21 | *.ntvs*
22 | *.njsproj
23 | *.sln
24 | *.sw?
25 |
--------------------------------------------------------------------------------
/deploy-with-deno/deno.lock:
--------------------------------------------------------------------------------
1 | {
2 | "version": "4",
3 | "specifiers": {
4 | "jsr:@neon/serverless@~0.10.1": "0.10.1"
5 | },
6 | "jsr": {
7 | "@neon/serverless@0.10.1": {
8 | "integrity": "81f8e1349d54d9c9fb9cf21e753460c360237ab00d04a4b710b4aff891182dfb"
9 | }
10 | },
11 | "workspace": {
12 | "dependencies": [
13 | "jsr:@neon/serverless@~0.10.1"
14 | ]
15 | }
16 | }
17 |
--------------------------------------------------------------------------------
/with-nextjs-drizzle-edge/lib/drizzle.server.ts:
--------------------------------------------------------------------------------
1 | import { neonConfig, Pool } from '@neondatabase/serverless'
2 | import { drizzle } from 'drizzle-orm/neon-serverless'
3 | import { WebSocket } from 'ws'
4 |
5 | neonConfig.webSocketConstructor = WebSocket
6 | neonConfig.poolQueryViaFetch = true
7 |
8 | const pool = new Pool({ connectionString: process.env.POSTGRES_URL })
9 |
10 | export default drizzle(pool)
11 |
--------------------------------------------------------------------------------
/with-react-router/vite.config.ts:
--------------------------------------------------------------------------------
1 | import { reactRouter } from "@react-router/dev/vite";
2 | import tailwindcss from "@tailwindcss/vite";
3 | import { defineConfig } from "vite";
4 | import tsconfigPaths from "vite-tsconfig-paths";
5 |
6 | export default defineConfig({
7 | plugins: [tailwindcss(), reactRouter(), tsconfigPaths()],
8 | build: {
9 | cssMinify: true,
10 | ssr: false,
11 | },
12 | });
13 |
--------------------------------------------------------------------------------
/with-golang/go.mod:
--------------------------------------------------------------------------------
1 | module neon-go-quickstart
2 |
3 | go 1.24.5
4 |
5 | require (
6 | github.com/jackc/pgx/v5 v5.7.5
7 | github.com/joho/godotenv v1.5.1
8 | )
9 |
10 | require (
11 | github.com/jackc/pgpassfile v1.0.0 // indirect
12 | github.com/jackc/pgservicefile v0.0.0-20240606120523-5a60cdf6a761 // indirect
13 | golang.org/x/crypto v0.37.0 // indirect
14 | golang.org/x/text v0.24.0 // indirect
15 | )
16 |
--------------------------------------------------------------------------------
/with-analog/src/app/app.config.server.ts:
--------------------------------------------------------------------------------
1 | import { mergeApplicationConfig, ApplicationConfig } from '@angular/core';
2 | import { provideServerRendering } from '@angular/platform-server';
3 |
4 | import { appConfig } from './app.config';
5 |
6 | const serverConfig: ApplicationConfig = {
7 | providers: [provideServerRendering()],
8 | };
9 |
10 | export const config = mergeApplicationConfig(appConfig, serverConfig);
11 |
--------------------------------------------------------------------------------
/with-micronaut-kotlin/src/main/kotlin/com/example/repository/BookRepository.kt:
--------------------------------------------------------------------------------
1 | package com.example.repository
2 |
3 | import com.example.entity.Book
4 | import io.micronaut.data.jdbc.annotation.JdbcRepository
5 | import io.micronaut.data.model.query.builder.sql.Dialect
6 | import io.micronaut.data.repository.CrudRepository
7 |
8 | @JdbcRepository(dialect = Dialect.POSTGRES)
9 | interface BookRepository : CrudRepository
--------------------------------------------------------------------------------
/deploy-with-cloudflare-pages/functions/books/index.js:
--------------------------------------------------------------------------------
1 | import { Client } from "@neondatabase/serverless";
2 |
3 | export async function onRequestGet(context) {
4 | const client = new Client(context.env.DATABASE_URL);
5 | await client.connect();
6 | // Logic to fetch books from your database
7 | const { rows } = await client.query("SELECT * FROM books_to_read;");
8 | return new Response(JSON.stringify(rows));
9 | }
10 |
--------------------------------------------------------------------------------
/with-node-postgres/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "with-node-postgres",
3 | "version": "1.0.0",
4 | "type": "module",
5 | "description": "",
6 | "main": "index.js",
7 | "scripts": {
8 | "test": "echo \"Error: no test specified\" && exit 1"
9 | },
10 | "keywords": [],
11 | "author": "",
12 | "license": "ISC",
13 | "dependencies": {
14 | "dotenv": "^17.2.1",
15 | "pg": "^8.16.3"
16 | }
17 | }
18 |
--------------------------------------------------------------------------------
/with-analog/tsconfig.app.json:
--------------------------------------------------------------------------------
1 | /* To learn more about this file see: https://angular.io/config/tsconfig. */
2 | {
3 | "extends": "./tsconfig.json",
4 | "compilerOptions": {
5 | "outDir": "./out-tsc/app",
6 | "types": []
7 | },
8 | "files": ["src/main.ts", "src/main.server.ts"],
9 | "include": [
10 | "src/**/*.d.ts",
11 | "src/app/pages/**/*.page.ts",
12 | "src/server/middleware/**/*.ts"
13 | ]
14 | }
15 |
--------------------------------------------------------------------------------
/with-angular/src/app/app.config.server.ts:
--------------------------------------------------------------------------------
1 | import { mergeApplicationConfig, ApplicationConfig } from '@angular/core';
2 | import { provideServerRendering } from '@angular/platform-server';
3 | import { appConfig } from './app.config';
4 |
5 | const serverConfig: ApplicationConfig = {
6 | providers: [
7 | provideServerRendering()
8 | ]
9 | };
10 |
11 | export const config = mergeApplicationConfig(appConfig, serverConfig);
12 |
--------------------------------------------------------------------------------
/with-dart/index.dart:
--------------------------------------------------------------------------------
1 | import 'dart:io';
2 | import 'package:postgres/postgres.dart';
3 |
4 | void main() async {
5 | final conn = await Connection.open(Endpoint(
6 | host: 'ep-...us-east-1.aws.neon.tech',
7 | database: 'neondb',
8 | username: 'neondb_owner',
9 | password: '...',
10 | ));
11 | final result = await conn.execute("SELECT * from playing_with_neon;");
12 | print(result);
13 | exit(0);
14 | }
15 |
--------------------------------------------------------------------------------
/with-laravel/artisan:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env php
2 | handleCommand(new ArgvInput);
14 |
15 | exit($status);
16 |
--------------------------------------------------------------------------------
/with-node-postgres-js/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "with-node-postgres",
3 | "version": "1.0.0",
4 | "type": "module",
5 | "description": "",
6 | "main": "index.js",
7 | "scripts": {
8 | "test": "echo \"Error: no test specified\" && exit 1"
9 | },
10 | "keywords": [],
11 | "author": "",
12 | "license": "ISC",
13 | "dependencies": {
14 | "dotenv": "^17.2.1",
15 | "postgres": "^3.4.7"
16 | }
17 | }
18 |
--------------------------------------------------------------------------------
/with_phoenix/priv/repo/seeds.exs:
--------------------------------------------------------------------------------
1 | # Script for populating the database. You can run it as:
2 | #
3 | # mix run priv/repo/seeds.exs
4 | #
5 | # Inside the script, you can read and write to any of your
6 | # repositories directly:
7 | #
8 | # WithPhoenix.Repo.insert!(%WithPhoenix.SomeSchema{})
9 | #
10 | # We recommend using the bang functions (`insert!`, `update!`
11 | # and so on) as they will fail if something goes wrong.
12 |
--------------------------------------------------------------------------------
/with-nextjs-prisma/prisma/migrations/20230226214531_initial_migration/migration.sql:
--------------------------------------------------------------------------------
1 | -- CreateTable
2 | CREATE TABLE "Element" (
3 | "id" TEXT NOT NULL,
4 | "elementName" TEXT NOT NULL,
5 | "atomicNumber" INTEGER NOT NULL,
6 | "symbol" TEXT NOT NULL,
7 |
8 | CONSTRAINT "Element_pkey" PRIMARY KEY ("id")
9 | );
10 |
11 | -- CreateIndex
12 | CREATE UNIQUE INDEX "Element_atomicNumber_key" ON "Element"("atomicNumber");
13 |
--------------------------------------------------------------------------------
/with-nextjs-drizzle-edge/app/globals.css:
--------------------------------------------------------------------------------
1 | @tailwind base;
2 | @tailwind components;
3 | @tailwind utilities;
4 |
5 | :root {
6 | --foreground-rgb: 0, 0, 0;
7 | --background-start-rgb: 214, 219, 220;
8 | --background-end-rgb: 255, 255, 255;
9 | }
10 |
11 | body {
12 | color: rgb(var(--foreground-rgb));
13 | background: linear-gradient(to bottom, transparent, rgb(var(--background-end-rgb))) rgb(var(--background-start-rgb));
14 | }
15 |
--------------------------------------------------------------------------------
/with-nextjs-prisma-edge/app/globals.css:
--------------------------------------------------------------------------------
1 | @tailwind base;
2 | @tailwind components;
3 | @tailwind utilities;
4 |
5 | :root {
6 | --foreground-rgb: 0, 0, 0;
7 | --background-start-rgb: 214, 219, 220;
8 | --background-end-rgb: 255, 255, 255;
9 | }
10 |
11 | body {
12 | color: rgb(var(--foreground-rgb));
13 | background: linear-gradient(to bottom, transparent, rgb(var(--background-end-rgb))) rgb(var(--background-start-rgb));
14 | }
15 |
--------------------------------------------------------------------------------
/with-nextjs-prisma/prisma/schema.prisma:
--------------------------------------------------------------------------------
1 | generator client {
2 | provider = "prisma-client-js"
3 | }
4 |
5 | datasource db {
6 | provider = "postgresql"
7 | url = env("DATABASE_URL")
8 | directUrl = env("DIRECT_DATABASE_URL")
9 | }
10 |
11 | model Element {
12 | id String @id @default(cuid())
13 | elementName String
14 | atomicNumber Int @unique
15 | symbol String
16 | }
17 |
--------------------------------------------------------------------------------
/with-waku/tsconfig.json:
--------------------------------------------------------------------------------
1 | {
2 | "compilerOptions": {
3 | "strict": true,
4 | "target": "esnext",
5 | "downlevelIteration": true,
6 | "esModuleInterop": true,
7 | "module": "esnext",
8 | "moduleResolution": "bundler",
9 | "skipLibCheck": true,
10 | "noUncheckedIndexedAccess": true,
11 | "exactOptionalPropertyTypes": true,
12 | "types": ["react/experimental"],
13 | "jsx": "react-jsx"
14 | }
15 | }
16 |
--------------------------------------------------------------------------------
/deploy-with-cloudflare-pages/my-neon-page/functions/books/index.js:
--------------------------------------------------------------------------------
1 | import { Client } from "@neondatabase/serverless";
2 |
3 | export async function onRequestGet(context) {
4 | const client = new Client(context.env.DATABASE_URL);
5 | await client.connect();
6 |
7 | // Logic to fetch books from your database
8 | const { rows } = await client.query("SELECT * FROM books_to_read;");
9 | return new Response(JSON.stringify(rows));
10 | }
11 |
--------------------------------------------------------------------------------
/with-dotnet-entity-framework/NeonEfExample/appsettings.Development.json:
--------------------------------------------------------------------------------
1 | {
2 | "Logging": {
3 | "LogLevel": {
4 | "Default": "Information",
5 | "Microsoft.AspNetCore": "Warning"
6 | }
7 | },
8 | "ConnectionStrings": {
9 | "DefaultConnection": "Host=your-neon-host;Database=your-db;Username=your-username;Password=your-password;SSL Mode=Require;Trust Server Certificate=true;MaxPoolSize=20"
10 | }
11 | }
12 |
--------------------------------------------------------------------------------
/ai/hybrid-search-nextjs/components.json:
--------------------------------------------------------------------------------
1 | {
2 | "$schema": "https://ui.shadcn.com/schema.json",
3 | "style": "default",
4 | "rsc": true,
5 | "tsx": true,
6 | "tailwind": {
7 | "config": "tailwind.config.ts",
8 | "css": "app/globals.css",
9 | "baseColor": "slate",
10 | "cssVariables": true,
11 | "prefix": ""
12 | },
13 | "aliases": {
14 | "components": "@/components",
15 | "utils": "@/lib/utils"
16 | }
17 | }
18 |
--------------------------------------------------------------------------------
/ai/langchain/rag-nextjs/components.json:
--------------------------------------------------------------------------------
1 | {
2 | "$schema": "https://ui.shadcn.com/schema.json",
3 | "style": "default",
4 | "rsc": true,
5 | "tsx": true,
6 | "tailwind": {
7 | "config": "tailwind.config.ts",
8 | "css": "app/globals.css",
9 | "baseColor": "slate",
10 | "cssVariables": true,
11 | "prefix": ""
12 | },
13 | "aliases": {
14 | "components": "@/components",
15 | "utils": "@/lib/utils"
16 | }
17 | }
18 |
--------------------------------------------------------------------------------
/ai/llamaindex/rag-nextjs/components.json:
--------------------------------------------------------------------------------
1 | {
2 | "$schema": "https://ui.shadcn.com/schema.json",
3 | "style": "default",
4 | "rsc": true,
5 | "tsx": true,
6 | "tailwind": {
7 | "config": "tailwind.config.ts",
8 | "css": "app/globals.css",
9 | "baseColor": "slate",
10 | "cssVariables": true,
11 | "prefix": ""
12 | },
13 | "aliases": {
14 | "components": "@/components",
15 | "utils": "@/lib/utils"
16 | }
17 | }
18 |
--------------------------------------------------------------------------------
/deploy-with-cloudflare-pages/index.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 | Vite + React
8 |
9 |
10 |
11 |
12 |
13 |
14 |
--------------------------------------------------------------------------------
/with-analog/src/app/pages/index.page.ts:
--------------------------------------------------------------------------------
1 | import { load } from './index.server';
2 | import { Component } from '@angular/core';
3 | import { injectLoad } from '@analogjs/router';
4 | import { toSignal } from '@angular/core/rxjs-interop';
5 |
6 | @Component({
7 | standalone: true,
8 | template: `{{ data()['version'] }}`,
9 | })
10 | export default class BlogComponent {
11 | data = toSignal(injectLoad(), { requireSync: true });
12 | }
13 |
--------------------------------------------------------------------------------
/with-neon-serverless/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "with-neon-serverless",
3 | "version": "1.0.0",
4 | "type": "module",
5 | "description": "",
6 | "main": "index.js",
7 | "scripts": {
8 | "test": "echo \"Error: no test specified\" && exit 1"
9 | },
10 | "keywords": [],
11 | "author": "",
12 | "license": "ISC",
13 | "dependencies": {
14 | "@neondatabase/serverless": "^1.0.1",
15 | "dotenv": "^17.2.1"
16 | }
17 | }
18 |
--------------------------------------------------------------------------------
/with-nextjs-drizzle-local-vercel/app/globals.css:
--------------------------------------------------------------------------------
1 | @tailwind base;
2 | @tailwind components;
3 | @tailwind utilities;
4 |
5 | :root {
6 | --foreground-rgb: 0, 0, 0;
7 | --background-start-rgb: 214, 219, 220;
8 | --background-end-rgb: 255, 255, 255;
9 | }
10 |
11 | body {
12 | color: rgb(var(--foreground-rgb));
13 | background: linear-gradient(to bottom, transparent, rgb(var(--background-end-rgb))) rgb(var(--background-start-rgb));
14 | }
15 |
--------------------------------------------------------------------------------
/ai/aws-bedrock/chatbot-nextjs/components.json:
--------------------------------------------------------------------------------
1 | {
2 | "$schema": "https://ui.shadcn.com/schema.json",
3 | "style": "default",
4 | "rsc": true,
5 | "tsx": true,
6 | "tailwind": {
7 | "config": "tailwind.config.ts",
8 | "css": "app/globals.css",
9 | "baseColor": "slate",
10 | "cssVariables": true,
11 | "prefix": ""
12 | },
13 | "aliases": {
14 | "components": "@/components",
15 | "utils": "@/lib/utils"
16 | }
17 | }
18 |
--------------------------------------------------------------------------------
/ai/langchain/chatbot-nextjs/components.json:
--------------------------------------------------------------------------------
1 | {
2 | "$schema": "https://ui.shadcn.com/schema.json",
3 | "style": "default",
4 | "rsc": true,
5 | "tsx": true,
6 | "tailwind": {
7 | "config": "tailwind.config.ts",
8 | "css": "app/globals.css",
9 | "baseColor": "slate",
10 | "cssVariables": true,
11 | "prefix": ""
12 | },
13 | "aliases": {
14 | "components": "@/components",
15 | "utils": "@/lib/utils"
16 | }
17 | }
18 |
--------------------------------------------------------------------------------
/ai/llamaindex/chatbot-nextjs/components.json:
--------------------------------------------------------------------------------
1 | {
2 | "$schema": "https://ui.shadcn.com/schema.json",
3 | "style": "default",
4 | "rsc": true,
5 | "tsx": true,
6 | "tailwind": {
7 | "config": "tailwind.config.ts",
8 | "css": "app/globals.css",
9 | "baseColor": "slate",
10 | "cssVariables": true,
11 | "prefix": ""
12 | },
13 | "aliases": {
14 | "components": "@/components",
15 | "utils": "@/lib/utils"
16 | }
17 | }
18 |
--------------------------------------------------------------------------------
/with-astro/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "type": "module",
3 | "name": "with-astro",
4 | "scripts": {
5 | "dev": "astro dev",
6 | "start": "astro dev",
7 | "build": "astro check && astro build",
8 | "preview": "astro preview",
9 | "astro": "astro"
10 | },
11 | "dependencies": {
12 | "@astrojs/check": "^0.7.0",
13 | "@neondatabase/serverless": "^1.0.0",
14 | "astro": "^4.9.2",
15 | "typescript": "^5.4.5"
16 | }
17 | }
18 |
--------------------------------------------------------------------------------
/with-java-jdbc/src/test/java/com/neon/quickstart/AppTest.java:
--------------------------------------------------------------------------------
1 | package com.neon.quickstart;
2 |
3 | import static org.junit.jupiter.api.Assertions.assertTrue;
4 |
5 | import org.junit.jupiter.api.Test;
6 |
7 | /**
8 | * Unit test for simple App.
9 | */
10 | public class AppTest {
11 |
12 | /**
13 | * Rigorous Test :-)
14 | */
15 | @Test
16 | public void shouldAnswerWithTrue() {
17 | assertTrue(true);
18 | }
19 | }
20 |
--------------------------------------------------------------------------------
/with-nextjs-prisma-cloudflare-workers/app/globals.css:
--------------------------------------------------------------------------------
1 | @tailwind base;
2 | @tailwind components;
3 | @tailwind utilities;
4 |
5 | :root {
6 | --foreground-rgb: 0, 0, 0;
7 | --background-start-rgb: 214, 219, 220;
8 | --background-end-rgb: 255, 255, 255;
9 | }
10 |
11 | body {
12 | color: rgb(var(--foreground-rgb));
13 | background: linear-gradient(to bottom, transparent, rgb(var(--background-end-rgb))) rgb(var(--background-start-rgb));
14 | }
15 |
--------------------------------------------------------------------------------
/with-remix/vite.config.ts:
--------------------------------------------------------------------------------
1 | import { vitePlugin as remix } from "@remix-run/dev";
2 | import { defineConfig } from "vite";
3 | import tsconfigPaths from "vite-tsconfig-paths";
4 |
5 | export default defineConfig({
6 | plugins: [
7 | remix({
8 | future: {
9 | v3_fetcherPersist: true,
10 | v3_relativeSplatPath: true,
11 | v3_throwAbortReason: true,
12 | },
13 | }),
14 | tsconfigPaths(),
15 | ],
16 | });
17 |
--------------------------------------------------------------------------------
/ai/langchain/chat-with-pdf-nextjs/components.json:
--------------------------------------------------------------------------------
1 | {
2 | "$schema": "https://ui.shadcn.com/schema.json",
3 | "style": "default",
4 | "rsc": true,
5 | "tsx": true,
6 | "tailwind": {
7 | "config": "tailwind.config.ts",
8 | "css": "app/globals.css",
9 | "baseColor": "slate",
10 | "cssVariables": true,
11 | "prefix": ""
12 | },
13 | "aliases": {
14 | "components": "@/components",
15 | "utils": "@/lib/utils"
16 | }
17 | }
18 |
--------------------------------------------------------------------------------
/ai/llamaindex/chat-with-pdf-nextjs/components.json:
--------------------------------------------------------------------------------
1 | {
2 | "$schema": "https://ui.shadcn.com/schema.json",
3 | "style": "default",
4 | "rsc": true,
5 | "tsx": true,
6 | "tailwind": {
7 | "config": "tailwind.config.ts",
8 | "css": "app/globals.css",
9 | "baseColor": "slate",
10 | "cssVariables": true,
11 | "prefix": ""
12 | },
13 | "aliases": {
14 | "components": "@/components",
15 | "utils": "@/lib/utils"
16 | }
17 | }
18 |
--------------------------------------------------------------------------------
/with-dotnet-entity-framework/NeonEfExample/appsettings.json:
--------------------------------------------------------------------------------
1 | {
2 | "Logging": {
3 | "LogLevel": {
4 | "Default": "Information",
5 | "Microsoft.AspNetCore": "Warning"
6 | }
7 | },
8 | "AllowedHosts": "*",
9 | "ConnectionStrings": {
10 | "DefaultConnection": "Host=your-neon-host;Database=your-db;Username=your-username;Password=your-password;SSL Mode=Require;Trust Server Certificate=true;MaxPoolSize=20"
11 | }
12 | }
13 |
--------------------------------------------------------------------------------
/ai/langchain/semantic-search-nextjs/components.json:
--------------------------------------------------------------------------------
1 | {
2 | "$schema": "https://ui.shadcn.com/schema.json",
3 | "style": "default",
4 | "rsc": true,
5 | "tsx": true,
6 | "tailwind": {
7 | "config": "tailwind.config.ts",
8 | "css": "app/globals.css",
9 | "baseColor": "slate",
10 | "cssVariables": true,
11 | "prefix": ""
12 | },
13 | "aliases": {
14 | "components": "@/components",
15 | "utils": "@/lib/utils"
16 | }
17 | }
18 |
--------------------------------------------------------------------------------
/ai/llamaindex/semantic-search-nextjs/components.json:
--------------------------------------------------------------------------------
1 | {
2 | "$schema": "https://ui.shadcn.com/schema.json",
3 | "style": "default",
4 | "rsc": true,
5 | "tsx": true,
6 | "tailwind": {
7 | "config": "tailwind.config.ts",
8 | "css": "app/globals.css",
9 | "baseColor": "slate",
10 | "cssVariables": true,
11 | "prefix": ""
12 | },
13 | "aliases": {
14 | "components": "@/components",
15 | "utils": "@/lib/utils"
16 | }
17 | }
18 |
--------------------------------------------------------------------------------
/deploy-with-cloudflare-pages/my-neon-page/index.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 | Vite + React
8 |
9 |
10 |
11 |
12 |
13 |
14 |
--------------------------------------------------------------------------------
/ai/llamaindex/rag-nextjs/lib/vectorStore.ts:
--------------------------------------------------------------------------------
1 | import { OpenAIEmbedding, Settings } from 'llamaindex'
2 | import { PGVectorStore } from 'llamaindex/storage/vectorStore/PGVectorStore'
3 |
4 | Settings.embedModel = new OpenAIEmbedding({
5 | dimensions: 512,
6 | model: 'text-embedding-3-small',
7 | })
8 |
9 | const vectorStore = new PGVectorStore({
10 | dimensions: 512,
11 | connectionString: process.env.POSTGRES_URL,
12 | })
13 |
14 | export default vectorStore
15 |
--------------------------------------------------------------------------------
/ai/llamaindex/reverse-image-search-nextjs/components.json:
--------------------------------------------------------------------------------
1 | {
2 | "$schema": "https://ui.shadcn.com/schema.json",
3 | "style": "default",
4 | "rsc": true,
5 | "tsx": true,
6 | "tailwind": {
7 | "config": "tailwind.config.ts",
8 | "css": "app/globals.css",
9 | "baseColor": "slate",
10 | "cssVariables": true,
11 | "prefix": ""
12 | },
13 | "aliases": {
14 | "components": "@/components",
15 | "utils": "@/lib/utils"
16 | }
17 | }
18 |
--------------------------------------------------------------------------------
/with-dotnet-entity-framework/NeonEfExample/Data/ApplicationDbContext.cs:
--------------------------------------------------------------------------------
1 | using Microsoft.EntityFrameworkCore;
2 | using NeonEfExample.Models;
3 |
4 | namespace NeonEfExample.Data
5 | {
6 | public class ApplicationDbContext : DbContext
7 | {
8 | public ApplicationDbContext(DbContextOptions options)
9 | : base(options)
10 | {
11 | }
12 |
13 | public DbSet Todos => Set();
14 | }
15 | }
--------------------------------------------------------------------------------
/with-encore/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "neon-encore-example",
3 | "version": "1.0.0",
4 | "description": "Example Encore.ts application with Neon Postgres",
5 | "private": true,
6 | "type": "module",
7 | "scripts": {
8 | "dev": "encore run",
9 | "test": "encore test"
10 | },
11 | "dependencies": {
12 | "encore.dev": "^1.53.0"
13 | },
14 | "devDependencies": {
15 | "@types/node": "^22.0.0",
16 | "typescript": "^5.6.0"
17 | }
18 | }
--------------------------------------------------------------------------------
/with-hyperdrive/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "with-hyperdrive",
3 | "scripts": {
4 | "dev": "wrangler dev",
5 | "deploy": "wrangler deploy",
6 | "cf-typegen": "wrangler types"
7 | },
8 | "devDependencies": {
9 | "@cloudflare/workers-types": "^4.20241205.0",
10 | "typescript": "^5.5.2",
11 | "wrangler": "^3.95.0"
12 | },
13 | "dependencies": {
14 | "@neondatabase/serverless": "^1.0.0",
15 | "postgres": "^3.4.5"
16 | }
17 | }
18 |
--------------------------------------------------------------------------------
/with-nextjs-drizzle-local-vercel/drizzle.config.ts:
--------------------------------------------------------------------------------
1 | import { defineConfig } from 'drizzle-kit'
2 |
3 | const url = process.env.NODE_ENV === 'production' ? process.env.POSTGRES_URL : process.env.LOCAL_POSTGRES_URL
4 | if (!url) throw new Error(`Connection string to ${process.env.NODE_ENV ? 'Neon' : 'local'} Postgres not found.`)
5 |
6 | export default defineConfig({
7 | dialect: 'postgresql',
8 | dbCredentials: { url },
9 | schema: './lib/schema.ts',
10 | })
11 |
--------------------------------------------------------------------------------
/with-nextjs-serverless-functions/pages/api/index.ts:
--------------------------------------------------------------------------------
1 | import type { NextApiRequest, NextApiResponse } from "next";
2 |
3 | import { neon } from "@neondatabase/serverless";
4 |
5 | const sql = neon(process.env.DATABASE_URL);
6 |
7 | export default async function handler(
8 | req: NextApiRequest,
9 | res: NextApiResponse
10 | ) {
11 | const response = await sql`SELECT version()`;
12 | res.status(200).json({
13 | message: response[0].version,
14 | });
15 | }
16 |
--------------------------------------------------------------------------------
/ai/llamaindex/chatbot-nextjs/lib/vectorStore.ts:
--------------------------------------------------------------------------------
1 | import { OpenAIEmbedding, Settings } from 'llamaindex'
2 | import { PGVectorStore } from 'llamaindex/storage/vectorStore/PGVectorStore'
3 |
4 | Settings.embedModel = new OpenAIEmbedding({
5 | dimensions: 512,
6 | model: 'text-embedding-3-small',
7 | })
8 |
9 | const vectorStore = new PGVectorStore({
10 | dimensions: 512,
11 | connectionString: process.env.POSTGRES_URL,
12 | })
13 |
14 | export default vectorStore
15 |
--------------------------------------------------------------------------------
/with-nextjs-get-static-props/pages/index.tsx:
--------------------------------------------------------------------------------
1 | import { neon } from "@neondatabase/serverless";
2 |
3 | export async function getStaticProps() {
4 | if (!process.env.DATABASE_URL) return { props: { data: "" } };
5 | const sql = neon(process.env.DATABASE_URL);
6 | const response = await sql`SELECT version()`;
7 | return { props: { data: response[0].version } };
8 | }
9 |
10 | export default function Page({ data }: { data: string }) {
11 | return <>{data}>;
12 | }
13 |
--------------------------------------------------------------------------------
/ai/llamaindex/semantic-search-nextjs/lib/vectorStore.ts:
--------------------------------------------------------------------------------
1 | import { OpenAIEmbedding, Settings } from 'llamaindex'
2 | import { PGVectorStore } from 'llamaindex/storage/vectorStore/PGVectorStore'
3 |
4 | Settings.embedModel = new OpenAIEmbedding({
5 | dimensions: 512,
6 | model: 'text-embedding-3-small',
7 | })
8 |
9 | const vectorStore = new PGVectorStore({
10 | dimensions: 512,
11 | connectionString: process.env.POSTGRES_URL,
12 | })
13 |
14 | export default vectorStore
15 |
--------------------------------------------------------------------------------
/with-laravel/tests/Feature/ExampleTest.php:
--------------------------------------------------------------------------------
1 | get('/');
16 |
17 | $response->assertStatus(200);
18 | }
19 | }
20 |
--------------------------------------------------------------------------------
/with_phoenix/test/with_phoenix_web/controllers/error_json_test.exs:
--------------------------------------------------------------------------------
1 | defmodule WithPhoenixWeb.ErrorJSONTest do
2 | use WithPhoenixWeb.ConnCase, async: true
3 |
4 | test "renders 404" do
5 | assert WithPhoenixWeb.ErrorJSON.render("404.json", %{}) == %{errors: %{detail: "Not Found"}}
6 | end
7 |
8 | test "renders 500" do
9 | assert WithPhoenixWeb.ErrorJSON.render("500.json", %{}) ==
10 | %{errors: %{detail: "Internal Server Error"}}
11 | end
12 | end
13 |
--------------------------------------------------------------------------------
/ai/inngest/rag-starter-nextjs/src/app/globals.css:
--------------------------------------------------------------------------------
1 | @tailwind base;
2 | @tailwind components;
3 | @tailwind utilities;
4 |
5 | :root {
6 | --background: #ffffff;
7 | --foreground: #171717;
8 | }
9 |
10 | @media (prefers-color-scheme: dark) {
11 | :root {
12 | --background: #0a0a0a;
13 | --foreground: #ededed;
14 | }
15 | }
16 |
17 | body {
18 | color: var(--foreground);
19 | background: var(--background);
20 | font-family: Arial, Helvetica, sans-serif;
21 | }
22 |
--------------------------------------------------------------------------------
/ai/langchain/chatbot-nextjs/lib/vectorStore.ts:
--------------------------------------------------------------------------------
1 | import { NeonPostgres } from '@langchain/community/vectorstores/neon'
2 | import { OpenAIEmbeddings } from '@langchain/openai'
3 |
4 | const embeddings = new OpenAIEmbeddings({
5 | dimensions: 512,
6 | model: "text-embedding-3-small"
7 | })
8 |
9 | export default async function loadVectorStore() {
10 | return await NeonPostgres.initialize(embeddings, {
11 | connectionString: process.env.POSTGRES_URL as string,
12 | })
13 | }
14 |
--------------------------------------------------------------------------------
/ai/langchain/rag-nextjs/lib/vectorStore.ts:
--------------------------------------------------------------------------------
1 | import { NeonPostgres } from '@langchain/community/vectorstores/neon'
2 | import { OpenAIEmbeddings } from '@langchain/openai'
3 |
4 | const embeddings = new OpenAIEmbeddings({
5 | dimensions: 512,
6 | model: "text-embedding-3-small"
7 | })
8 |
9 | export default async function loadVectorStore() {
10 | return await NeonPostgres.initialize(embeddings, {
11 | connectionString: process.env.POSTGRES_URL as string,
12 | })
13 | }
14 |
--------------------------------------------------------------------------------
/with-hono/.gitignore:
--------------------------------------------------------------------------------
1 | # dev
2 | .vercel/
3 | .yarn/
4 | !.yarn/releases
5 | .vscode/*
6 | !.vscode/launch.json
7 | !.vscode/*.code-snippets
8 | .idea/workspace.xml
9 | .idea/usage.statistics.xml
10 | .idea/shelf
11 |
12 | # deps
13 | node_modules/
14 |
15 | # env
16 | .env
17 | .env.production
18 |
19 | # logs
20 | logs/
21 | *.log
22 | npm-debug.log*
23 | yarn-debug.log*
24 | yarn-error.log*
25 | pnpm-debug.log*
26 | lerna-debug.log*
27 |
28 | # misc
29 | .DS_Store
30 | .vercel
31 |
--------------------------------------------------------------------------------
/with-knex/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "type": "module",
3 | "name": "with-knex",
4 | "scripts": {
5 | "test": "tsx index.tsx",
6 | "fmt": "prettier --write '**/*' --ignore-unknown"
7 | },
8 | "dependencies": {
9 | "@neondatabase/serverless": "^1.0.0",
10 | "dotenv": "^16.4.5",
11 | "knex": "^3.1.0",
12 | "pg": "^8.12.0",
13 | "pg-native": "^3.1.0"
14 | },
15 | "devDependencies": {
16 | "prettier": "^3.3.3",
17 | "tsx": "^4.16.4"
18 | }
19 | }
20 |
--------------------------------------------------------------------------------
/with-micronaut-kotlin/micronaut-cli.yml:
--------------------------------------------------------------------------------
1 | applicationType: default
2 | defaultPackage: with.micronaut.kotlin
3 | testFramework: junit
4 | sourceLanguage: kotlin
5 | buildTool: gradle_kotlin
6 | features: [app-name, data, data-jdbc, flyway, gradle, http-client-test, jdbc-hikari, junit, kotlin, kotlin-application, ksp, logback, micronaut-aot, micronaut-build, micronaut-http-validation, netty-server, postgres, readme, serialization-jackson, shade, static-resources, test-resources, yaml, yaml-build]
7 |
--------------------------------------------------------------------------------
/with-nextjs-get-server-side-props/pages/index.tsx:
--------------------------------------------------------------------------------
1 | import { neon } from "@neondatabase/serverless";
2 |
3 | export async function getServerSideProps() {
4 | if (!process.env.DATABASE_URL) return { props: { data: "" } };
5 | const sql = neon(process.env.DATABASE_URL);
6 | const response = await sql`SELECT version()`;
7 | return { props: { data: response[0].version } };
8 | }
9 |
10 | export default function Page({ data }: { data: string }) {
11 | return <>{data}>;
12 | }
13 |
--------------------------------------------------------------------------------
/with-nextjs-prisma-edge/app/api/users/route.ts:
--------------------------------------------------------------------------------
1 | export const runtime = 'edge'
2 |
3 | export const dynamic = 'force-dynamic'
4 |
5 | export const fetchCache = 'force-no-store'
6 |
7 | import prisma from '@/lib/prisma.server'
8 |
9 | export async function GET() {
10 | const startTime = Date.now()
11 | const users = await prisma.users.findMany()
12 | await prisma.$disconnect()
13 | const duration = Date.now() - startTime
14 | return Response.json({ users, duration })
15 | }
16 |
--------------------------------------------------------------------------------
/ai/inngest/auto-embeddings-nextjs/src/app/globals.css:
--------------------------------------------------------------------------------
1 | @tailwind base;
2 | @tailwind components;
3 | @tailwind utilities;
4 |
5 | :root {
6 | --background: #ffffff;
7 | --foreground: #171717;
8 | }
9 |
10 | @media (prefers-color-scheme: dark) {
11 | :root {
12 | --background: #0a0a0a;
13 | --foreground: #ededed;
14 | }
15 | }
16 |
17 | body {
18 | color: var(--foreground);
19 | background: var(--background);
20 | font-family: Arial, Helvetica, sans-serif;
21 | }
22 |
--------------------------------------------------------------------------------
/with-django/myproject/asgi.py:
--------------------------------------------------------------------------------
1 | """
2 | ASGI config for myproject project.
3 |
4 | It exposes the ASGI callable as a module-level variable named ``application``.
5 |
6 | For more information on this file, see
7 | https://docs.djangoproject.com/en/5.0/howto/deployment/asgi/
8 | """
9 |
10 | import os
11 |
12 | from django.core.asgi import get_asgi_application
13 |
14 | os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'myproject.settings')
15 |
16 | application = get_asgi_application()
17 |
--------------------------------------------------------------------------------
/with-django/myproject/wsgi.py:
--------------------------------------------------------------------------------
1 | """
2 | WSGI config for myproject project.
3 |
4 | It exposes the WSGI callable as a module-level variable named ``application``.
5 |
6 | For more information on this file, see
7 | https://docs.djangoproject.com/en/5.0/howto/deployment/wsgi/
8 | """
9 |
10 | import os
11 |
12 | from django.core.wsgi import get_wsgi_application
13 |
14 | os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'myproject.settings')
15 |
16 | application = get_wsgi_application()
17 |
--------------------------------------------------------------------------------
/with-tanstack-start/app/router.tsx:
--------------------------------------------------------------------------------
1 | import { createRouter as createTanStackRouter } from "@tanstack/react-router";
2 | import { routeTree } from "./routeTree.gen";
3 |
4 | export function createRouter() {
5 | const router = createTanStackRouter({
6 | routeTree,
7 | scrollRestoration: true,
8 | });
9 |
10 | return router;
11 | }
12 |
13 | declare module "@tanstack/react-router" {
14 | interface Register {
15 | router: ReturnType;
16 | }
17 | }
18 |
--------------------------------------------------------------------------------
/ai/langchain/chat-with-pdf-nextjs/lib/vectorStore.ts:
--------------------------------------------------------------------------------
1 | import { NeonPostgres } from '@langchain/community/vectorstores/neon'
2 | import { OpenAIEmbeddings } from '@langchain/openai'
3 |
4 | const embeddings = new OpenAIEmbeddings({
5 | dimensions: 512,
6 | model: "text-embedding-3-small"
7 | })
8 |
9 | export default async function loadVectorStore() {
10 | return await NeonPostgres.initialize(embeddings, {
11 | connectionString: process.env.POSTGRES_URL as string,
12 | })
13 | }
14 |
--------------------------------------------------------------------------------
/ai/langchain/semantic-search-nextjs/lib/vectorStore.ts:
--------------------------------------------------------------------------------
1 | import { NeonPostgres } from '@langchain/community/vectorstores/neon'
2 | import { OpenAIEmbeddings } from '@langchain/openai'
3 |
4 | const embeddings = new OpenAIEmbeddings({
5 | dimensions: 512,
6 | model: "text-embedding-3-small"
7 | })
8 |
9 | export default async function loadVectorStore() {
10 | return await NeonPostgres.initialize(embeddings, {
11 | connectionString: process.env.POSTGRES_URL as string,
12 | })
13 | }
14 |
--------------------------------------------------------------------------------
/with-micronaut-kotlin/src/main/kotlin/com/example/entity/Book.kt:
--------------------------------------------------------------------------------
1 | package com.example.entity
2 |
3 | import io.micronaut.data.annotation.GeneratedValue
4 | import io.micronaut.data.annotation.Id
5 | import io.micronaut.data.annotation.MappedEntity
6 | import io.micronaut.serde.annotation.Serdeable
7 |
8 | @MappedEntity
9 | @Serdeable
10 | data class Book(
11 | @field:Id
12 | @field:GeneratedValue
13 | var id: Long? = null,
14 | var title: String,
15 | var author: String
16 | )
--------------------------------------------------------------------------------
/with-waku/src/pages/index.tsx:
--------------------------------------------------------------------------------
1 | import { neon } from "@neondatabase/serverless";
2 |
3 | export default async function HomePage() {
4 | const data = await getData();
5 | return <>{data.version}>;
6 | }
7 |
8 | const getData = async () => {
9 | const sql = neon(`${process.env.DATABASE_URL}`);
10 | const result = await sql`SELECT version()`;
11 | return result[0];
12 | };
13 |
14 | export const getConfig = async () => {
15 | return {
16 | render: "static",
17 | };
18 | };
19 |
--------------------------------------------------------------------------------
/ai/llamaindex/reverse-image-search-nextjs/next.config.mjs:
--------------------------------------------------------------------------------
1 | /** @type {import('next').NextConfig} */
2 | const nextConfig = {
3 | experimental: {
4 | serverComponentsExternalPackages: ["sharp", "onnxruntime-node", "@xenova/transformers"],
5 | },
6 | webpack: (config) => {
7 | config.resolve.alias = {
8 | ...config.resolve.alias,
9 | sharp$: false,
10 | 'onnxruntime-node$': false,
11 | }
12 | return config
13 | },
14 | }
15 |
16 | export default nextConfig
17 |
--------------------------------------------------------------------------------
/with-nextjs-prisma-cloudflare-workers/app/api/users/route.ts:
--------------------------------------------------------------------------------
1 | export const runtime = 'edge'
2 |
3 | export const dynamic = 'force-dynamic'
4 |
5 | export const fetchCache = 'force-no-store'
6 |
7 | import prisma from '@/lib/prisma.server'
8 |
9 | export async function GET() {
10 | const startTime = Date.now()
11 | const users = await prisma.users.findMany()
12 | await prisma.$disconnect()
13 | const duration = Date.now() - startTime
14 | return Response.json({ users, duration })
15 | }
16 |
--------------------------------------------------------------------------------
/with-redwoodsdk/src/worker.tsx:
--------------------------------------------------------------------------------
1 | import { render, route } from "rwsdk/router";
2 | import { defineApp } from "rwsdk/worker";
3 |
4 | import { Document } from "@/app/Document";
5 | import { setCommonHeaders } from "@/app/headers";
6 | import { Home } from "@/app/pages/Home";
7 |
8 | export type AppContext = {};
9 |
10 | export default defineApp([
11 | setCommonHeaders(),
12 | ({ ctx }) => {
13 | // setup ctx here
14 | ctx;
15 | },
16 | render(Document, [route("/", Home)]),
17 | ]);
18 |
--------------------------------------------------------------------------------
/with-micronaut-kotlin/src/main/resources/application.yml:
--------------------------------------------------------------------------------
1 | micronaut:
2 | application:
3 | name: with-micronaut-kotlin
4 | datasources:
5 | default:
6 | url: "jdbc:postgresql://endpoint.neon.tech/dbname?sslmode=require&channelBinding=require"
7 | username: ""
8 | password: ""
9 | driver-class-name: org.postgresql.Driver
10 | db-type: postgres
11 | dialect: POSTGRES
12 | flyway:
13 | datasources:
14 | default:
15 | enabled: true
16 |
--------------------------------------------------------------------------------
/with-nextjs-drizzle-edge/app/api/users/route.ts:
--------------------------------------------------------------------------------
1 | export const runtime = 'edge'
2 |
3 | export const dynamic = 'force-dynamic'
4 |
5 | export const fetchCache = 'force-no-store'
6 |
7 | import db from "@/lib/drizzle.server";
8 | import { usersTable } from "@/lib/schema";
9 |
10 | export async function GET() {
11 | const startTime = Date.now()
12 | const users = await db.select().from(usersTable)
13 | const duration = Date.now() - startTime
14 | return Response.json({ users, duration })
15 | }
16 |
--------------------------------------------------------------------------------
/auth/with-authjs-next/auth.ts:
--------------------------------------------------------------------------------
1 | import PostgresAdapter from '@auth/pg-adapter'
2 | import { Pool } from '@neondatabase/serverless'
3 | import NextAuth from 'next-auth'
4 | import Resend from 'next-auth/providers/resend'
5 |
6 | export const { handlers, auth, signIn, signOut } = NextAuth(() => {
7 | const pool = new Pool({ connectionString: process.env.DATABASE_URL })
8 | return {
9 | adapter: PostgresAdapter(pool),
10 | providers: [Resend({ from: 'Test ' })],
11 | }
12 | })
13 |
--------------------------------------------------------------------------------
/ai/inngest/rag-starter-nextjs/tailwind.config.ts:
--------------------------------------------------------------------------------
1 | import type { Config } from "tailwindcss";
2 |
3 | export default {
4 | content: [
5 | "./src/pages/**/*.{js,ts,jsx,tsx,mdx}",
6 | "./src/components/**/*.{js,ts,jsx,tsx,mdx}",
7 | "./src/app/**/*.{js,ts,jsx,tsx,mdx}",
8 | ],
9 | theme: {
10 | extend: {
11 | colors: {
12 | background: "var(--background)",
13 | foreground: "var(--foreground)",
14 | },
15 | },
16 | },
17 | plugins: [],
18 | } satisfies Config;
19 |
--------------------------------------------------------------------------------
/with-analog/index.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | with-analog
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
--------------------------------------------------------------------------------
/with-astro-api-routes/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "type": "module",
3 | "name": "with-astro-api-routes",
4 | "scripts": {
5 | "dev": "astro dev",
6 | "start": "astro dev",
7 | "build": "astro check && astro build",
8 | "preview": "astro preview",
9 | "astro": "astro"
10 | },
11 | "dependencies": {
12 | "@astrojs/check": "^0.7.0",
13 | "@astrojs/node": "^8.2.5",
14 | "@neondatabase/serverless": "^1.0.0",
15 | "astro": "^4.9.2",
16 | "typescript": "^5.4.5"
17 | }
18 | }
19 |
--------------------------------------------------------------------------------
/with-laravel/app/Providers/AppServiceProvider.php:
--------------------------------------------------------------------------------
1 |
2 |
3 | import { defineConfig } from 'vite';
4 | import analog from '@analogjs/platform';
5 |
6 | // https://vitejs.dev/config/
7 | export default defineConfig(({ mode }) => ({
8 | build: {
9 | target: ['es2020'],
10 | },
11 | resolve: {
12 | mainFields: ['module'],
13 | },
14 | plugins: [
15 | analog({
16 | ssr: false,
17 | static: true,
18 | prerender: {
19 | routes: [],
20 | },
21 | }),
22 | ],
23 | }));
24 |
--------------------------------------------------------------------------------
/with-nestjs/src/database/database.module.ts:
--------------------------------------------------------------------------------
1 | import { config } from 'dotenv';
2 | import { Module } from '@nestjs/common';
3 | import { neon } from '@neondatabase/serverless';
4 |
5 | config({
6 | path: ['.env', '.env.production', '.env.local'],
7 | });
8 |
9 | const sql = neon(process.env.DATABASE_URL);
10 |
11 | const dbProvider = {
12 | provide: 'POSTGRES_POOL',
13 | useValue: sql,
14 | };
15 |
16 | @Module({
17 | providers: [dbProvider],
18 | exports: [dbProvider],
19 | })
20 | export class DatabaseModule {}
21 |
--------------------------------------------------------------------------------
/with-bun/using-neon-serverless-driver.ts:
--------------------------------------------------------------------------------
1 | import { neon } from '@neondatabase/serverless';
2 |
3 | const connectionString = process.env.POSTGRES_URL as string;
4 |
5 | if (!connectionString) {
6 | throw new Error(`Please add a POSTGRES_URL environment variable.`);
7 | }
8 |
9 | // Bun automatically loads the POSTGRES_URL from .env.local
10 | // Refer to: https://bun.sh/docs/runtime/env for more information
11 | const sql = neon(connectionString);
12 |
13 | const rows = await sql`SELECT version()`;
14 |
15 | console.log(rows[0]);
16 |
--------------------------------------------------------------------------------
/with-rust-postgres/Cargo.toml:
--------------------------------------------------------------------------------
1 | [package]
2 | name = "with-rust-postgres"
3 | version = "0.1.0"
4 | edition = "2024"
5 |
6 | [dependencies]
7 | dotenvy = "0.15.7"
8 | openssl = "0.10.73"
9 | postgres = "0.19.10"
10 | postgres-openssl = "0.5.1"
11 |
12 | [[bin]]
13 | name = "create_table"
14 | path = "src/create_table.rs"
15 |
16 | [[bin]]
17 | name = "read_data"
18 | path = "src/read_data.rs"
19 |
20 | [[bin]]
21 | name = "update_data"
22 | path = "src/update_data.rs"
23 |
24 | [[bin]]
25 | name = "delete_data"
26 | path = "src/delete_data.rs"
--------------------------------------------------------------------------------
/with-neon-serverless/delete_data.js:
--------------------------------------------------------------------------------
1 | import 'dotenv/config';
2 | import { neon } from '@neondatabase/serverless';
3 |
4 | const sql = neon(process.env.DATABASE_URL);
5 |
6 | async function deleteData() {
7 | try {
8 | console.log('Connection established');
9 |
10 | // Delete a data row from the table
11 | await sql`DELETE FROM books WHERE title = ${'1984'}`;
12 | console.log("Deleted the book '1984' from the table.");
13 | } catch (err) {
14 | console.error('Connection failed.', err);
15 | }
16 | }
17 |
18 | deleteData();
--------------------------------------------------------------------------------
/with_phoenix/test/with_phoenix_web/controllers/error_html_test.exs:
--------------------------------------------------------------------------------
1 | defmodule WithPhoenixWeb.ErrorHTMLTest do
2 | use WithPhoenixWeb.ConnCase, async: true
3 |
4 | # Bring render_to_string/4 for testing custom views
5 | import Phoenix.Template
6 |
7 | test "renders 404.html" do
8 | assert render_to_string(WithPhoenixWeb.ErrorHTML, "404", "html", []) == "Not Found"
9 | end
10 |
11 | test "renders 500.html" do
12 | assert render_to_string(WithPhoenixWeb.ErrorHTML, "500", "html", []) == "Internal Server Error"
13 | end
14 | end
15 |
--------------------------------------------------------------------------------
/auth/with-authjs-next/tailwind.config.ts:
--------------------------------------------------------------------------------
1 | import type { Config } from 'tailwindcss'
2 |
3 | const config: Config = {
4 | content: ['./pages/**/*.{js,ts,jsx,tsx,mdx}', './components/**/*.{js,ts,jsx,tsx,mdx}', './app/**/*.{js,ts,jsx,tsx,mdx}'],
5 | theme: {
6 | extend: {
7 | backgroundImage: {
8 | 'gradient-radial': 'radial-gradient(var(--tw-gradient-stops))',
9 | 'gradient-conic': 'conic-gradient(from 180deg at 50% 50%, var(--tw-gradient-stops))',
10 | },
11 | },
12 | },
13 | }
14 |
15 | export default config
16 |
--------------------------------------------------------------------------------
/with-neon-serverless/update_data.js:
--------------------------------------------------------------------------------
1 | import 'dotenv/config';
2 | import { neon } from '@neondatabase/serverless';
3 |
4 | const sql = neon(process.env.DATABASE_URL);
5 |
6 | async function updateData() {
7 | try {
8 | console.log('Connection established');
9 |
10 | // Update a data row in the table
11 | await sql`UPDATE books SET in_stock = ${true} WHERE title = ${'Dune'}`;
12 | console.log("Updated stock status for 'Dune'.");
13 | } catch (err) {
14 | console.error('Connection failed.', err);
15 | }
16 | }
17 |
18 | updateData();
--------------------------------------------------------------------------------
/with-solid-start/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "type": "module",
3 | "name": "with-solid-start",
4 | "scripts": {
5 | "dev": "vinxi dev",
6 | "build": "vinxi build",
7 | "start": "vinxi start",
8 | "version": "vinxi version"
9 | },
10 | "dependencies": {
11 | "@neondatabase/serverless": "^0.9.3",
12 | "@solidjs/meta": "^0.29.4",
13 | "@solidjs/router": "^0.13.3",
14 | "@solidjs/start": "^1.0.1",
15 | "solid-js": "^1.8.17",
16 | "vinxi": "^0.3.11"
17 | },
18 | "engines": {
19 | "node": ">=18"
20 | }
21 | }
22 |
--------------------------------------------------------------------------------
/with-laravel/public/index.php:
--------------------------------------------------------------------------------
1 | handleRequest(Request::capture());
18 |
--------------------------------------------------------------------------------
/with-nuxt/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "type": "module",
3 | "name": "with-nuxt",
4 | "scripts": {
5 | "build": "nuxt build",
6 | "dev": "nuxt dev",
7 | "generate": "nuxt generate",
8 | "preview": "nuxt preview",
9 | "postinstall": "nuxt prepare"
10 | },
11 | "dependencies": {
12 | "@neondatabase/serverless": "^1.0.0",
13 | "@nuxt/icon": "^1.5.6",
14 | "@nuxtjs/tailwindcss": "^6.12.2",
15 | "nuxt": "^3.13.2",
16 | "vue": "latest"
17 | },
18 | "devDependencies": {
19 | "@iconify-json/logos": "^1.2.3"
20 | }
21 | }
22 |
--------------------------------------------------------------------------------
/with-solid-start/src/app.tsx:
--------------------------------------------------------------------------------
1 | import { MetaProvider, Title } from "@solidjs/meta";
2 | import { Router } from "@solidjs/router";
3 | import { FileRoutes } from "@solidjs/start/router";
4 | import { Suspense } from "solid-js";
5 |
6 | export default function App() {
7 | return (
8 | (
10 |
11 | SolidStart - Basic
12 | {props.children}
13 |
14 | )}
15 | >
16 |
17 |
18 | );
19 | }
20 |
--------------------------------------------------------------------------------
/with_phoenix/lib/with_phoenix_web/components/layouts.ex:
--------------------------------------------------------------------------------
1 | defmodule WithPhoenixWeb.Layouts do
2 | @moduledoc """
3 | This module holds different layouts used by your application.
4 |
5 | See the `layouts` directory for all templates available.
6 | The "root" layout is a skeleton rendered as part of the
7 | application router. The "app" layout is set as the default
8 | layout on both `use WithPhoenixWeb, :controller` and
9 | `use WithPhoenixWeb, :live_view`.
10 | """
11 | use WithPhoenixWeb, :html
12 |
13 | embed_templates "layouts/*"
14 | end
15 |
--------------------------------------------------------------------------------
/with-nextjs-prisma/.gitignore:
--------------------------------------------------------------------------------
1 | # See https://help.github.com/articles/ignoring-files/ for more about ignoring files.
2 |
3 | # dependencies
4 | /node_modules
5 | /.pnp
6 | .pnp.js
7 |
8 | # testing
9 | /coverage
10 |
11 | # next.js
12 | /.next/
13 | /out/
14 |
15 | # production
16 | /build
17 |
18 | # misc
19 | .DS_Store
20 | *.pem
21 |
22 | # debug
23 | npm-debug.log*
24 | yarn-debug.log*
25 | yarn-error.log*
26 | .pnpm-debug.log*
27 |
28 | # local env files
29 | .env
30 |
31 | # vercel
32 | .vercel
33 |
34 | # typescript
35 | *.tsbuildinfo
36 | next-env.d.ts
37 |
--------------------------------------------------------------------------------
/with-nodejs/index.js:
--------------------------------------------------------------------------------
1 | require("dotenv").config();
2 |
3 | const http = require("http");
4 | const { neon } = require("@neondatabase/serverless");
5 |
6 | const sql = neon(process.env.DATABASE_URL);
7 |
8 | const requestHandler = async (req, res) => {
9 | const result = await sql`SELECT version()`;
10 | const { version } = result[0];
11 | res.writeHead(200, { "Content-Type": "text/plain" });
12 | res.end(version);
13 | };
14 |
15 | http.createServer(requestHandler).listen(3000, () => {
16 | console.log("Server running at http://localhost:3000");
17 | });
18 |
--------------------------------------------------------------------------------
/with-prisma/.env.example:
--------------------------------------------------------------------------------
1 | # Environment variables declared in this file are automatically made available to Prisma.
2 | # See the documentation for more detail: https://pris.ly/d/prisma-schema#accessing-environment-variables-from-the-schema
3 |
4 | # Prisma supports the native connection string format for PostgreSQL, MySQL, SQLite, SQL Server, MongoDB and CockroachDB.
5 | # See the documentation for all the connection string options: https://pris.ly/d/connection-strings
6 |
7 | DATABASE_URL="postgresql://neondb_owner:...@ep-...us-east-1.aws.neon.tech/neondb?sslmode=require"
8 |
--------------------------------------------------------------------------------