Skip to content

Dawn-Of-Justice/gitreadlater

Repository files navigation

πŸš€ GitReadLater - Smart Repository Manager

A full-stack web application that transforms how developers save, organize, and discover GitHub repositories. Built with a focus on robust backend architecture and seamless user experience.

MIT License Node.js React Supabase

🎯 Project Overview

GitReadLater is more than just a bookmark manager - it's a comprehensive repository discovery platform that demonstrates advanced full-stack development skills. The application features a robust backend API, secure authentication, and efficient data management.

πŸŽ₯ Demo Video

Watch GitReadLater in action - see how easy it is to save, organize, and rediscover GitHub repositories:

🎬 Click here to watch the full demo on YouTube - See GitReadLater's features and capabilities in action!

✨ Key Features

πŸ”§ Backend Architecture

  • Express.js REST API with modular service architecture
  • JWT Authentication & Authorization middleware
  • Rate Limiting and security middleware implementation
  • User-scoped database operations with Row Level Security (RLS)
  • GitHub API Integration with OAuth token management
  • Database Schema Design with normalized relationships

🎨 Frontend Capabilities

  • React SPA with Vite build optimization
  • Responsive UI with Tailwind CSS
  • GitHub OAuth Integration for seamless authentication
  • Real-time data synchronization with Supabase
  • Advanced filtering and search functionality

πŸ›‘οΈ Security Implementation

  • Environment variable management with validation scripts
  • CORS configuration for secure cross-origin requests
  • Input validation and sanitization
  • Secure token handling for GitHub API access

πŸ—οΈ Technical Architecture

Backend Services (src/services/)

πŸ“¦ services/
β”œβ”€β”€ πŸ” userService.js       # User management & preferences
β”œβ”€β”€ πŸ“š repositoryService.js # Repository CRUD operations
β”œβ”€β”€ πŸ™ githubService.js     # GitHub API integration
└── πŸ“Š loggingService.cjs   # Application logging

API Endpoints (src/server/index.js)

// Authentication & User Management
GET    /api/user/profile          # User profile data
PUT    /api/user/settings         # Update user preferences

// Repository Management
GET    /api/repositories          # Fetch user repositories
POST   /api/repositories          # Save new repository
PUT    /api/repositories/:id      # Update repository
DELETE /api/repositories/:id      # Remove repository

// GitHub Integration
GET    /api/github/repos/:owner/:repo/readme  # Fetch README content
GET    /api/github/user/starred              # Import starred repos
POST   /api/github/repos/bulk-save           # Batch repository save

Database Schema (supabase/)

-- Core Tables
πŸ“‹ saved_repositories     # Repository storage with metadata
πŸ‘€ user_profiles         # Extended user information
🏷️  repository_tags       # Tagging system
πŸ“ˆ user_analytics        # Usage tracking

πŸš€ Quick Start

Prerequisites

  • Node.js 16+
  • GitHub account for OAuth
  • Supabase account (free tier)

Installation & Setup

  1. Clone and Install
git clone https://github.com/Dawn-Of-Justice/gitreadlater.git
cd gitreadlater
npm install
  1. Environment Configuration
cp .env.example .env
# Configure your environment variables with new Supabase API keys

Environment Variables Setup:

# Supabase Configuration (New API Keys Format)
VITE_SUPABASE_URL=https://your-project-id.supabase.co
VITE_SUPABASE_ANON_KEY=sb_publishable_[your_key_here]

# Backend Service Role Key
SUPABASE_SERVICE_ROLE_KEY=sb_secret_[your_secret_key_here]

# GitHub OAuth
VITE_GITHUB_CLIENT_ID=your_github_client_id
VITE_REDIRECT_URL=http://localhost:5173/auth/callback

⚠️ Important: Use the new Supabase API key format:

  • Publishable Key: Starts with sb_publishable_ (safe for frontend)
  • Secret Key: Starts with sb_secret_ (backend only, never expose)
  1. Database Setup
-- Run SQL files in Supabase SQL Editor
supabase/saved-repositories-schema.sql
supabase/user-subscriptions-schema.sql
supabase/health.sql
  1. GitHub OAuth Configuration
Application: GitReadLater
Homepage URL: http://localhost:5173
Callback URL: https://[project].supabase.co/auth/v1/callback
  1. Start Development Server
