Getting Started
Learn how to set up and run the starter monorepo locally in minutes.
Prerequisites
Before you begin, ensure you have the following installed:
- Node.js 20+
- npm (comes with Node.js)
- MongoDB (running locally or a connection string to MongoDB Atlas)
1. Clone the Repository
git clone <your-repo-url>
cd next-starter
2. Environment Setup
Copy the example environment files to create your local configurations.
# In the root directory
cp .env.example .env
# The starter uses shared secrets across apps
Critical Variables
Both apps/web and apps/api must have mathematically identical ENCRYPTION_KEY and SESSION_SECRET variables.
SESSION_SECRET: A long, random string used to sign session cookies.ENCRYPTION_KEY: A 32-byte (64 character hex) key used for encrypting sensitive data.MONGO_URI: Your MongoDB connection string.RESEND_API_KEY: Required for sending authentication emails (OTP/Magic Links).
3. Install Dependencies
Install all dependencies for the entire monorepo using npm:
npm install
4. Run Development Servers
Start all applications in development mode using Turbo:
npm run dev
By default:
- Web App: http://localhost:3000
- API Server: http://localhost:4000
- API Documentation: http://localhost:4000/v1/docs
Next Steps
Once you have the project running, check out the Project Structure guide to understand how the monorepo is organized.