Notion-Powered Website

A modern Next.js website powered by Notion as your database. No more Super.so fees!

Features

  • βœ… Fetch data from Notion databases
  • βœ… Server-side rendering with Next.js
  • βœ… Tailwind CSS + shadecn/ui components
  • βœ… Free hosting on Netlify + GitHub
  • βœ… Automatic builds on Notion updates

Setup

1. Create Notion Integration

  1. Go to Notion Integrations
  2. Click β€œCreate new integration”
  3. Name it β€œPatttterns”
  4. Copy the Internal Integration Token
  5. Go to your database β†’ Share β†’ Select your integration
  6. Copy the Database ID from the URL

2. Environment Variables

Create .env.local:

NOTION_API_KEY=your_token_here
NOTION_HOMEPAGE_ID=your_database_id_here

3. Run Locally

npm install
npm run dev

Visit http://localhost:3000

Deployment to Netlify

  1. Push to GitHub
  2. Connect repo to Netlify
  3. Add environment variables in Netlify settings
  4. Deploy!

Project Structure

src/
β”œβ”€β”€ app/                 # Next.js App Router pages
β”‚   β”œβ”€β”€ page.tsx        # Home page
β”‚   └── layout.tsx      # Root layout
β”œβ”€β”€ lib/
β”‚   └── notion.ts       # Notion API client
└── components/
    └── NotionPageGrid.tsx  # Display Notion data

API Reference

getNotionDatabase(databaseId)

Fetches all pages from a Notion database.

import { getNotionDatabase } from "@/lib/notion";

const pages = await getNotionDatabase("your-database-id");

Customization

Edit src/components/NotionPageGrid.tsx to customize the UI:

  • Change grid layout
  • Add more property displays
  • Style with Tailwind

Next Steps

  • Add filtering/search
  • Create single page view
  • Add image galleries
  • Deploy to Netlify

License

MIT