Skip to content

About

For the TAMID Challenge where I have chosen to do the Tech Blog Full Stack Application

Resources

Stars

1 star

Watchers

1 watching

Forks

Latest commit

ย 

History

28 Commits

Folders and files

NameName
Last commit message
Last commit date
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation

TAMID Tech Blog

A modern, full-stack blog platform built for the TAMID Tech Challenge, featuring user authentication, image uploads, responsive design, and comprehensive content management capabilities.

TAMID Tech Blog

๐Ÿš€ Live Demo

๐Ÿ“‹ Table of Contents

๐ŸŽฏ Overview

The TAMID Tech Blog is a full-stack blogging platform I built for the TAMID Tech Challenge. This blog app includes features such as the ability for a user to upload images, assign tags, make descriptions & titles, filter out the blogs by tags, have other users view public blog posts from other users, and UPDATE, DELETE, READ, AND CREATE blog posts. The home page is dynamic as well as the category cards update dynamically according to new tags made by the users. The Blog application has Google Auth configured meaning that all sign-ins are made through google using supabase's Google OAuth for extra security instead of storing passwords in the database. The entire application is also responsive meaning you can use the application on your phone, and everything is scaled appropriately. I spent a lot of time on this app especially configuring the supabase backend, object storage, auth, and trying to fix the vercel hosting issues for both backend and frontend. I learned a lot and gained a whole new view into full-stack development especially by using new UI libraries like framer-motion which made the UI animation sleek and clean. I have everything documented in this README.md. If you want to host the app yourself locally or if youโ€™re interested in how I made the app feel free to explore this documentation file. Hopefully you like it ๐Ÿ˜

Key Highlights

  • Full-Stack TypeScript Application with type safety throughout
  • Modern React Frontend with Framer Motion animations and tailwind css
  • RESTful Express.js Backend with API endpoints
  • Supabase Integration for authentication, database, and file storage
  • Responsive Design optimized for all device sizes (mobile and desktop)
  • Image Upload & Management with cloud storage using supabase
  • Tag-based Content Organization for easy discovery
  • Protected Routes with supabase access tokens to enable authorization of pages logged in and logged out users can access

๐Ÿ›  Technologies Used

Frontend

  • React 18 - Modern React with hooks and functional components
  • TypeScript - Type-safe JavaScript for better development experience
  • Vite - Fast build tool and development server
  • React Router DOM - Client-side routing and navigation
  • Tailwind CSS - Utility-first CSS framework for styling
  • Framer Motion - Smooth animations and transitions
  • Lucide React - Beautiful, customizable icons
  • Axios - HTTP client for API requests

Backend

  • Node.js - JavaScript runtime environment
  • Express.js - Web application framework
  • TypeScript - Type-safe server-side development
  • Supabase Client - Database and authentication integration
  • Multer - File upload middleware
  • CORS - Cross-origin resource sharing
  • dotenv - Environment variable management
  • UUID - Unique identifier generation

Database & Services

  • Supabase - Backend-as-a-Service providing:
    • PostgreSQL database
    • Authentication & user management
    • File storage (images)
    • Row Level Security (RLS) policies

Deployment & Hosting

  • Vercel - Frontend and backend deployment
  • Supabase Cloud - Database and storage hosting
  • GitHub - Version control and CI/CD integration

Development Tools

  • ESLint - Code linting and quality assurance (Very useful)
  • PostCSS - CSS processing
  • Autoprefixer - CSS vendor prefixing
  • ts-node-dev - TypeScript development server

๐Ÿ— Architecture

The application follows a modern full-stack architecture with clear separation of concerns:

โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”    โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”    โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
โ”‚   React Client  โ”‚    โ”‚  Express API    โ”‚    โ”‚    Supabase     โ”‚
โ”‚                 โ”‚    โ”‚                 โ”‚    โ”‚                 โ”‚
โ”‚  โ€ข Components   โ”‚โ—„โ”€โ”€โ–บโ”‚  โ€ข Controllers  โ”‚โ—„โ”€โ”€โ–บโ”‚  โ€ข PostgreSQL   โ”‚
โ”‚  โ€ข Pages        โ”‚    โ”‚  โ€ข Routes       โ”‚    โ”‚  โ€ข Auth         โ”‚
โ”‚  โ€ข Context      โ”‚    โ”‚  โ€ข Middleware   โ”‚    โ”‚  โ€ข Storage      โ”‚
โ”‚  โ€ข Hooks        โ”‚    โ”‚  โ€ข Utils        โ”‚    โ”‚                 โ”‚
โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜    โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜    โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜

