This is a multi-tenant note-taking application built with Next.js v15, libSQL, Prisma, and Next-Auth V5. The app supports multiple users (tenants), each with its own set of notes, users, and workspaces, allowing seamless collaboration and efficient note management.
Deployed to vercel here: Live Demo
- Multi-Tenant Architecture: Supports multiple users, where each user can manage its own set of notes.
- Authentication with Next-Auth: Secure login with social authentication providers such as Google, GitHub, and Discord.
- Real-Time Sync: Notes are synced in real-time across users' devices, enabling collaborative note-taking.
- Text Editor: Users can create and edit notes with rich text formatting using Tiptap.
- Custom UI: TailwindCSS combined with Shadcn components for a aesthetic, responsive design.
- Scalable Database: User auth and other data is managed using PostgreSQL and notes are managed using libSQL, providing a scalable solution for multi-tenant applications.
- Mobile Responsive: Fully optimized for mobile, tablet, and desktop devices.
- Next.js v15
- Next-Auth V5 for authentication
- libSQL for multi-tenant database management
- Prisma ORM for database interactions
- PostgreSQL for all user auth and interaction
- Tiptap for the rich text editor
- Shadcn for UI components
- TailwindCSS for styling
Ensure you have the following installed on your machine:
- Node.js (v18 or later)
- pnpm (recommended for package management)
- libSQL for notes
-
Fork and then Clone the repository:
git clone https://github.com/yourusername/notesap.git cd notesap -
Install the dependencies:
pnpm install
-
Set up environment variables:
Create a
.envfile at the root of your project and add the following environment variables:NEXT_PUBLIC_CRUD_API_KEY=YOUR_CRUD_API_KEY NEXT_PUBLIC_API_URL=YOUR_API_URL GOOGLE_CLIENT_ID=YOUR_GOOGLE_CLIENT_ID GOOGLE_CLIENT_SECRET=YOUR_GOOGLE_CLIENT_SECRET GITHUB_CLIENT_ID=YOUR_GITHUB_CLIENT_ID GITHUB_CLIENT_SECRET=YOUR_GITHUB_CLIENT_SECRET DISCORD_CLIENT_ID=YOUR_DISCORD_CLIENT_ID DISCORD_CLIENT_SECRET=YOUR_DISCORD_CLIENT_SECRET NEXT_PRIVATE_DEBUG_CACHE=YOUR_DEBUG_CACHE_KEY DATABASE_URL=YOUR_DATABASE_URL TURSO_DATABASE_URL=YOUR_TURSO_DATABASE_URL TURSO_AUTH_TOKEN=YOUR_TURSO_AUTH_TOKEN TURSO_API_TOKEN=YOUR_TURSO_API_TOKEN TURSO_ORG_ID=YOUR_TURSO_ORG_ID NEXTAUTH_SECRET=YOUR_NEXTAUTH_SECRET
- Generate the
NEXT_PUBLIC_CRUD_API_KEYusingopenssl rand -hex 32oropenssl rand -base64 32. - Set
DATABASE_URLandTURSO_DATABASE_URLbased on your database provider (libSQL or others).
- Generate the
-
Start the development server:
pnpm dev
-
Open
http://localhost:3000in your browser to access the app.
-
To destroy the databases with "user-[id]" using turso cli run:
turso db list | grep '^user-' | awk '{print $1}' | xargs -I {} turso db destroy {} -y
-
Build the application for production:
pnpm build
-
Start the production server:
pnpm start
You can deploy this app to platforms like Vercel, Netlify, or any other service that supports Next.js deployments.
- Push your changes to your GitHub repository.
- Connect the repository to Vercel. Vercel will automatically detect the project as a Next.js app.
- Add the necessary environment variables in the Vercel dashboard.
- Finally deploy.
- Next.js Documentation
- Next-Auth Documentation
- Prisma Documentation
- Shadcn UI Documentation
- TailwindCSS Documentation
- Turso/libSQL Documentation
We welcome contributions! To contribute to the project:
- Fork the repository.
- Create a new branch for your changes.
- Submit a pull request to the main repository.
This project is licensed under the Creative Commons Legal Code.