Skip to content

My newsletter and portfolio, built with SST, Neon, Drizzle, and Next.js

License

Notifications You must be signed in to change notification settings

lucasdale99/letsdev

Repository files navigation

Next.js Blog with SST, Drizzle ORM, and Neon PostgreSQL

A modern blog platform built with Next.js, utilizing SST for infrastructure, Drizzle ORM for database operations, and Neon PostgreSQL for the database.

Prerequisites

  • Node.js 18+ installed
  • AWS account configured
  • Neon PostgreSQL database created
  • pnpm package manager

Project Setup

  1. Install pnpm globally:
npm install -g pnpm
  1. Install dependencies:
pnpm install
  1. Set up environment variables:
cp .env.local
DATABASE_URL=your_neon_postgres_connection_string
NEXT_PUBLIC_URL=http://localhost:3000
  1. Generate and push Drizzle ORM schema:
drizzle-kit generate
drizzle-kit push

Project Structure

├── app/ # Next.js app directory
│ ├── api/ # API routes
│ ├── blog/ # Blog pages
│ └── components/ # Shared components
├── lib/ # Utility functions and configurations
│ ├── db.ts # Database connection
│ └── schema.ts # Drizzle schema definitions
├── migrations/ # Database migrations
├── sst.config.ts # SST configuration
└── drizzle.config.ts # Drizzle ORM configuration

Database Setup

  1. Create a Neon PostgreSQL database at neon.tech
  2. Get your connection string from the Neon dashboard
  3. Add the connection string to your .env.local file
  4. Run migrations to set up your database schema

Infrastructure with SST

This project uses SST v3 for infrastructure management. Key components:

  1. Configure your AWS credentials
  2. Update sst.config.ts with your stack settings
  3. Deploy to AWS:
pnpm deploy

Deploying Secrets to Environments

sst secret set DATABASE_URL <your_neon_postgres_connection_string> --env <environment>
sst secret set NEXT_PUBLIC_URL <your_next_public_url> --env <environment>

Documentation References

Contributing

  1. Fork the repository
  2. Create a feature branch or create an issue
  3. Submit a pull request

About

My newsletter and portfolio, built with SST, Neon, Drizzle, and Next.js

Topics

Resources

License

Code of conduct

Security policy

Stars

Watchers

Forks

Packages

No packages published