Skip to content

omerfarukbolat/railhubdev

Repository files navigation

RailHubDev - Railway Development Solutions

Professional railway development website built with Next.js 16, TypeScript, and TailwindCSS

Next.js TypeScript TailwindCSS

✨ Features

  • 🎨 Modern SaaS UI - Clean, professional design with blue-gray color palette
  • πŸŒ“ Dark Mode - Full dark mode support with localStorage persistence
  • πŸ“± Responsive - Mobile-first design (phone, tablet, desktop)
  • ⚑ Performance - React 19 with React Compiler enabled
  • 🎯 Redux Toolkit - Centralized state management
  • 🧩 Component Library - Reusable UI components (Button, Card, Container)
  • βœ… Production Ready - Zero linter errors, successful build

πŸš€ Quick Start

# Install dependencies
npm install

# Run development server
npm run dev
# Open http://localhost:3000

# Build for production
npm run build

# Start production server
npm start

πŸ“„ Pages

Route Description
/ Home page with hero, stats, features
/about Company mission, vision, and story
/expertise Service areas and capabilities
/projects Completed and ongoing projects
/stories Blog/insights section

πŸ—οΈ Project Structure

src/
β”œβ”€β”€ app/
β”‚   β”œβ”€β”€ layout.tsx           # Root layout with Navbar
β”‚   β”œβ”€β”€ page.tsx             # Home page
β”‚   β”œβ”€β”€ about/page.tsx       # About page
β”‚   β”œβ”€β”€ expertise/page.tsx   # Expertise page
β”‚   β”œβ”€β”€ projects/page.tsx    # Projects page
β”‚   └── stories/page.tsx     # Stories page
β”œβ”€β”€ components/
β”‚   β”œβ”€β”€ layout/
β”‚   β”‚   └── Navbar.tsx       # Navigation with theme toggle
β”‚   β”œβ”€β”€ providers/
β”‚   β”‚   └── Providers.tsx    # Redux provider
β”‚   └── ui/
β”‚       β”œβ”€β”€ Button.tsx       # Button component
β”‚       β”œβ”€β”€ Card.tsx         # Card container
β”‚       └── Container.tsx    # Max-width container
β”œβ”€β”€ redux/
β”‚   └── appSlice.ts          # App state slice
└── lib/
    β”œβ”€β”€ store.ts             # Redux store config
    └── utils.ts             # Utility functions (cn)

🎨 Design System

Colors

  • Primary: #005BAA (TCDD Blue)
  • Gray Scale: 50-950
  • Dark Mode: Full support with dark: classes

Typography

  • Font: Inter
  • Headings: Bold, tracking-tight
  • Body: text-base

Spacing

  • Scale: 8px grid (0, 8px, 16px, 24px, 32px, 40px, 48px)
  • Max Width: 1280px (max-w-7xl)

🧩 Components

Button

import { Button } from '@/components/ui/Button';

<Button variant="primary" size="md">
  Click Me
</Button>

// Variants: primary, secondary, outline, ghost
// Sizes: sm, md, lg

Card

import { Card } from '@/components/ui/Card';

<Card>
  <h3>Card Title</h3>
  <p>Card content...</p>
</Card>

Container

import { Container } from '@/components/ui/Container';

<Container>
  <div>Centered content with max-width</div>
</Container>

πŸŒ“ Dark Mode

Dark mode is implemented with:

  • TailwindCSS dark: classes
  • localStorage persistence
  • Theme toggle in Navbar (moon/sun icon)
  • System preference detection on first load

🎯 Redux State

The app uses Redux Toolkit for state management:

// src/redux/appSlice.ts
interface AppState {
  theme: 'light' | 'dark';
  sidebarOpen: boolean;
}

Access state in components:

import { useSelector } from 'react-redux';
import { RootState } from '@/lib/store';

const theme = useSelector((state: RootState) => state.app.theme);

πŸ“¦ Tech Stack

  • Framework: Next.js 16 (App Router)
  • Language: TypeScript
  • Styling: TailwindCSS v4
  • State: Redux Toolkit
  • Compiler: React Compiler (enabled)
  • Node: v18+

πŸ› οΈ Configuration

Tailwind Config

Located at tailwind.config.ts:

  • Custom primary color palette
  • Dark mode: class strategy
  • 8px spacing scale
  • Inter font family

Next.js Config

Located at next.config.ts:

  • React Compiler enabled
  • TypeScript strict mode

πŸ“± Responsive Design

Breakpoints:

  • sm: 640px
  • md: 768px
  • lg: 1024px
  • xl: 1280px
  • 2xl: 1536px

Mobile-first approach with TailwindCSS responsive utilities.

βœ… Production Checklist

  • βœ… TypeScript strict mode
  • βœ… No linter errors
  • βœ… Build successful
  • βœ… All pages functional
  • βœ… Dark mode working
  • βœ… Responsive tested
  • βœ… Redux integrated

πŸš€ Deployment

Build the project:

npm run build

The output will be in .next folder, ready for deployment to:

  • Vercel (recommended)
  • Any Node.js hosting
  • Docker container

πŸ“š Adding New Pages

  1. Create a new folder in src/app/:
mkdir -p src/app/my-page
  1. Add page.tsx:
export default function MyPage() {
  return (
    <div>
      <h1>My New Page</h1>
    </div>
  );
}
  1. The route will be available at /my-page

🎨 Adding New Components

  1. Create in src/components/ui/:
// src/components/ui/MyComponent.tsx
export function MyComponent() {
  return <div>Component</div>;
}
  1. Import and use:
import { MyComponent } from '@/components/ui/MyComponent';

πŸ’‘ Development Tips

  1. Hot Reload: Changes auto-reload in dev mode
  2. TypeScript: Use strict types for better DX
  3. Tailwind: Use className instead of style
  4. Components: Keep them reusable and atomic
  5. Redux: Only for global state, local state with useState

πŸ“„ License

Β© 2024 RailHubDev. All rights reserved.


Built with ❀️ using Next.js 16, TypeScript, and TailwindCSS

About

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors