VidGram is a modern video sharing platform that combines the best features of Instagram and YouTube, allowing users to upload, discover, and engage with short and long-form video content. Built with performance and user experience in mind, VidGram offers a responsive interface that works seamlessly across mobile and desktop devices.
- Frontend: Next.js 15, React, TypeScript, TailwindCSS
- Backend: tRPC, Node.js
- Database: PostgreSQL with Prisma ORM
- Authentication: NextAuth.js
- File Storage: UploadThing
- Video Transcoding : MUX
- Deployment: Vercel
vidgram/
├── prisma/
│ └── schema.prisma # Database schema
├── public/
│ └── assets/ # Static assets
├── src/
│ ├── app/ # Next.js App Router
│ │ ├── (home)/ # Home route group
│ │ ├── (auth)/ # Authentication route group
│ │ ├── (studio)/ # Creator studio route group
│ │ └── api/ # API routes
│ ├── components/ # Shared UI components
│ │ ├── ui/ # Core UI components
│ │ └── forms/ # Form components
│ ├── lib/ # Utility functions
│ ├── modules/ # Feature modules
│ │ ├── home/ # Home page module
│ │ ├── studio/ # Studio module
│ │ ├── video/ # Video module
│ │ └── user/ # User module
│ ├── trpc/ # tRPC configuration
│ │ ├── client.ts # Client-side config
│ │ ├── server.ts # Server-side config
│ │ └── routers/ # API routers
│ ├── hooks/ # Custom React hooks
│ ├── store/ # State management
│ └── types/ # TypeScript type definitions
├── .env.example # Example environment variables
├── next.config.js # Next.js configuration
├── package.json # Dependencies
└── tsconfig.json # TypeScript configuration
// Simplified schema.prisma
model User {
id String @id @default(cuid())
username String @unique
email String @unique
password String?
avatar String?
bio String?
verified Boolean @default(false)
createdAt DateTime @default(now())
updatedAt DateTime @updatedAt
videos Video[]
comments Comment[]
likes Like[]
}
model Video {
id String @id @default(cuid())
title String
description String?
url String
thumbnail String?
duration Int
views Int @default(0)
published Boolean @default(false)
createdAt DateTime @default(now())
updatedAt DateTime @updatedAt
userId String
user User @relation(fields: [userId], references: [id])
categoryId String
category Category @relation(fields: [categoryId], references: [id])
comments Comment[]
likes Like[]
}
model Category {
id String @id @default(cuid())
name String
slug String @unique
icon String?
parentId String?
parent Category? @relation("SubCategories", fields: [parentId], references: [id])
children Category[] @relation("SubCategories")
videos Video[]
}
model Comment {
id String @id @default(cuid())
content String
createdAt DateTime @default(now())
userId String
user User @relation(fields: [userId], references: [id])
videoId String
video Video @relation(fields: [videoId], references: [id])
}
model Like {
id String @id @default(cuid())
createdAt DateTime @default(now())
userId String
user User @relation(fields: [userId], references: [id])
videoId String
video Video @relation(fields: [videoId], references: [id])
@@unique([userId, videoId])
}VidGram follows a modular architecture with a clear separation of concerns:
- Node.js 18+ and npm/yarn/bun
- PostgreSQL database
- Git
-
Clone the repository:
git clone https://github.com/yourusername/vidgram.git cd vidgram -
Install dependencies:
npm install # or yarn install # or bun install
-
Set up environment variables:
cp .env.example .env.local # Edit .env.local with your database credentials and API keys -
Set up the database:
npx prisma migrate dev npx prisma generate
-
Run the development server:
npm run dev # or yarn dev # or bun dev
npm run devnpm run buildnpm run testBuilt with 💖 by Nerdy Abhi



