Skip to content

About

A modern, full-featured portfolio website built with Next.js 16, featuring a public portfolio showcase and a comprehensive admin dashboard for content management.

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Repository files navigation

Flexify Frontend - Next.js Portfolio Application

A modern, full-featured portfolio website built with Next.js 16, featuring a public portfolio showcase and a comprehensive admin dashboard for content management.

πŸ“‹ Table of Contents

🎯 Overview

This frontend application provides both a public-facing portfolio website and an admin dashboard for managing portfolio content. Built with Next.js App Router, featuring multi-language support, responsive design, and modern UI components.

πŸ› οΈ Tech Stack

  • Framework: Next.js 16 (App Router)
  • Language: TypeScript
  • Styling: Tailwind CSS 4
  • UI Components: Radix UI, shadcn/ui
  • State Management: Zustand, TanStack Query (React Query)
  • Forms: React Hook Form + Zod validation
  • Internationalization: next-intl
  • Animations: Framer Motion
  • Icons: Lucide React, Tabler Icons
  • Rich Text Editor: Tiptap
  • HTTP Client: Axios
  • Authentication: Better Auth
  • Tables: TanStack Table
  • Charts: Recharts

πŸ“ Project Structure

client/
β”œβ”€β”€ src/
β”‚   β”œβ”€β”€ app/                       # Next.js App Router
β”‚   β”‚   β”œβ”€β”€ [locale]/              # Internationalized routes
β”‚   β”‚   β”‚   β”œβ”€β”€ layout.tsx         # Root layout with providers
β”‚   β”‚   β”‚   β”‚                       # - Theme provider
β”‚   β”‚   β”‚   β”‚                       # - React Query provider
β”‚   β”‚   β”‚   β”‚                       # - next-intl provider
β”‚   β”‚   β”‚   β”‚                       # - Font loading (Poppins/Cairo)
β”‚   β”‚   β”‚   β”‚
β”‚   β”‚   β”‚   β”œβ”€β”€ (portfolio)/       # Public portfolio routes (route group)
β”‚   β”‚   β”‚   β”‚   β”œβ”€β”€ layout.tsx     # Portfolio layout (navbar, footer)
β”‚   β”‚   β”‚   β”‚   β”‚
β”‚   β”‚   β”‚   β”‚   β”œβ”€β”€ (home)/        # Home page route group
β”‚   β”‚   β”‚   β”‚   β”‚   β”œβ”€β”€ page.tsx   # Home page
β”‚   β”‚   β”‚   β”‚   β”‚   └── _components/
β”‚   β”‚   β”‚   β”‚   β”‚       β”œβ”€β”€ hero-section.tsx
β”‚   β”‚   β”‚   β”‚   β”‚       β”œβ”€β”€ statistics-section.tsx
β”‚   β”‚   β”‚   β”‚   β”‚       β”œβ”€β”€ about-section.tsx
β”‚   β”‚   β”‚   β”‚   β”‚       β”œβ”€β”€ services-section.tsx
β”‚   β”‚   β”‚   β”‚   β”‚       β”œβ”€β”€ featured-projects-section.tsx
β”‚   β”‚   β”‚   β”‚   β”‚       β”œβ”€β”€ testimonials-section.tsx
β”‚   β”‚   β”‚   β”‚   β”‚       └── cta-section.tsx
β”‚   β”‚   β”‚   β”‚   β”‚
β”‚   β”‚   β”‚   β”‚   β”œβ”€β”€ projects/      # Projects pages
β”‚   β”‚   β”‚   β”‚   β”‚   β”œβ”€β”€ page.tsx   # Projects listing
β”‚   β”‚   β”‚   β”‚   β”‚   β”œβ”€β”€ _components/
β”‚   β”‚   β”‚   β”‚   β”‚   β”‚   └── projects-page-client.tsx
β”‚   β”‚   β”‚   β”‚   β”‚   └── [slug]/    # Dynamic project detail
β”‚   β”‚   β”‚   β”‚   β”‚       β”œβ”€β”€ page.tsx
β”‚   β”‚   β”‚   β”‚   β”‚       └── _components/
β”‚   β”‚   β”‚   β”‚   β”‚           └── project-details-client.tsx
β”‚   β”‚   β”‚   β”‚   β”‚
β”‚   β”‚   β”‚   β”‚   β”œβ”€β”€ services/      # Services pages
β”‚   β”‚   β”‚   β”‚   β”‚   β”œβ”€β”€ page.tsx   # Services listing
β”‚   β”‚   β”‚   β”‚   β”‚   β”œβ”€β”€ _components/
β”‚   β”‚   β”‚   β”‚   β”‚   β”‚   └── services-page-client.tsx
β”‚   β”‚   β”‚   β”‚   β”‚   └── [slug]/    # Dynamic service detail
β”‚   β”‚   β”‚   β”‚   β”‚       β”œβ”€β”€ page.tsx
β”‚   β”‚   β”‚   β”‚   β”‚       └── _components/
β”‚   β”‚   β”‚   β”‚   β”‚           └── service-detail-client.tsx
β”‚   β”‚   β”‚   β”‚   β”‚
β”‚   β”‚   β”‚   β”‚   └── contact/       # Contact page
β”‚   β”‚   β”‚   β”‚       β”œβ”€β”€ page.tsx
β”‚   β”‚   β”‚   β”‚       └── _components/
β”‚   β”‚   β”‚   β”‚           └── contact-section.tsx
β”‚   β”‚   β”‚   β”‚
β”‚   β”‚   β”‚   β”œβ”€β”€ auth/              # Authentication pages
β”‚   β”‚   β”‚   β”‚   β”œβ”€β”€ layout.tsx     # Auth layout
β”‚   β”‚   β”‚   β”‚   β”œβ”€β”€ login/
β”‚   β”‚   β”‚   β”‚   β”‚   └── page.tsx
β”‚   β”‚   β”‚   β”‚   β”œβ”€β”€ register/
β”‚   β”‚   β”‚   β”‚   β”‚   └── page.tsx
β”‚   β”‚   β”‚   β”‚   β”œβ”€β”€ forget-password/
β”‚   β”‚   β”‚   β”‚   β”‚   └── page.tsx
β”‚   β”‚   β”‚   β”‚   β”œβ”€β”€ reset-password/
β”‚   β”‚   β”‚   β”‚   β”‚   └── page.tsx
β”‚   β”‚   β”‚   β”‚   └── verify-account/
β”‚   β”‚   β”‚   β”‚       └── page.tsx
β”‚   β”‚   β”‚   β”‚
β”‚   β”‚   β”‚   └── dashboard/         # Admin dashboard
β”‚   β”‚   β”‚       β”œβ”€β”€ layout.tsx     # Dashboard layout (sidebar, header)
β”‚   β”‚   β”‚       β”œβ”€β”€ page.tsx       # Dashboard home
β”‚   β”‚   β”‚       β”‚
β”‚   β”‚   β”‚       β”œβ”€β”€ profile/       # User profile
β”‚   β”‚   β”‚       β”‚   β”œβ”€β”€ page.tsx
β”‚   β”‚   β”‚       β”‚   └── _components/
β”‚   β”‚   β”‚       β”‚       β”œβ”€β”€ profile-page-client.tsx
β”‚   β”‚   β”‚       β”‚       β”œβ”€β”€ overview-tab.tsx
β”‚   β”‚   β”‚       β”‚       β”œβ”€β”€ edit-profile-tab.tsx
β”‚   β”‚   β”‚       β”‚       └── change-password-tab.tsx
β”‚   β”‚   β”‚       β”‚
β”‚   β”‚   β”‚       β”œβ”€β”€ projects/      # Projects management
β”‚   β”‚   β”‚       β”‚   β”œβ”€β”€ page.tsx   # Projects list
β”‚   β”‚   β”‚       β”‚   β”œβ”€β”€ create/
β”‚   β”‚   β”‚       β”‚   β”‚   └── page.tsx
β”‚   β”‚   β”‚       β”‚   β”œβ”€β”€ [id]/
β”‚   β”‚   β”‚       β”‚   β”‚   β”œβ”€β”€ page.tsx
β”‚   β”‚   β”‚       β”‚   β”‚   β”œβ”€β”€ edit/
β”‚   β”‚   β”‚       β”‚   β”‚   β”‚   └── page.tsx
β”‚   β”‚   β”‚       β”‚   β”‚   └── images/
β”‚   β”‚   β”‚       β”‚   β”‚       └── page.tsx
β”‚   β”‚   β”‚       β”‚   └── _components/
β”‚   β”‚   β”‚       β”‚       β”œβ”€β”€ projects-page-client.tsx
β”‚   β”‚   β”‚       β”‚       β”œβ”€β”€ project-form.tsx
β”‚   β”‚   β”‚       β”‚       β”œβ”€β”€ columns.tsx
β”‚   β”‚   β”‚       β”‚       β”œβ”€β”€ data-table-actions.tsx
β”‚   β”‚   β”‚       β”‚       β”œβ”€β”€ data-table-toolbar.tsx
β”‚   β”‚   β”‚       β”‚       β”œβ”€β”€ delete-project-modal.tsx
β”‚   β”‚   β”‚       β”‚       β”œβ”€β”€ project-images-manager.tsx
β”‚   β”‚   β”‚       β”‚       β”œβ”€β”€ project-images-upload.tsx
β”‚   β”‚   β”‚       β”‚       β”œβ”€β”€ project-links-manager.tsx
β”‚   β”‚   β”‚       β”‚       └── thumbnail-upload.tsx
β”‚   β”‚   β”‚       β”‚
β”‚   β”‚   β”‚       β”œβ”€β”€ services/     # Services management
β”‚   β”‚   β”‚       β”œβ”€β”€ categories/    # Categories management
β”‚   β”‚   β”‚       β”œβ”€β”€ technologies/ # Technologies management
β”‚   β”‚   β”‚       β”œβ”€β”€ testimonials/ # Testimonials management
β”‚   β”‚   β”‚       β”œβ”€β”€ contacts/      # Contact inquiries
β”‚   β”‚   β”‚       β”œβ”€β”€ inquiry-types/# Inquiry types
β”‚   β”‚   β”‚       β”œβ”€β”€ users/         # User management
β”‚   β”‚   β”‚       └── settings/      # Site settings
β”‚   β”‚   β”‚           β”œβ”€β”€ page.tsx
β”‚   β”‚   β”‚           └── _components/
β”‚   β”‚   β”‚               β”œβ”€β”€ settings-page-client.tsx
β”‚   β”‚   β”‚               β”œβ”€β”€ hero-tab.tsx
β”‚   β”‚   β”‚               β”œβ”€β”€ about-tab.tsx
β”‚   β”‚   β”‚               β”œβ”€β”€ statistics-tab.tsx
β”‚   β”‚   β”‚               β”œβ”€β”€ footer-tab.tsx
β”‚   β”‚   β”‚               β”œβ”€β”€ github-tab.tsx
β”‚   β”‚   β”‚               └── cv-tab.tsx
β”‚   β”‚   β”‚
β”‚   β”‚   β”œβ”€β”€ globals.css            # Global styles
β”‚   β”‚   β”œβ”€β”€ page.tsx               # Root page (redirects to locale)
β”‚   β”‚   β”œβ”€β”€ error.tsx              # Error boundary
β”‚   β”‚   β”œβ”€β”€ loading.tsx            # Loading component
β”‚   β”‚   └── not-found.tsx          # 404 page
β”‚   β”‚
β”‚   β”œβ”€β”€ components/                # Reusable components
β”‚   β”‚   β”œβ”€β”€ ui/                    # shadcn/ui components
β”‚   β”‚   β”‚                          # - Button, Input, Dialog, etc.
β”‚   β”‚   β”‚                          # - All Radix UI based components
β”‚   β”‚   β”‚
β”‚   β”‚   β”œβ”€β”€ forms/                 # Form components
β”‚   β”‚   β”‚                          # - Reusable form wrappers
β”‚   β”‚   β”‚                          # - Form field components
β”‚   β”‚   β”‚
β”‚   β”‚   β”œβ”€β”€ inputs/                # Input components
β”‚   β”‚   β”‚                          # - Custom input variants
β”‚   β”‚   β”‚                          # - File upload inputs
β”‚   β”‚   β”‚
β”‚   β”‚   β”œβ”€β”€ buttons/               # Button components
β”‚   β”‚   β”‚                          # - Button variants
β”‚   β”‚   β”‚                          # - Icon buttons
β”‚   β”‚   β”‚
β”‚   β”‚   β”œβ”€β”€ auth/                  # Auth-related components
β”‚   β”‚   β”‚   β”œβ”€β”€ auth-guard.tsx     # Auth protection wrapper
β”‚   β”‚   β”‚   └── protected-route.tsx
β”‚   β”‚   β”‚
β”‚   β”‚   β”œβ”€β”€ portfolio/             # Portfolio-specific components
β”‚   β”‚   β”‚                          # - Navbar, Footer
β”‚   β”‚   β”‚                          # - Project cards
β”‚   β”‚   β”‚                          # - Service cards
β”‚   β”‚   β”‚
β”‚   β”‚   β”œβ”€β”€ projects/              # Project-related components
β”‚   β”‚   β”‚                          # - Project display components
β”‚   β”‚   β”‚
β”‚   β”‚   β”œβ”€β”€ services/              # Service-related components
β”‚   β”‚   β”‚                          # - Service display components
β”‚   β”‚   β”‚
β”‚   β”‚   └── shared/                # Shared components
β”‚   β”‚       β”œβ”€β”€ logo.tsx
β”‚   β”‚       └── other shared components
β”‚   β”‚
β”‚   β”œβ”€β”€ modules/                   # Feature modules (API integration)
β”‚   β”‚   β”œβ”€β”€ auth/
β”‚   β”‚   β”‚   β”œβ”€β”€ auth-api.ts        # API functions
β”‚   β”‚   β”‚   β”‚                       # - login, register, etc.
β”‚   β”‚   β”‚   β”œβ”€β”€ auth-hook.ts       # React Query hooks
β”‚   β”‚   β”‚   β”‚                       # - useLogin, useRegister, etc.
β”‚   β”‚   β”‚   └── auth-type.ts       # TypeScript types
β”‚   β”‚   β”‚
β”‚   β”‚   β”œβ”€β”€ projects/
β”‚   β”‚   β”‚   β”œβ”€β”€ projects-api.ts
β”‚   β”‚   β”‚   β”œβ”€β”€ projects-hook.ts
β”‚   β”‚   β”‚   └── projects-type.ts
β”‚   β”‚   β”‚
β”‚   β”‚   β”œβ”€β”€ services/
β”‚   β”‚   β”œβ”€β”€ categories/
β”‚   β”‚   β”œβ”€β”€ technologies/
β”‚   β”‚   β”œβ”€β”€ testimonials/
β”‚   β”‚   β”œβ”€β”€ contacts/
β”‚   β”‚   β”œβ”€β”€ inquiry-types/
β”‚   β”‚   β”œβ”€β”€ site-settings/
β”‚   β”‚   └── users/
β”‚   β”‚
β”‚   β”œβ”€β”€ lib/                       # Utilities and configurations
β”‚   β”‚   β”œβ”€β”€ axios.ts               # Axios instance
β”‚   β”‚   β”‚                           # - Base URL configuration
β”‚   β”‚   β”‚                           # - Request interceptor (token injection)
β”‚   β”‚   β”‚                           # - Response interceptor (token refresh)
β”‚   β”‚   β”‚                           # - Error handling
β”‚   β”‚   └── utils.ts                # Utility functions
β”‚   β”‚                               # - cn() for className merging
β”‚   β”‚                               # - Other helper functions
β”‚   β”‚
β”‚   β”œβ”€β”€ hooks/                     # Custom React hooks
β”‚   β”‚   β”œβ”€β”€ use-debounced-value.ts # Debounce hook
β”‚   β”‚   β”œβ”€β”€ use-file-upload.ts     # File upload hook
β”‚   β”‚   β”œβ”€β”€ use-mobile.ts          # Mobile detection hook
β”‚   β”‚   └── use-query-params.ts    # URL query params hook
β”‚   β”‚
β”‚   β”œβ”€β”€ stores/                    # State management (Zustand)
β”‚   β”‚   └── use-auth-store.ts      # Auth state store
β”‚   β”‚                               # - Access token
β”‚   β”‚                               # - Refresh token
β”‚   β”‚                               # - User data
β”‚   β”‚                               # - Auth actions
β”‚   β”‚
β”‚   β”œβ”€β”€ providers/                 # React context providers
β”‚   β”‚   β”œβ”€β”€ react-query-provider.tsx
β”‚   β”‚   β”‚                           # - TanStack Query provider
β”‚   β”‚   β”‚                           # - Query client configuration
β”‚   β”‚   └── theme-provider.tsx
β”‚   β”‚                               # - next-themes provider
β”‚   β”‚                               # - Dark/light mode
β”‚   β”‚
β”‚   β”œβ”€β”€ constants/                 # Application constants
β”‚   β”‚   β”œβ”€β”€ routes.ts              # Route definitions
β”‚   β”‚   β”œβ”€β”€ auth.constants.ts     # Auth-related constants
β”‚   β”‚   └── site.constants.ts     # Site configuration constants
β”‚   β”‚
β”‚   β”œβ”€β”€ i18n/                      # Internationalization config
β”‚   β”‚   β”œβ”€β”€ routing.ts             # Route configuration
β”‚   β”‚   β”œβ”€β”€ navigation.ts          # Navigation helpers
β”‚   β”‚   └── request.ts             # Server-side i18n
β”‚   β”‚
β”‚   β”œβ”€β”€ types/                     # TypeScript types
β”‚   β”‚   └── api-type.ts            # API response types
β”‚   β”‚
β”‚   └── utils/                     # Utility functions
β”‚       β”œβ”€β”€ dynamic-icon-loader.ts # Dynamic icon loading
β”‚       β”œβ”€β”€ get-dir.ts             # Get text direction (RTL/LTR)
β”‚       β”œβ”€β”€ get-side.ts            # Get sidebar position
β”‚       └── icon-utils.tsx         # Icon utility functions
β”‚
β”œβ”€β”€ messages/                      # Translation files
β”‚   β”œβ”€β”€ en.json                    # English translations
β”‚   β”œβ”€β”€ ar.json                    # Arabic translations
β”‚   └── en.d.json.ts              # Type-safe translation types
β”‚
β”œβ”€β”€ public/                        # Static assets
β”‚   β”œβ”€β”€ images/                   # Image assets
β”‚   β”‚   └── bg-auth.jpg
β”‚   └── Saeed-Altout-CV.pdf       # CV file
β”‚
β”œβ”€β”€ next.config.ts                 # Next.js configuration
β”œβ”€β”€ tailwind.config.ts             # Tailwind CSS configuration
β”œβ”€β”€ tsconfig.json                  # TypeScript configuration
β”œβ”€β”€ components.json                # shadcn/ui configuration
└── package.json

πŸ—οΈ Architecture

Module Structure

Each feature module follows a consistent pattern:

module-name/
β”œβ”€β”€ module-name-api.ts             # API functions
β”‚                                  # - Axios API calls
β”‚                                  # - Request/response handling
β”‚
β”œβ”€β”€ module-name-hook.ts            # React Query hooks
β”‚                                  # - useQuery hooks for fetching
β”‚                                  # - useMutation hooks for mutations
β”‚                                  # - Optimistic updates
β”‚
└── module-name-type.ts            # TypeScript types
                                  # - Request types
                                  # - Response types
                                  # - Shared types

Component Organization

  • Server Components: Default in Next.js App Router for better performance
  • Client Components: Marked with "use client" for interactivity
  • Route Groups: (portfolio), (home) organize routes without affecting URLs
  • Private Components: _components/ folder for page-specific components

State Management

  1. Zustand: Client-side auth state

    • Access token, refresh token
    • User data
    • Auth actions (login, logout, etc.)
  2. React Query: Server state management

    • API data caching
    • Automatic refetching
    • Optimistic updates
    • Loading and error states

API Communication

  • Axios Instance: Configured in lib/axios.ts
    • Automatic token injection via request interceptor
    • Token refresh on 401 errors
    • Request/response transformation
    • Error handling and retry logic

Routing Structure

  • Locale-based Routing: [locale] dynamic segment
    • /en/... for English
    • /ar/... for Arabic
  • Route Groups: Organize routes without URL changes
  • Dynamic Routes: [slug], [id] for dynamic content

πŸš€ Getting Started

Prerequisites

  • Node.js 18+ and npm
  • Backend API running (see server README)

Installation

  1. Install dependencies

    npm install
  2. Set up environment variables

    Create a .env.local file:

    NEXT_PUBLIC_BACKEND_URL=http://localhost:3000/api
    NEXT_PUBLIC_SUPABASE_URL=your_supabase_url
    NEXT_PUBLIC_SUPABASE_ANON_KEY=your_supabase_anon_key
  3. Start development server

    npm run dev

    The application will be available at http://localhost:3001

✨ Features

Public Portfolio

  • Home Page: Hero section, statistics, about, services, featured projects, testimonials
  • Projects: Browse and view project details with images and descriptions
  • Services: View available services with detailed information
  • Contact: Contact form with inquiry type selection
  • Multi-language: English and Arabic with RTL support
  • Responsive Design: Mobile-first, fully responsive
  • Dark Mode: Theme switching support

Admin Dashboard

  • Authentication: Login, registration, email verification, password reset
  • Projects Management: CRUD operations with image galleries
  • Services Management: Manage services with icons and descriptions
  • Categories Management: Organize projects by categories
  • Technologies Management: Manage technology stack
  • Testimonials Management: Add and manage client testimonials
  • Contact Management: View and reply to contact inquiries
  • User Management: Manage users and roles
  • Site Settings: Configure site-wide settings
  • Profile Management: Update profile, change password, upload avatar

Technical Features

  • Server Components: Default for better performance
  • Client Components: For interactivity (forms, modals)
  • Type Safety: Full TypeScript coverage
  • Form Validation: Zod schemas with React Hook Form
  • Image Optimization: Next.js Image component
  • SEO: Metadata API for each page
  • Error Handling: Error boundaries and user-friendly messages
  • Loading States: Loading UI for better UX

πŸ› οΈ Development

Available Scripts

npm run dev            # Start development server
npm run build          # Build for production
npm run start          # Start production server
npm run lint           # Lint code

Code Standards

  • Styling: Use Tailwind CSS for all styling
  • Animations: Use Framer Motion for animations
  • Components: Follow component naming conventions
  • API Validation: Use Zod for all API endpoint validation
  • Types: Export types generated from Zod schemas
  • Naming: Use kebab-case for file names

Adding a New Feature

  1. Create API module in src/modules/feature-name/

    • feature-name-api.ts - API functions
    • feature-name-hook.ts - React Query hooks
    • feature-name-type.ts - Types
  2. Create components in appropriate location

    • Public components in app/[locale]/(portfolio)/...
    • Dashboard components in app/[locale]/dashboard/...
    • Shared components in components/
  3. Add translations in messages/en.json and messages/ar.json

  4. Create pages using Next.js App Router conventions

Component Patterns

Server Component Example:

// app/[locale]/page.tsx
export default async function Page() {
  const data = await fetchData(); // Server-side data fetching
  return <ServerComponent data={data} />;
}

Client Component Example:

// components/example.tsx
"use client";

import { useState } from "react";

export function ClientComponent() {
  const [state, setState] = useState();
  // Client-side interactivity
}

πŸ“ License

This project is private and proprietary.


Built with ❀️ using Next.js

About

A modern, full-featured portfolio website built with Next.js 16, featuring a public portfolio showcase and a comprehensive admin dashboard for content management.

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages