A modern note-taking application built with a monorepo architecture. Features a clean web interface for users and a powerful admin dashboard for management.
Atom Notes is a full-stack TypeScript application designed for secure note management and team collaboration. The project uses a monorepo structure to organize shared packages and multiple applications.
- Frontend: Next.js 14+, React, TypeScript
- Backend: tRPC, Next.js API routes
- Database: PostgreSQL with Drizzle ORM
- Authentication: JWT-based auth with bcryptjs
- Styling: Tailwind CSS, shadcn/ui components
- Package Manager: pnpm with workspaces
- Code Quality: Biome (linting & formatting)
atom-notes/
βββ apps/
β βββ web/ # User-facing web app (port 3000)
β βββ admin/ # Admin dashboard (port 3001)
βββ packages/
β βββ api/ # tRPC API routers
β βββ auth/ # Authentication logic
β βββ db/ # Database schema & migrations
β βββ ui/ # Shared UI components
βββ package.json # Workspace root
βββ pnpm-workspace.yaml # Workspace configuration
βββ tsconfig.json # TypeScript config with path aliases
apps/web- Public-facing web application for users to manage notesapps/admin- Admin dashboard for system management and monitoring
packages/api- tRPC server configuration and API routerspackages/auth- Authentication service (signup, login, JWT utilities)packages/db- Drizzle ORM schema, migrations, and database utilitiespackages/ui- Reusable React components and layouts
- Node.js 18+
- pnpm 10+ (or
npm install -g pnpm) - PostgreSQL database connection string
-
Clone the repository
git clone <repository-url> cd atom-notes
-
Install dependencies
pnpm install
-
Set up environment variables
- Create
.envfiles inapps/web,apps/admin, andpackages/db - Copy from
.env.exampleif available - Required:
DATABASE_URLfor PostgreSQL connection
- Create
-
Run database migrations
pnpm db:push
-
Start development servers
pnpm dev
- Web app: http://localhost:3000
- Admin dashboard: http://localhost:3001
# Development
pnpm dev # Start all apps in development mode
# Building & Production
pnpm build # Build all apps for production
pnpm start # Start production servers
# Code Quality
pnpm lint # Run Biome linter
pnpm lint:fix # Fix linting issues
pnpm format # Format code with Biome
pnpm check # Run type checking
pnpm typecheck # TypeScript compilation check
# Database
pnpm db:generate # Generate Drizzle types & migrations
pnpm db:migrate # Run pending migrations
pnpm db:push # Sync schema with database (dev only)
pnpm db:studio # Open Drizzle Studio (database GUI)
# Maintenance
pnpm clean # Remove node_modules and build artifacts-
Start all services with hot reload:
pnpm dev
-
Make changes to any app or package - they update automatically
-
Check code quality:
pnpm lint:fix # Auto-fix linting issues pnpm typecheck # Verify TypeScript types
When modifying the database schema in packages/db/src/schema.ts:
# 1. Update your schema
# 2. Generate migration
pnpm db:generate
# 3. Review the generated migration file
# 4. Apply to database
pnpm db:push # Dev only
# or
pnpm db:migrate # Production migrationsThe auth system is in packages/auth:
- Signup: Create new user accounts with email/password
- Login: JWT-based authentication
- Sessions: Token-based with expiration
- Password Security: bcryptjs hashing
See packages/auth/src/ for implementation details.
tRPC routers and procedures for communication between frontend and backend.
// Example usage in apps
import { api } from '@repo/api';Authentication utilities and services.
import { authService } from '@repo/auth';Database queries and schema definitions.
import { db } from '@repo/db';Reusable components and layouts.
import { Button, Card } from '@repo/ui';- Web app uses port 3000, Admin uses port 3001
- Change in
next.config.jsif needed
- Verify
DATABASE_URLis correct - Ensure PostgreSQL is running
- Check firewall/network access
npm install -g pnpmpnpm clean
pnpm installpnpm-workspace.yaml- Workspace configurationbiome.json- Code formatting & linting rulestsconfig.json- TypeScript configuration with@repo/*aliasespackages/db/drizzle.config.ts- Database configurationpackages/api/src/root.ts- Main tRPC router definition
- Create a feature branch
- Make your changes
- Run
pnpm lint:fixandpnpm check - Test in dev mode with
pnpm dev - Commit and push
This project is private. All rights reserved.
For issues or questions:
- Check this README
- Review the monorepo structure documentation
- Check logs in development mode
- Review package-specific README files (if available)
Happy coding! π