Frontend Architecture

The frontend follows a component-based architecture with:

  • Pages: Route-level components (HomePage, CreatePostPage, etc.)
  • Components: Reusable UI components (Navbar, ImageUpload, etc.)
  • Context: Authentication state management with React Context for authorization of users
  • Hooks: Custom hooks for data fetching and state management
  • Utils: API client configuration and helper functions

Backend Architecture

The backend implements a RESTful API with:

  • Controllers: Business logic for handling requests
  • Routes: API endpoint definitions and middleware application
  • Middleware: Authentication, CORS, and error handling (CORS meaning that if a another website tries accessing the database CORS will not allow it and only allow specified websites)
  • Utils: Database connection and utility functions
  • Types: TypeScript type definitions

โœจ Features

๐Ÿ” Authentication & User Management

  • Supabase Authentication with email/password
  • Token Management with automatic refresh
  • Protected Routes requiring authentication
  • User Profile Management with automatic sync
  • Session Persistence across browser sessions

๐Ÿ“ Content Management

  • Rich Text Blog Posts with title and content
  • Tag System for content categorization
  • Public/Private Post Visibility control
  • Post CRUD Operations (Create, Read, Update, Delete)
  • Author Attribution with user profiles
  • Search and Filtering by tags and content

๐Ÿ–ผ Image Management

  • Multiple Image Upload per post (up to 5 images)
  • Drag & Drop Interface for easy uploading
  • Image Preview with removal capabilities
  • Cloud Storage via Supabase Storage
  • Automatic Image Optimization and compression
  • Progress Indicators during upload

๐ŸŽจ User Interface

  • Responsive Design for mobile, tablet, and desktop
  • Dark Theme with TAMID brand colors
  • Smooth Animations using Framer Motion
  • Loading States and error handling
  • Intuitive Navigation with breadcrumbs
  • Modern Card-based Layout for content display

๐Ÿท Content Discovery

  • Tag-based Filtering for easy content discovery
  • Featured Content sections
  • Recent Posts with chronological ordering
  • Author-based Filtering and profiles
  • Search Functionality across titles and content

๐Ÿ“ฑ TAMID-Specific Features

  • TAMID Tracks Page showcasing organization programs
  • Brand-consistent Design with TAMID colors and styling
  • Community Features for member engagement
  • Professional Layout suitable for organizational use

๐Ÿ“ Project Structure

