A modern, production-ready NextJS skeleton application with authentication, multi-tenancy, and real-time data sync.
- 🔐 Authentication: Secure authentication with Clerk (social logins, magic links, email/password)
- 🏢 Multi-tenancy: Support for multiple companies/clients per user with role-based permissions
- 🔄 Real-time Data: Powered by Convex for real-time data synchronization
- 🎨 Modern UI: Built with Tailwind CSS v4 and shadcn/ui components
- 🌓 Dark/Light Mode: Theme toggle with system preference detection
- 📱 Responsive: Mobile-first design that works on all devices
- 🔒 Type-safe: Full TypeScript coverage with strict mode
- 🧪 Developer Experience: ESLint, Prettier, and Husky pre-configured
- Framework: Next.js 14+ (App Router)
- Styling: Tailwind CSS v4 + shadcn/ui
- Database: Convex DB
- Authentication: Clerk
- Language: TypeScript
- Code Quality: ESLint, Prettier, Husky
- Node.js 18+ and npm
- A Clerk account (free tier available)
- A Convex account (free tier available)
- Clone the repository:
git clone <your-repo-url>
cd skeleton- Install dependencies:
npm install- Set up environment variables:
cp .env.example .env.local- Configure your environment variables:
- Create a new application at clerk.com
- Copy your API keys to
.env.local - Configure allowed redirect URLs in Clerk dashboard
- Create a new project at convex.dev
- Run
npx convex devand follow the prompts to link your project - The Convex URL will be automatically added to your
.env.local
Run the development server:
npm run devOpen http://localhost:3000 to see your application.
src/
├── app/ # Next.js App Router
│ ├── (auth)/ # Authenticated routes
│ ├── (public)/ # Public routes
│ └── api/ # API routes
├── components/ # React components
│ ├── ui/ # shadcn/ui components
│ └── layout/ # Layout components
├── convex/ # Convex backend
│ ├── schema.ts # Database schema
│ └── *.ts # Convex functions
├── hooks/ # Custom React hooks
├── lib/ # Utility functions
├── providers/ # React context providers
└── types/ # TypeScript types
The app uses Clerk for authentication. Users can sign up/in using:
- Email and password
- Social providers (Google, GitHub, etc.)
- Magic links
Users can:
- Create multiple companies
- Invite team members via email
- Assign roles (Owner, Admin, Member)
- Switch between companies
The "Items" feature demonstrates:
- Creating records with user ownership
- Reading only user's own records
- Updating with permission checks
- Deleting with confirmation
All data changes are synchronized in real-time across all connected clients using Convex subscriptions.
npm run dev- Start development server with hot reloadnpm run build- Build for productionnpm run start- Start production servernpm run lint- Run ESLintnpm run lint:fix- Fix ESLint errorsnpm run format- Format code with Prettiernpm run typecheck- Run TypeScript type checking
- Push your code to GitHub
- Import your repository on Vercel
- Add environment variables
- Deploy
The app can be deployed to any platform that supports Next.js:
- Railway
- Render
- AWS Amplify
- Netlify
# Clerk
NEXT_PUBLIC_CLERK_PUBLISHABLE_KEY=
CLERK_SECRET_KEY=
# Clerk URLs
NEXT_PUBLIC_CLERK_SIGN_IN_URL=/login
NEXT_PUBLIC_CLERK_SIGN_UP_URL=/register
NEXT_PUBLIC_CLERK_SIGN_IN_FORCE_REDIRECT_URL=/dashboard
NEXT_PUBLIC_CLERK_SIGN_UP_FORCE_REDIRECT_URL=/dashboard
# Convex
CONVEX_DEPLOYMENT=
NEXT_PUBLIC_CONVEX_URL=
# App
NEXT_PUBLIC_APP_URL=http://localhost:3000- All API routes are protected by Clerk middleware
- Database queries include user permission checks
- Input validation on all forms
- CSRF protection built-in
- Environment variables for sensitive data
- Fork the repository
- Create your feature branch (
git checkout -b feature/amazing-feature) - Commit your changes (
git commit -m 'Add some amazing feature') - Push to the branch (
git push origin feature/amazing-feature) - Open a Pull Request
This project is licensed under the MIT License - see the LICENSE file for details.
For support, please open an issue in the GitHub repository.