Next.js TypeScript PostgreSQL Prisma NextAuth

Moonlight

Modern Book Tracking & Reading Reflection Platform

Moonlight Interface

Screenshots

Overview

Moonlight is a sophisticated book tracking and reading reflection application designed for readers who want more than just tracking what they readβ€”they want to reflect on what they got out of it. Built with Next.js 16, TypeScript, and PostgreSQL, it emphasizes deep reflection and personal growth through reading.

Full
Stack App
3
Payment Gateways
AI
Powered Features

Core Philosophy

Moonlight focuses on reflection over tracking. While most book apps simply log your reading, Moonlight helps you:

  • Understand where you found yourself in each book
  • Identify scenes that held you emotionally
  • Build a "Wisdom Vault" of lessons and insights
  • Set meaningful reading goals, not just page counts
  • Reflect yearly on books that healed, broke, or changed you

Key Features

πŸ“š

Book Lifecycle Management

Track books through TBR β†’ READING β†’ FINISHED states with reading logs, emotions, and progress tracking

✍️

Deep Reflections

Capture where you found yourself in the story, scenes that moved you, and personal connections

πŸ“–

Series Management

Group books into series with manual ordering and series-level reflections

πŸ’Ž

Wisdom Vault

Store vocabulary, lessons, insights, and quotes independent of specific books

🎯

Goal Setting

Monthly and yearly reading goals with intentions, not just numbers

πŸ€–

AI Integration

Google Generative AI for recommendations and text generation

Technical Architecture

Tech Stack Layers

1

Frontend

Next.js 16.1.1 with App Router, React 19, TypeScript

2

Styling

Tailwind CSS, clsx, Lucide React icons, Recharts

3

Backend & Database

PostgreSQL (Neon), Prisma ORM, API Routes

4

Authentication

NextAuth.js with JWT, bcryptjs password hashing

5

AI & Payments

Google Generative AI, Lemon Squeezy, Stripe, Safepay

Database Design

Prisma Schema Highlights

The database is designed around the User and Book entities with rich relationships:

Core Models

  • User (auth + premium status)
  • Book (title, author, status, dates)
  • Series (groups books)

Reflection Models

  • Review (ratings, quotes, analysis)
  • ReadingLog (progress, emotions)
  • Reflection (personal connections)
  • Quote (memorable passages)

Planning Models

  • MonthlyGoal (books + intentions)
  • YearlyReflection (retrospectives)
  • WisdomEntry (vault items)

Business Model

Freemium Model

Moonlight offers a free tier with basic features and a premium "Moonlight Premium" subscription

Free Tier

  • Limited book tracking
  • Basic reflection features
  • Essential wisdom vault

Multiple Payment Options

Three integrated payment gateways for global reach:

  • Lemon Squeezy: Primary gateway for subscriptions
  • Stripe: International payments and flexibility
  • Safepay: Regional payment support

Use Cases

πŸ“– Reading Journey Tracking

Scenario: Reader finishing a transformative novel

Flow:

  1. Log reading sessions with emotional states
  2. Add reflection on personal connections to the story
  3. Save favorite quotes and analyze themes
  4. Complete yearly reflection on impact

Result: Deep understanding of personal growth through reading

πŸ’Ž Building Wisdom

Scenario: Collecting insights from multiple books

Flow:

  1. Add vocabulary words encountered while reading
  2. Store life lessons in Wisdom Vault
  3. Tag and categorize insights
  4. Review vault for personal growth tracking

Result: Centralized repository of knowledge and insights

🎯 Goal Achievement

Scenario: Reader setting monthly reading goals

Flow:

  1. Set monthly goal with specific intentions
  2. Track progress through the month
  3. Reflect on achievements and adjust goals
  4. View analytics and reading patterns

Result: Intentional, meaningful reading practice

πŸ“š Series Organization

Scenario: Managing a fantasy book series

Flow:

  1. Create series and add books
  2. Manually order books in reading sequence
  3. Add series-level reflections on overall arc
  4. Track completion across the series

Result: Organized view of multi-book narratives

Engineering Highlights

Type-Safe Development

Full TypeScript with Prisma for end-to-end type safety from database to UI

Middleware Protection

Robust authentication middleware protecting all core routes with JWT sessions

Multi-Gateway Payments

Integrated 3 payment providers with webhook handling for global monetization

Rich Data Model

Comprehensive Prisma schema supporting complex relationships and reflection data