TAMID-Tech-Blog-Challenge/
โ”œโ”€โ”€ frontend/                    # React TypeScript frontend
โ”‚   โ”œโ”€โ”€ src/
โ”‚   โ”‚   โ”œโ”€โ”€ components/         # Reusable UI components
โ”‚   โ”‚   โ”‚   โ”œโ”€โ”€ Navbar.tsx     # Navigation component
โ”‚   โ”‚   โ”‚   โ”œโ”€โ”€ ImageUpload.tsx # Image upload functionality
โ”‚   โ”‚   โ”‚   โ”œโ”€โ”€ ImageGallery.tsx # Image display component
โ”‚   โ”‚   โ”‚   โ”œโ”€โ”€ ProtectedRoute.tsx # Route protection
โ”‚   โ”‚   โ”‚   โ””โ”€โ”€ GoogleLogin.tsx # OAuth integration
โ”‚   โ”‚   โ”œโ”€โ”€ pages/             # Route-level components
โ”‚   โ”‚   โ”‚   โ”œโ”€โ”€ HomePage.tsx   # Main blog listing
โ”‚   โ”‚   โ”‚   โ”œโ”€โ”€ CreatePostPage.tsx # Post creation/editing
โ”‚   โ”‚   โ”‚   โ”œโ”€โ”€ PostDetailPage.tsx # Individual post view
โ”‚   โ”‚   โ”‚   โ”œโ”€โ”€ MyPostsPage.tsx # User's posts management
โ”‚   โ”‚   โ”‚   โ”œโ”€โ”€ LoginPage.tsx  # Authentication
โ”‚   โ”‚   โ”‚   โ”œโ”€โ”€ RegisterPage.tsx # User registration
โ”‚   โ”‚   โ”‚   โ”œโ”€โ”€ TracksPage.tsx # TAMID tracks information
โ”‚   โ”‚   โ”‚   โ””โ”€โ”€ NotFoundPage.tsx # 404 error page
โ”‚   โ”‚   โ”œโ”€โ”€ context/           # React Context providers
โ”‚   โ”‚   โ”‚   โ””โ”€โ”€ auth/          # Authentication context
โ”‚   โ”‚   โ”‚       โ”œโ”€โ”€ authProvider.tsx # Auth state management
โ”‚   โ”‚   โ”‚       โ””โ”€โ”€ supabaseClient.tsx # Supabase configuration
โ”‚   โ”‚   โ”œโ”€โ”€ lib/               # Utility libraries
โ”‚   โ”‚   โ”‚   โ””โ”€โ”€ api.ts         # Axios configuration
โ”‚   โ”‚   โ”œโ”€โ”€ assets/            # Static assets
โ”‚   โ”‚   โ”œโ”€โ”€ App.tsx            # Main application component
โ”‚   โ”‚   โ”œโ”€โ”€ main.tsx           # Application entry point
โ”‚   โ”‚   โ””โ”€โ”€ index.css          # Global styles
โ”‚   โ”œโ”€โ”€ package.json           # Frontend dependencies
โ”‚   โ”œโ”€โ”€ vite.config.ts         # Vite configuration
โ”‚   โ”œโ”€โ”€ tailwind.config.js     # Tailwind CSS configuration
โ”‚   โ””โ”€โ”€ tsconfig.json          # TypeScript configuration
โ”œโ”€โ”€ backend/                    # Express TypeScript backend
โ”‚   โ”œโ”€โ”€ src/
โ”‚   โ”‚   โ”œโ”€โ”€ controllers/       # Request handlers
โ”‚   โ”‚   โ”‚   โ”œโ”€โ”€ authController.ts # Authentication logic
โ”‚   โ”‚   โ”‚   โ”œโ”€โ”€ postController.ts # Blog post operations
โ”‚   โ”‚   โ”‚   โ””โ”€โ”€ imageController.ts # Image upload handling
โ”‚   โ”‚   โ”œโ”€โ”€ routes/            # API route definitions
โ”‚   โ”‚   โ”‚   โ”œโ”€โ”€ authRoutes.ts  # Authentication endpoints
โ”‚   โ”‚   โ”‚   โ”œโ”€โ”€ postRoutes.ts  # Blog post endpoints
โ”‚   โ”‚   โ”‚   โ””โ”€โ”€ imageRoutes.ts # Image upload endpoints
โ”‚   โ”‚   โ”œโ”€โ”€ middleware/        # Express middleware
โ”‚   โ”‚   โ”‚   โ””โ”€โ”€ authMiddleware.ts # JWT verification
โ”‚   โ”‚   โ”œโ”€โ”€ utils/             # Utility functions
โ”‚   โ”‚   โ”‚   โ””โ”€โ”€ supabase.ts    # Supabase client configuration
โ”‚   โ”‚   โ”œโ”€โ”€ types/             # TypeScript type definitions
โ”‚   โ”‚   โ””โ”€โ”€ index.ts           # Server entry point
โ”‚   โ”œโ”€โ”€ package.json           # Backend dependencies
โ”‚   โ”œโ”€โ”€ vercel.json            # Vercel deployment configuration
โ”‚   โ””โ”€โ”€ tsconfig.json          # TypeScript configuration
โ””โ”€โ”€ README.md                   # Project documentation

๐Ÿš€ Installation & Setup

Prerequisites

  • Node.js (v18 or higher)
  • npm or yarn
  • Supabase Account for database and authentication
  • Vercel Account for deployment (optional)

1. Clone the Repository

git clone https://github.com/your-username/TAMID-Tech-Blog-Challenge.git
cd TAMID-Tech-Blog-Challenge

2. Backend Setup

cd backend
npm install

Create a .env file in the backend directory:

# Supabase Configuration
SUPABASE_URL=your_supabase_project_url
SUPABASE_ANON_KEY=your_supabase_anon_key

# Server Configuration
PORT=5001
NODE_ENV=development

3. Frontend Setup

cd ../frontend
npm install

Create a .env file in the frontend directory:

# Supabase Configuration
VITE_SUPABASE_URL=your_supabase_project_url
VITE_SUPABASE_ANON_KEY=your_supabase_anon_key

# API Configuration
VITE_API_BASE_URL=http://localhost:5001/api

4. Database Setup

Set up the following tables in your Supabase project:

Users Table

CREATE TABLE users (
  id UUID PRIMARY KEY DEFAULT gen_random_uuid(),
  name TEXT NOT NULL,
  email TEXT UNIQUE NOT NULL,
  created_at TIMESTAMP WITH TIME ZONE DEFAULT NOW(),
  updated_at TIMESTAMP WITH TIME ZONE DEFAULT NOW()
);

Posts Table

CREATE TABLE posts (
  id UUID PRIMARY KEY DEFAULT gen_random_uuid(),
  title TEXT NOT NULL,
  content TEXT NOT NULL,
  author_id UUID REFERENCES users(id) ON DELETE CASCADE,
  is_public BOOLEAN DEFAULT true,
  images TEXT[],
  created_at TIMESTAMP WITH TIME ZONE DEFAULT NOW(),
  updated_at TIMESTAMP WITH TIME ZONE DEFAULT NOW()
);

Tags Table

CREATE TABLE tags (
  id UUID PRIMARY KEY DEFAULT gen_random_uuid(),
  name TEXT UNIQUE NOT NULL,
  created_at TIMESTAMP WITH TIME ZONE DEFAULT NOW()
);

Post Tags Junction Table

CREATE TABLE post_tags (
  id UUID PRIMARY KEY DEFAULT gen_random_uuid(),
  post_id UUID REFERENCES posts(id) ON DELETE CASCADE,
  tag_id UUID REFERENCES tags(id) ON DELETE CASCADE,
  UNIQUE(post_id, tag_id)
);

5. Storage Setup

Create a storage bucket named blog-images in your Supabase project for image uploads.

6. Run the Application

Start the backend server:

cd backend
npm run dev

Start the frontend development server:

cd frontend
npm run dev

The application will be available at:

  • Frontend: http://localhost:5173
  • Backend API: http://localhost:5001

๐Ÿ—„ Database Schema

The application uses a PostgreSQL database hosted on Supabase with the following schema:

Entity Relationship Diagram

โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”    โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”    โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”    โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
โ”‚    users    โ”‚    โ”‚    posts    โ”‚    โ”‚ post_tags   โ”‚    โ”‚    tags     โ”‚
โ”œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ค    โ”œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ค    โ”œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ค    โ”œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ค
โ”‚ id (PK)     โ”‚โ—„โ”€โ”€โ”โ”‚ id (PK)     โ”‚โ—„โ”€โ”€โ”โ”‚ id (PK)     โ”‚โ”Œโ”€โ”€โ–บโ”‚ id (PK)     โ”‚
โ”‚ name        โ”‚   โ””โ”‚ author_id   โ”‚   โ””โ”‚ post_id     โ”‚โ”‚   โ”‚ name        โ”‚
โ”‚ email       โ”‚    โ”‚ title       โ”‚    โ”‚ tag_id      โ”‚โ”˜   โ”‚ created_at  โ”‚
โ”‚ created_at  โ”‚    โ”‚ content     โ”‚    โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜    โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜
โ”‚ updated_at  โ”‚    โ”‚ is_public   โ”‚
โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜    โ”‚ images      โ”‚
                   โ”‚ created_at  โ”‚
                   โ”‚ updated_at  โ”‚
                   โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜

Table Descriptions

  • users: Stores user account information synced from Supabase Auth
  • posts: Contains blog post content with author relationships
  • tags: Manages content categorization tags
  • post_tags: Junction table for many-to-many post-tag relationships

๐Ÿ’ป Development Process

Design Philosophy

The development of this blog platform was guided by several key principles:

  1. Type Safety First: Extensive use of TypeScript throughout the stack so that I can keep track of what variable is what (VERY HARD TO DO IN JAVASCRIPT)
  2. Component Reusability: Modular React components for maintainability
  3. Performance Optimization: Lazy loading, optimistic updates, and efficient queries
  4. User Experience: Smooth animations, loading states, and intuitive navigation
  5. Security: token authentication, input validation, and secure file uploads with multer

Code Organization

Frontend Code Structure

The frontend follows React best practices with:

  • Functional Components: Using React hooks for state management
  • Custom Hooks: Extracting reusable logic into custom hooks
  • Context API: Managing global authentication state
  • Component Composition: Building complex UIs from simple components
  • Type-Safe Props: Comprehensive TypeScript interfaces

Backend Code Structure

The backend implements clean architecture principles:

  • Controller Pattern: Separating business logic from route handling
  • Middleware Chain: Modular request processing
  • Error Handling: Comprehensive error catching and user-friendly responses
  • Input Validation: Server-side validation for all endpoints
  • Database Abstraction: Using Supabase client for consistent data access