npm run dev
# Backend: http://localhost:3001
# Frontend: http://localhost:5173

πŸ—οΈ Development Highlights

Backend Development Skills Demonstrated

πŸ”§ Modular Service Architecture

// Clean separation of concerns
class RepositoryService {
  async saveRepository(repoData, userId) {
    // Business logic implementation
  }
  
  async getUserRepositories(userId, filters) {
    // Complex query handling
  }
}

πŸ›‘οΈ Security Middleware Implementation

// Custom authentication middleware
const authenticateUser = async (req, res, next) => {
  const token = extractBearerToken(req);
  const user = await validateJWT(token);
  req.user = user;
  next();
};

πŸ“Š Database Query Optimization

// Efficient data fetching with joins
const { data } = await supabase
  .from('saved_repositories')
  .select(`
    *,
    repository_tags(tag_name),
    user_profiles(display_name)
  `)
  .eq('user_id', userId)
  .order('created_at', { ascending: false });

πŸ”„ API Rate Limiting

// Custom rate limiting implementation
const rateLimitMiddleware = (req, res, next) => {
  const ip = req.ip;
  if (exceededRateLimit(ip)) {
    return res.status(429).json({ error: 'Too many requests' });
  }
  next();
};

Frontend Development Skills

⚑ State Management

  • Context API for global state
  • Custom hooks for data fetching
  • Optimistic updates for better UX

🎨 UI/UX Design

  • Responsive design with Tailwind CSS
  • Component-based architecture
  • Loading states and error handling

πŸ“ Project Structure

gitreadlater/
β”œβ”€β”€ 🎯 src/
β”‚   β”œβ”€β”€ πŸ–₯️  server/           # Express.js backend
β”‚   β”‚   β”œβ”€β”€ index.js         # Main server file
β”‚   β”‚   └── package.json     # Server dependencies
β”‚   β”œβ”€β”€ 🧩 components/       # React components
β”‚   β”œβ”€β”€ πŸ“„ pages/           # Route components
β”‚   β”œβ”€β”€ πŸ”§ services/        # Business logic layer
β”‚   β”œβ”€β”€ πŸ”— lib/             # Utility functions
β”‚   └── 🎨 styles/          # CSS modules
β”œβ”€β”€ πŸ—„οΈ  supabase/           # Database schemas
β”œβ”€β”€ πŸ”’ scripts/            # Security validation
└── πŸ“ docs/              # Documentation

πŸš€ Deployment

Production-Ready Features

  • Environment variable validation
  • Security checks before build
  • CORS configuration for production
  • Error handling and logging
  • Health check endpoints

Deployment Steps

# Security validation
npm run security-check

# Build optimization
npm run build

# Deploy to Vercel/Netlify
npm run deploy

πŸ”§ Technical Decisions & Learnings

Backend Architecture Choices

  • Express.js: Lightweight and flexible for REST API development
  • Supabase: PostgreSQL with built-in auth and real-time capabilities
  • Service Layer Pattern: Clean separation between routes and business logic
  • Middleware Chain: Custom authentication, rate limiting, and error handling

Database Design

  • Row Level Security (RLS): User data isolation at the database level
  • Normalized Schema: Efficient storage and query performance
  • Indexing Strategy: Optimized queries for common access patterns

Security Implementation

  • JWT Validation: Secure token-based authentication
  • Environment Variables: Secure configuration management
  • Input Sanitization: Protection against injection attacks
  • Rate Limiting: DOS protection and resource management

For Full-Stack Skills

  1. End-to-End Ownership: From database design to frontend deployment
  2. Real-World Problem Solving: Actual use case with practical solutions
  3. Code Quality: Clean architecture, documentation, and testing considerations
  4. DevOps Awareness: Security scripts, environment management, and deployment

πŸ“„ License

This project is licensed under the MIT License - see the LICENSE file for details.

πŸ™ Acknowledgments

  • GitHub API for comprehensive repository data
  • Supabase for backend infrastructure and authentication
  • React Ecosystem for powerful frontend capabilities
  • Open Source Community for inspiration and learning resources

About

Git ReadLater helps you save, organize, and rediscover repositories with custom tags and notes - your personal GitHub bookmarking system.

Resources

License

Contributing

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages