A modern portfolio website built with Remix and deployed on Cloudflare Pages with automated CI/CD using GitHub Actions. This project showcases a full-stack web application with server-side rendering, edge computing capabilities, and modern development practices.
- π Edge-First Architecture: Built for Cloudflare's edge network for lightning-fast global performance
- π¨ Modern UI Components: Crafted with Tailwind CSS, Radix UI primitives, and Lucide React icons
- π± Fully Responsive: Mobile-first design that works seamlessly across all devices
- β‘ Server-Side Rendering: Remix-powered SSR for optimal SEO and performance
- π Automated Deployment: CI/CD pipeline with GitHub Actions for seamless updates
- π― TypeScript: Full type safety throughout the application
- π Interactive Components: Toast notifications and smooth animations
- π Portfolio Sections: About, Experience, Projects, Skills, Blog, and Contact pages
- Remix - Full-stack web framework
- React 18 - UI library with latest features
- TypeScript - Type-safe JavaScript
- Tailwind CSS - Utility-first CSS framework
- Radix UI - Unstyled, accessible UI primitives
- Lucide React - Beautiful & consistent icon pack
- Class Variance Authority - Class utility library
- Cloudflare Pages - Edge deployment platform
- Wrangler - Cloudflare developer platform CLI
- Vite - Next generation frontend build tool
- pnpm - Fast, disk space efficient package manager
- ESLint - Code linting and formatting
- GitHub Actions - CI/CD automation
Before you begin, ensure you have the following installed:
- Node.js β₯ 20.0.0
- pnpm β₯ 9.0.0 (recommended) or npm/yarn
- Git for version control
- Cloudflare Account for deployment
git clone https://github.com/coder7475/cf-remix.git
cd cf-remix
pnpm install
pnpm run dev
The application will be available at http://localhost:5173
Command | Description |
---|---|
pnpm run dev |
Start development server with hot reload |
pnpm run build |
Build the application for production |
pnpm run start |
Preview the built application locally |
pnpm run preview |
Build and preview the application |
pnpm run deploy |
Build and deploy to Cloudflare Pages |
pnpm run typecheck |
Run TypeScript type checking |
pnpm run typegen |
Generate Cloudflare Workers types |
pnpm run lint |
Run ESLint for code quality |
pnpm run cf-typegen |
Alternative command for type generation |
- Local Development: Use
pnpm run dev
for development with hot module replacement - Type Checking: Run
pnpm run typecheck
to ensure type safety - Linting: Use
pnpm run lint
to maintain code quality - Testing Locally: Use
pnpm run start
to test the built application
To run the application using Wrangler (Cloudflare's development environment):
pnpm run build
pnpm run start
This simulates the Cloudflare Pages environment locally, including edge runtime features.
cf-remix/
βββ app/ # Remix application code
β βββ components/ # Reusable React components
β β βββ ui/ # UI primitives and shared components
β β βββ AboutMe.tsx # About section component
β β βββ Banner.tsx # Hero banner component
β β βββ Blog.tsx # Blog section component
β β βββ Experience.tsx # Experience timeline component
β β βββ Footer.tsx # Site footer component
β β βββ GetInTouch.tsx # Contact form component
β β βββ Navbar.tsx # Navigation component
β β βββ Projects.tsx # Projects showcase component
β β βββ Skills.tsx # Skills display component
β βββ hooks/ # Custom React hooks
β βββ libs/ # Utility functions and helpers
β βββ routes/ # Remix route components
β β βββ _index.tsx # Home page route
β β βββ about.tsx # About page route
β β βββ blog.tsx # Blog page route
β β βββ contact.tsx # Contact page route
β β βββ experiences.tsx # Experience page route
β β βββ projects.tsx # Projects page route
β β βββ skills.tsx # Skills page route
β βββ entry.client.tsx # Client-side entry point
β βββ entry.server.tsx # Server-side entry point
β βββ root.tsx # Root application component
β βββ tailwind.css # Global styles and Tailwind imports
βββ build/ # Built application (generated)
βββ public/ # Static assets
βββ .github/ # GitHub Actions workflows
β βββ workflows/
β βββ ci_cd.yml # CI/CD pipeline configuration
βββ package.json # Project dependencies and scripts
βββ wrangler.toml # Cloudflare Workers configuration
βββ vite.config.ts # Vite build configuration
βββ tailwind.config.ts # Tailwind CSS configuration
βββ tsconfig.json # TypeScript configuration
The project uses a custom Tailwind CSS setup with:
- Custom Design System: Consistent spacing, colors, and typography
- Component Variants: Using Class Variance Authority for component styling
- Responsive Design: Mobile-first approach with responsive utilities
- Animations: Smooth transitions and micro-interactions
- Dark Mode Support: Built-in dark mode capabilities
- Atomic Design: Components are organized in a scalable hierarchy
- Accessibility First: All components follow WCAG guidelines
- Reusability: Shared components with flexible prop interfaces
- Type Safety: Full TypeScript integration for component props
Create a .env
file in the root directory for local development:
# Add your environment variables here
# CLOUDFLARE_API_TOKEN=your_api_token
# CLOUDFLARE_ACCOUNT_ID=your_account_id
The wrangler.toml
file configures Cloudflare Workers settings:
name = "cf-remix"
compatibility_date = "2024-02-20"
[site]
bucket = "./build/client"
Custom Vite setup with:
- Remix Integration: Full-stack development with file-based routing
- TypeScript Paths: Absolute imports configuration
- Cloudflare Dev Proxy: Local development with edge runtime
- Future Flags: Latest Remix features enabled
Generate TypeScript types for your Cloudflare bindings:
pnpm run typegen
This command:
- Reads your
wrangler.toml
configuration - Generates TypeScript definitions for Workers APIs
- Updates type definitions for environment bindings
- Ensures type safety across your application
Note: Rerun typegen whenever you modify wrangler.toml
or add new Cloudflare bindings.
The project includes a GitHub Actions workflow that automatically:
- Builds the application on every push to main
- Tests code quality with linting and type checking
- Deploys to Cloudflare Pages
- Notifies of deployment status
For manual deployments:
# Build the application
pnpm run build
# Deploy to Cloudflare Pages
pnpm run deploy
- Cloudflare Account: Set up a Cloudflare account
- Wrangler Authentication: Login with
wrangler login
- GitHub Secrets: Configure deployment secrets in GitHub repository
- Domain Configuration: Set up custom domain (optional)
- Global CDN: Content delivered from 200+ edge locations
- Zero Cold Starts: Instant response times worldwide
- Automatic Scaling: Handles traffic spikes seamlessly
- Built-in Caching: Intelligent edge caching strategies
- Tree Shaking: Eliminates unused code automatically
- Code Splitting: Lazy loading for optimal performance
- Asset Optimization: Automatic image and asset optimization
- Compression: Gzip and Brotli compression enabled
- ESLint: Comprehensive linting rules for JavaScript/TypeScript
- TypeScript: Compile-time error checking and IntelliSense
- Prettier Integration: Consistent code formatting
- Import Sorting: Organized import statements
The GitHub Actions workflow ensures:
- Dependency Installation: Cached for faster builds
- Type Checking: Validates TypeScript across the project
- Linting: Enforces code quality standards
- Build Verification: Ensures successful production builds
- Automated Deployment: Seamless deployment on success
- Fork the repository
- Create a feature branch (
git checkout -b feature/amazing-feature
) - Commit your changes (
git commit -m 'Add some amazing feature'
) - Push to the branch (
git push origin feature/amazing-feature
) - Open a Pull Request
- Follow the existing code style and conventions
- Write meaningful commit messages
- Add appropriate TypeScript types for new features
- Test your changes locally before submitting
- Update documentation for significant changes
- Remix Documentation - Learn Remix framework
- Cloudflare Pages Docs - Deployment platform guide
- Tailwind CSS Guide - Styling documentation
- Vite Documentation - Build tool configuration
- TypeScript Handbook - Type system guide
Development server not starting:
# Clear node_modules and reinstall
rm -rf node_modules pnpm-lock.yaml
pnpm install
pnpm run dev
Type errors after updating dependencies:
# Regenerate types
pnpm run typegen
pnpm run typecheck
Build failures:
# Check for TypeScript errors
pnpm run typecheck
# Check for linting issues
pnpm run lint
Deployment issues:
# Login to Wrangler
wrangler login
# Verify configuration
wrangler pages project list
This project is licensed under the MIT License - see the LICENSE file for details.
- Remix Team for the amazing full-stack framework
- Cloudflare for the edge computing platform
- Tailwind CSS for the utility-first CSS framework
- Radix UI for accessible UI primitives
- Open Source Community for the excellent tools and libraries