Prerequisites
Before you begin, ensure you have the following installed on your system:- Node.js >= 18.x
- npm or bun (recommended) as package manager
- PostgreSQL database
- Git for version control
Clone the repository
Start by cloning the Noteverse repository to your local machine:Install dependencies
Install the required packages using your preferred package manager:The
postinstall script will automatically run prisma generate after dependencies are installed.Environment configuration
Create a.env.local file in the root directory with the following environment variables:
.env.local
Variable descriptions
NEXT_PUBLIC_API_URL
NEXT_PUBLIC_API_URL
The base URL for your API endpoints. In development, this is typically
http://localhost:3000/api.NEXT_PUBLIC_SOCKET_URL
NEXT_PUBLIC_SOCKET_URL
The URL for Socket.IO real-time connections. Must be accessible from the client browser.
NEXT_PUBLIC_UPLOAD_URL
NEXT_PUBLIC_UPLOAD_URL
The endpoint URL for file uploads, typically using Vercel Blob storage.
NEXTAUTH_URL
NEXTAUTH_URL
The canonical URL of your site for NextAuth.js. In development:
http://localhost:3000.NEXTAUTH_SECRET
NEXTAUTH_SECRET
A random string used to encrypt JWT tokens. Generate one with:
openssl rand -base64 32DATABASE_URL
DATABASE_URL
PostgreSQL connection string in the format:
postgresql://USER:PASSWORD@HOST:PORT/DATABASEDatabase setup
Noteverse uses Prisma ORM with PostgreSQL. Follow these steps to set up your database:Database schema overview
The application uses the following key models:schema.prisma
Run migrations
Apply the database schema to your PostgreSQL instance:Generate Prisma Client
Generate the Prisma Client for type-safe database access:This command runs automatically during
npm install via the postinstall script.Seed the database (optional)
Populate your database with sample data:Development server
Start the development server with real-time Socket.IO support:http://localhost:3000.
The
dev script runs node server.mjs which includes both the Next.js server and Socket.IO for real-time features.Build for production
Create an optimized production build:Start production server
Run the production server:Deployment
Vercel deployment
Noteverse is optimized for deployment on Vercel:- Push your code to GitHub
- Import the repository in Vercel
- Configure environment variables in Vercel dashboard
- Deploy
vercel-build script handles Prisma generation and migrations:
package.json
Available scripts
Starts the development server with Socket.IO support
Creates an optimized production build
Starts the production server
Automatically generates Prisma Client after installing dependencies
Prepares the application for Vercel deployment with database migrations
Seeds the database with sample data
Technology stack
Core technologies
- Next.js 14: React framework with App Router
- TypeScript: Type-safe development
- Prisma: Database ORM with type safety
- PostgreSQL: Relational database
UI and styling
- Tailwind CSS: Utility-first CSS framework
- Radix UI: Unstyled, accessible component primitives
- Ant Design: Enterprise-grade component library
- Lucide React: Beautiful icon library
- Framer Motion: Production-ready animations
Features and integrations
- Novel.sh: Notion-style WYSIWYG editor built on TipTap
- Socket.IO: Real-time bidirectional communication
- NextAuth.js: Authentication for Next.js
- Vercel Blob: Edge-compatible blob storage
- React Hook Form + Zod: Form management and validation
Troubleshooting
Prisma Client errors
Prisma Client errors
If you encounter Prisma Client errors, try regenerating the client:Then restart your development server.
Database connection issues
Database connection issues
Verify your
DATABASE_URL in .env.local is correct and your PostgreSQL server is running:Socket.IO not connecting
Socket.IO not connecting
Ensure
NEXT_PUBLIC_SOCKET_URL is set correctly and accessible from the client. Check browser console for connection errors.Module resolution errors
Module resolution errors
Clear your package manager cache and reinstall:
Next steps
Quickstart guide
Learn how to create your first note and start collaborating
API reference
Explore the available API endpoints
Database schema
Deep dive into the Prisma schema and relationships
Contributing
Learn how to contribute to Noteverse