Development Workflow

  1. Planning: Feature requirements and API design
  2. Backend Development: API endpoints and database schema
  3. Frontend Development: UI components and user interactions
  4. Integration: Connecting frontend and backend
  5. Testing: Manual testing and bug fixes
  6. Deployment: Vercel deployment and environment configuration

๐Ÿšง Challenges Faced

1. Authentication Integration

Challenge: Integrating Supabase authentication with custom backend API in a production environment while maintaining security.

Solution: This was a bit of tedious task in my opinion as I had the authentication set up on my local machine, but it wasnโ€™t working on vercel which I was very confused with at first. But the solution was actually very simple it was basically having envs for the BASE_URL for the backend api route so all I had to do was in vercel in the env section I just had to change those envs. The same thing I had to do with Google cloud console and configure the redirect URLs and do it in supabase as well (which took me a bit of time to notice). Also, another thing was that the redirect url in the code had to be saved to local storage that way all the application had to do was getItem in localStorage and would have the link ready and redirect to that.

2. Image Upload and Management

Challenge: Implementing a robust image upload system with progress tracking, validation, and cloud storage.

Solution: I had to create an image upload component with:

  • File type and size validation
  • Progress tracking during upload
  • Preview functionality with removal options
  • Integration with Supabase Storage for cloud hosting
  • Very hard to do especially configuring wit supabase storage buckets had to look through supabase documentation to figure it out

4. Responsive Design Implementation

Challenge: Creating a consistent, responsive design that works across all device sizes.

Solution: Utilized Tailwind CSS's responsive utilities with a mobile-first approach, implementing custom breakpoints and flexible grid layouts that adapt to different screen sizes. Used keywords such as md: sm: and lg: to do this. Sort of annoying to have to format everything on the website since I was using framer-motion libraries as well.

๐Ÿ”ฎ Future Enhancements

Given more time and resources, the following features would enhance the platform:

1. Advanced Content Features

  • Rich Text Editor: WYSIWYG editor with formatting options
  • Code Syntax Highlighting: Support for code blocks with language-specific highlighting
  • Draft System: Save posts as drafts before publishing
  • Post Scheduling: Schedule posts for future publication
  • Comment System: User comments and discussions on posts

2. Enhanced User Experience

  • Real-time Notifications: Live updates for new posts and interactions
  • Advanced Search: Full-text search with filters and sorting options
  • Bookmarking: Save favorite posts for later reading
  • Reading Progress: Track reading progress on long posts
  • Dark/Light Theme Toggle: User preference for theme selection

3. Social Features

  • User Profiles: Detailed author profiles with bio and social links
  • Following System: Follow favorite authors
  • Post Sharing: Social media integration for sharing posts
  • Like/Reaction System: User engagement metrics
  • Newsletter Subscription: Email notifications for new content

5. Technical Improvements

  • Progressive Web App: Offline reading capabilities
  • Performance Optimization: Image lazy loading, code splitting
  • SEO Enhancement: Meta tags, structured data, sitemap generation
  • API Rate Limiting: Prevent abuse and ensure fair usage
  • Comprehensive Testing: Unit tests, integration tests, E2E tests

6. Integration Features

  • Third-party Authentication: Google, GitHub, LinkedIn login
  • Content Import/Export: Migrate content from other platforms
  • Webhook Support: Integration with external services
  • API Documentation: Interactive API documentation with Swagger
  • Mobile App: React Native mobile application

๐Ÿค Contributing

This project was developed as part of the TAMID Tech Track application process. This codebase demonstrates my proficiency in modern web development technologies and best practices. Hopefully you enjoyed reading through this :)

Code Quality Standards

  • TypeScript: Strict type checking enabled
  • ESLint: Code linting for consistency
  • Component Documentation: Clear prop interfaces and comments
  • Error Handling: Comprehensive error catching and user feedback
  • Security: Input validation and authentication checks

๐Ÿ™ Acknowledgments

  • TAMID Organization for providing the opportunity to build this project
  • Supabase for the excellent backend-as-a-service platform (really grateful for this service honestly)
  • Vercel for seamless deployment and hosting
  • React Community for the amazing ecosystem of tools and libraries

Built with โค๏ธ for TAMID Tech

About

For the TAMID Challenge where I have chosen to do the Tech Blog Full Stack Application

Resources

Stars

1 star

Watchers

1 watching

Forks

Releases

Packages

Used by

Contributors

Languages