Prerequisites
Before you begin, ensure you have the following installed on your system:Docker
Required for running PostgreSQL databaseDownload Docker
Bun
Fast JavaScript runtime and package managerInstall Bun
Jefftube uses Bun for all JavaScript operations instead of Node.js or npm. Make sure you have Bun installed before proceeding.
Installation
Follow these steps to get Jefftube running on your local machine:Clone the Repository
Start by cloning the Jefftube repository from GitHub:The repository contains three main directories:
server/- Hono API backendweb/- React frontendscrapper/- Playwright scraper (optional for local development)
Start the Database
Navigate to the server directory and start the PostgreSQL database using Docker Compose:This command starts a PostgreSQL 16 container with the following configuration:
- Container name:
jtube-postgres - Port:
5432 - Database:
jtube - User:
jtube - Password:
jtube
Set Up Database Schema
Push the database schema to your PostgreSQL instance:This creates all necessary tables:
videos- Video metadata and statisticsusers- User accounts (IP-based)comments- Threaded comment systemcomment_likes- Comment reactionsvideo_likes- Video reactions
Install Dependencies and Start Backend
Install server dependencies and start the development server:The API server will start at http://localhost:3001 with hot reload enabled.You should see output similar to:
Start the Frontend (New Terminal)
Open a new terminal window, navigate to the web directory, and start the frontend:The frontend will start at http://localhost:5173 (default Vite port).
Vite will automatically open your browser. If not, manually navigate to http://localhost:5173
Verify Your Installation
Once both servers are running, verify everything is working correctly:Check API Health
Check API Health
Visit the health check endpoint to ensure the API is responding:Expected response:
Check Frontend
Check Frontend
Open your browser to http://localhost:5173You should see the Jefftube interface with:
- Navigation header with theme toggle
- Sidebar with playlist categories
- Main content area (may be empty without seeded data)
Test Database Connection
Test Database Connection
You can verify the database connection by fetching videos:This returns an array of videos (empty array if no data is seeded).
Development Workflow
Now that you have Jefftube running, here are common development tasks:Database Management
Server Commands
Frontend Commands
Environment Variables
The application uses sensible defaults, but you can customize behavior with environment variables:The application will work without these environment variables using defaults. Only create
.env files if you need to override default values.Common Issues
Port Already in Use
Port Already in Use
If port 3001 or 5173 is already in use:For the API server:For the frontend:
Update
vite.config.ts or use:Database Connection Failed
Database Connection Failed
If you see database connection errors:
- Verify Docker is running:
docker ps - Check the container is up:
docker ps | grep jtube-postgres - Restart the database:
bun run db:stop && bun run db:start - Verify the connection string in
server/src/db/index.ts
Module Not Found
Module Not Found
If you encounter missing module errors:
Next Steps
Now that you have Jefftube running locally, explore these resources:Architecture Guide
Understand the full-stack architecture and design decisions
Database Schema
Explore table structures and relationships
API Reference
Learn about available endpoints and data models
Core Features
Deep dive into video browsing, comments, and playlists
Need Help?
GitHub Repository
Found a bug or have questions? Check out the GitHub repository for issues and discussions.