A modern web application for managing and accessing study materials, built with Next.js.
This is a full-stack web application that provides a platform for students and educators to share and access study materials. Built with modern web technologies, it offers a seamless user experience and robust functionality.
- User authentication and authorization
- Material upload and management
- Search and filter capabilities
- Responsive design for all devices
- Real-time updates
- Secure file storage
- Node.js (version 16.14 or higher)
- npm or pnpm
- PostgreSQL database (Neon DB recommended)
- Clerk account (for authentication)
- Vercel account (for deployment)
- Create a
.envfile in the root directory with the following variables:
# Database Configuration (Neon DB)
DATABASE_URL="postgresql://user:[email protected]/dbname"
DATABASE_URL_UNPOOLED="postgresql://user:[email protected]/dbname"
# Authentication (Clerk)
NEXT_PUBLIC_CLERK_PUBLISHABLE_KEY="your_clerk_publishable_key"
CLERK_SECRET_KEY="your_clerk_secret_key"
NEXT_PUBLIC_CLERK_SIGN_IN_URL="/sign-in"
NEXT_PUBLIC_CLERK_SIGN_UP_URL="/sign-up"
NEXT_PUBLIC_CLERK_AFTER_SIGN_IN_URL="/dashboard"
NEXT_PUBLIC_CLERK_AFTER_SIGN_UP_URL="/dashboard"
# File Storage (Vercel Blob)
BLOB_READ_WRITE_TOKEN="your_vercel_blob_token"
# API Configuration
NEXT_PUBLIC_API_URL="http://localhost:3000/api"-
Neon DB Setup:
- Go to Neon DB
- Create a new project
- Get your connection strings from the dashboard
- Copy both pooled and unpooled connection URLs to your
.envfile
-
Clerk Authentication Setup:
- Go to Clerk Dashboard
- Create a new application
- Get your API keys from the dashboard
- Copy the Publishable Key and Secret Key to your
.envfile - Configure your application settings in the Clerk dashboard:
- Set up your sign-in and sign-up pages
- Configure redirect URLs
- Set up email templates if needed
-
Vercel Blob Storage:
- Go to Vercel Dashboard > Storage > Blob
- Create a new Blob store
- Generate a new token
- Copy the token to your
.envfile
- Clone the repository:
git clone <your-repository-url>
cd min-project- Install dependencies:
npm install
# or
pnpm install- Set up the database:
npx prisma generate
npx prisma db push- Start the development server:
npm run dev
# or
pnpm dev- Open your browser and navigate to
http://localhost:3000
/app- Next.js app directory containing pages and API routes/components- Reusable UI components/prisma- Database schema and migrations/public- Static assets/styles- Global styles and CSS modules/lib- Utility functions and shared code/hooks- Custom React hooks
npm run dev- Start development servernpm run lint- Run ESLint to check code quality and style
npx prisma generate- Generate Prisma client (run this after schema changes)npx prisma db push- Push schema changes to databasenpx prisma studio- Open Prisma database GUI to view and manage data
npm run build- Build for productionnpm start- Start production server
- Create a new branch for your feature
- Make your changes
- Submit a pull request
If you encounter any issues:
- Make sure all environment variables are properly set
- Verify database connection strings
- Check if all required services are running
- Clear npm cache:
npm cache clean --force - Delete node_modules and reinstall:
rm -rf node_modules && npm install - Run Prisma generate:
npx prisma generate