npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

exclaim-recovery-database

v1.0.3

Published

Shared database schemas for Exclaim Recovery platform

Readme

Exclaim Database

Shared database schema and migrations for Exclaim Recovery platform. Single source of truth for Prisma models and Drizzle vector tables.

=� Overview

This repository contains:

  • Prisma schema for 89+ relational tables
  • Drizzle schema for 8 vector/AI search tables
  • Migration history for database versioning
  • TypeScript types shared across applications

=� Quick Start

Initial Setup

# Clone the repository
git clone [email protected]:ExclaimRecovery/exclaim-database.git
cd exclaim-database

# Install dependencies
npm install

# Generate Prisma client
npm run generate

For Frontend (dan) Developers

# Link to your frontend
cd ../dan
npm link ../exclaim-database

For Backend (hope) Developers

# Link to your backend
cd ../hope
npm link ../exclaim-database

=� Repository Structure

exclaim-database/
�� prisma/
   �� schema.prisma          # Main database schema (89 tables)
   �� migrations/            # Migration history
�� drizzle/
   �� schema.ts             # Vector table definitions
   �� migrations/           # Drizzle migrations
�� scripts/                  # Utility scripts
�� package.json             # Dependencies & scripts
�� drizzle.config.ts       # Drizzle configuration

=� Available Scripts

npm run generate          # Generate Prisma client
npm run generate:drizzle  # Generate Drizzle migrations
npm run migrate:dev       # Create new migration (dev)
npm run migrate:apply     # Apply migrations to database
npm run migrate:status    # Check migration status
npm run db:push          # Push schema without migration
npm run db:pull          # Pull schema from database
npm run studio           # Open Prisma Studio
npm run drizzle:studio   # Open Drizzle Studio

=� Making Schema Changes

1. Create a Feature Branch

git checkout -b dev/your-feature

2. Edit Schema

# For relational tables
vim prisma/schema.prisma

# For vector tables
vim drizzle/schema.ts

3. Create Migration

# For Prisma changes
npm run migrate:dev -- --name describe_your_change

# For Drizzle changes
npm run generate:drizzle

4. Test Locally

# Test with frontend
cd ../dan && npm run dev

# Test with backend
cd ../hope && npm run dev

5. Submit PR

git add .
git commit -m "feat: add new field for X feature"
git push origin dev/your-feature

=� Database Architecture

Prisma Tables (Relational Data)

  • User management (User, UserProfile, etc.)
  • Goals & progress tracking
  • Social features (Blog, Comment, Like)
  • Gamification (PowerUp, Reward)
  • Hope AI system tables
  • And 80+ more...

Drizzle Tables (Vector/AI Data)

  • Document - Base document storage with vectors
  • UserDocument - User-specific documents
  • SMARTRecoveryDocument - SMART recovery content
  • ScientificStudyDocument - Research papers
  • GAStepDocument - GA 12-step content
  • GAResourceDocument - GA resources
  • GAReflectionDocument - User reflections
  • BlogDocument - Blog content with vectors

= Environment Variables

Both dan and hope need these environment variables:

# For Prisma (via Accelerate)
DATABASE_URL="prisma+postgres://..."

# For Drizzle (direct connection)
VERCEL_POSTGRES_URL="postgres://..."

# For administrative tasks
DIRECT_DATABASE_URL="postgresql://..."

� Important Notes

  1. No Deployment: This repository is NOT deployed. It's only used locally by dan and hope.
  2. Shared Database: Development and production use the same Neon database.
  3. Backwards Compatibility: Always make backwards-compatible changes.
  4. Team Communication: Coordinate schema changes with the team.

= Migration Safety

Since dev and prod share the same database:

  •  ADD columns (with defaults or nullable)
  •  ADD tables
  •  ADD indexes
  • � AVOID removing columns immediately
  • � AVOID renaming columns (add new, migrate, remove old)
  • L NEVER use migrate reset in production

=� Related Documentation

<� Troubleshooting

Import paths not working

cd ../dan && npm link ../exclaim-database

Prisma client not found

cd exclaim-database && npm run generate

Migration conflicts

npm run migrate:status
npm run migrate:resolve --applied [migration-name]

=� Support

For questions about database setup or migrations, contact the development team in #database Slack channel.


Last Updated: September 2024