Installation¶
This guide will walk you through setting up Learnify on your local machine.
Prerequisites¶
Before you begin, ensure you have the following installed:
- Node.js 18.0 or higher
- npm or yarn or pnpm
- Git
You'll also need accounts for:
- PostgreSQL Database - Neon (recommended) or local PostgreSQL
- Stripe - For payment processing
- Cloudinary - For media storage
Step 1: Clone the Repository¶
Step 2: Install Dependencies¶
Or if you prefer yarn:
Step 3: Set Up Environment Variables¶
Copy the example environment file:
Open .env and fill in your credentials. See the Configuration guide for details on each variable.
Step 4: Set Up the Database¶
Generate the Prisma client:
Push the schema to your database:
Seed the database with sample data:
Step 5: Start the Development Server¶
The application will be available at http://localhost:3000.
Troubleshooting¶
Database Connection Issues¶
If you're having trouble connecting to your database:
- Verify your
DATABASE_URLis correct - Ensure your database server is running
- Check that your IP is allowlisted (for cloud databases)
Prisma Issues¶
If you encounter Prisma-related errors:
# Reset the Prisma client
npx prisma generate
# Reset the database (warning: deletes all data)
npx prisma db push --force-reset
Node.js Version¶
Ensure you're using Node.js 18 or higher:
If needed, use nvm to manage Node.js versions: