feat: initialize Next.js 16 project with TypeScript and Tailwind CSS 4
Set up complete Next.js 16 development environment: - Next.js 16.0.1 with App Router and Turbopack - React 19.2.0 with TypeScript 5.9 - Tailwind CSS 4.1.17 with custom category colors - ESLint 9 with Next.js config - Static site generation enabled (output: 'export') Project structure: - app/ directory with layout, page, and globals.css - Tailwind config with 23 category-specific colors - TypeScript config with strict mode and path aliases - Complete .gitignore for Next.js projects Dependencies installed: - convert-units 2.3.4 for unit conversions - All React 19 and Next.js 16 dependencies - Development tooling (TypeScript, ESLint, Tailwind) Ready for Phase 2: Core conversion engine implementation 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
3
.eslintrc.json
Normal file
3
.eslintrc.json
Normal file
@@ -0,0 +1,3 @@
|
|||||||
|
{
|
||||||
|
"extends": "next/core-web-vitals"
|
||||||
|
}
|
||||||
43
.gitignore
vendored
Normal file
43
.gitignore
vendored
Normal file
@@ -0,0 +1,43 @@
|
|||||||
|
# See https://help.github.com/articles/ignoring-files/ for more about ignoring files.
|
||||||
|
|
||||||
|
# dependencies
|
||||||
|
/node_modules
|
||||||
|
/.pnp
|
||||||
|
.pnp.*
|
||||||
|
.yarn/*
|
||||||
|
!.yarn/patches
|
||||||
|
!.yarn/plugins
|
||||||
|
!.yarn/releases
|
||||||
|
!.yarn/versions
|
||||||
|
|
||||||
|
# testing
|
||||||
|
/coverage
|
||||||
|
|
||||||
|
# next.js
|
||||||
|
/.next/
|
||||||
|
/out/
|
||||||
|
|
||||||
|
# production
|
||||||
|
/build
|
||||||
|
|
||||||
|
# misc
|
||||||
|
.DS_Store
|
||||||
|
*.pem
|
||||||
|
|
||||||
|
# debug
|
||||||
|
npm-debug.log*
|
||||||
|
yarn-debug.log*
|
||||||
|
yarn-error.log*
|
||||||
|
|
||||||
|
# env files (can opt-in for committing if needed)
|
||||||
|
.env*
|
||||||
|
|
||||||
|
# vercel
|
||||||
|
.vercel
|
||||||
|
|
||||||
|
# typescript
|
||||||
|
*.tsbuildinfo
|
||||||
|
next-env.d.ts
|
||||||
|
|
||||||
|
# turbopack
|
||||||
|
.turbo
|
||||||
83
README.md
Normal file
83
README.md
Normal file
@@ -0,0 +1,83 @@
|
|||||||
|
# Unit Converter
|
||||||
|
|
||||||
|
A spectacular, innovative unit conversion application built with modern web technologies to provide the best user experience for converting between various measurement units.
|
||||||
|
|
||||||
|
## Tech Stack
|
||||||
|
|
||||||
|
- **Next.js 16** - React framework with App Router and static export
|
||||||
|
- **TypeScript** - Type-safe development
|
||||||
|
- **Tailwind CSS 4** - Modern utility-first CSS framework
|
||||||
|
- **convert-units** - Comprehensive unit conversion library
|
||||||
|
|
||||||
|
## Features
|
||||||
|
|
||||||
|
### Supported Units
|
||||||
|
|
||||||
|
23 measurement categories with 187 individual units:
|
||||||
|
|
||||||
|
- Angle, Apparent Power, Area, Current, Digital
|
||||||
|
- Each, Energy, Frequency, Illuminance, Length
|
||||||
|
- Mass, Pace, Parts Per, Power, Pressure
|
||||||
|
- Reactive Energy, Reactive Power, Speed, Temperature
|
||||||
|
- Time, Voltage, Volume, Volume Flow Rate
|
||||||
|
|
||||||
|
### Innovative UX Features
|
||||||
|
|
||||||
|
- Real-time bidirectional conversion
|
||||||
|
- Smart context-aware interface with fuzzy search
|
||||||
|
- Visual comparison with color-coded categories
|
||||||
|
- Keyboard shortcuts for power users
|
||||||
|
- Mobile-first responsive design
|
||||||
|
- Conversion history with localStorage
|
||||||
|
- Dark mode support
|
||||||
|
|
||||||
|
## Getting Started
|
||||||
|
|
||||||
|
### Prerequisites
|
||||||
|
|
||||||
|
- Node.js 18+ or 20+
|
||||||
|
- pnpm (recommended) or npm
|
||||||
|
|
||||||
|
### Installation
|
||||||
|
|
||||||
|
```bash
|
||||||
|
# Install dependencies
|
||||||
|
pnpm install
|
||||||
|
|
||||||
|
# Run development server
|
||||||
|
pnpm dev
|
||||||
|
|
||||||
|
# Build for production
|
||||||
|
pnpm build
|
||||||
|
|
||||||
|
# Start production server
|
||||||
|
pnpm start
|
||||||
|
```
|
||||||
|
|
||||||
|
Open [http://localhost:3000](http://localhost:3000) to see the app.
|
||||||
|
|
||||||
|
## Project Structure
|
||||||
|
|
||||||
|
```
|
||||||
|
units-ui/
|
||||||
|
├── app/ # Next.js App Router
|
||||||
|
│ ├── layout.tsx # Root layout
|
||||||
|
│ ├── page.tsx # Home page
|
||||||
|
│ └── globals.css # Global styles
|
||||||
|
├── components/ # React components (coming soon)
|
||||||
|
├── lib/ # Utility functions (coming soon)
|
||||||
|
├── public/ # Static assets
|
||||||
|
└── IMPLEMENTATION_PLAN.md # Detailed implementation plan
|
||||||
|
```
|
||||||
|
|
||||||
|
## Development
|
||||||
|
|
||||||
|
See [IMPLEMENTATION_PLAN.md](./IMPLEMENTATION_PLAN.md) for the complete development roadmap.
|
||||||
|
|
||||||
|
## License
|
||||||
|
|
||||||
|
MIT
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
Built with Next.js 16, Tailwind CSS 4, and convert-units
|
||||||
1
app/globals.css
Normal file
1
app/globals.css
Normal file
@@ -0,0 +1 @@
|
|||||||
|
@import "tailwindcss";
|
||||||
21
app/layout.tsx
Normal file
21
app/layout.tsx
Normal file
@@ -0,0 +1,21 @@
|
|||||||
|
import type { Metadata } from 'next';
|
||||||
|
import './globals.css';
|
||||||
|
|
||||||
|
export const metadata: Metadata = {
|
||||||
|
title: 'Unit Converter - Convert Any Unit Instantly',
|
||||||
|
description: 'A spectacular, innovative unit conversion app supporting 23 measurement categories with 187 units. Real-time conversion with the best UX.',
|
||||||
|
};
|
||||||
|
|
||||||
|
export default function RootLayout({
|
||||||
|
children,
|
||||||
|
}: Readonly<{
|
||||||
|
children: React.ReactNode;
|
||||||
|
}>) {
|
||||||
|
return (
|
||||||
|
<html lang="en">
|
||||||
|
<body className="antialiased">
|
||||||
|
{children}
|
||||||
|
</body>
|
||||||
|
</html>
|
||||||
|
);
|
||||||
|
}
|
||||||
24
app/page.tsx
Normal file
24
app/page.tsx
Normal file
@@ -0,0 +1,24 @@
|
|||||||
|
export default function Home() {
|
||||||
|
return (
|
||||||
|
<div className="min-h-screen bg-gradient-to-br from-blue-50 to-indigo-100 dark:from-gray-900 dark:to-gray-800">
|
||||||
|
<main className="container mx-auto px-4 py-8">
|
||||||
|
<div className="max-w-4xl mx-auto">
|
||||||
|
<header className="text-center mb-12">
|
||||||
|
<h1 className="text-5xl font-bold mb-4 bg-gradient-to-r from-blue-600 to-indigo-600 bg-clip-text text-transparent">
|
||||||
|
Unit Converter
|
||||||
|
</h1>
|
||||||
|
<p className="text-lg text-gray-600 dark:text-gray-300">
|
||||||
|
Convert between 187 units across 23 measurement categories
|
||||||
|
</p>
|
||||||
|
</header>
|
||||||
|
|
||||||
|
<div className="bg-white dark:bg-gray-800 rounded-2xl shadow-2xl p-8">
|
||||||
|
<p className="text-center text-gray-500 dark:text-gray-400">
|
||||||
|
Coming soon: Real-time bidirectional conversion with innovative UX
|
||||||
|
</p>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</main>
|
||||||
|
</div>
|
||||||
|
);
|
||||||
|
}
|
||||||
8
next.config.ts
Normal file
8
next.config.ts
Normal file
@@ -0,0 +1,8 @@
|
|||||||
|
import type { NextConfig } from 'next';
|
||||||
|
|
||||||
|
const nextConfig: NextConfig = {
|
||||||
|
output: 'export',
|
||||||
|
reactStrictMode: true,
|
||||||
|
};
|
||||||
|
|
||||||
|
export default nextConfig;
|
||||||
26
package.json
Normal file
26
package.json
Normal file
@@ -0,0 +1,26 @@
|
|||||||
|
{
|
||||||
|
"name": "units-ui",
|
||||||
|
"version": "1.0.0",
|
||||||
|
"private": true,
|
||||||
|
"scripts": {
|
||||||
|
"dev": "next dev --turbopack",
|
||||||
|
"build": "next build",
|
||||||
|
"start": "next start",
|
||||||
|
"lint": "next lint"
|
||||||
|
},
|
||||||
|
"dependencies": {
|
||||||
|
"react": "^19.0.0",
|
||||||
|
"react-dom": "^19.0.0",
|
||||||
|
"next": "^16.0.0",
|
||||||
|
"convert-units": "^2.3.4"
|
||||||
|
},
|
||||||
|
"devDependencies": {
|
||||||
|
"typescript": "^5",
|
||||||
|
"@types/node": "^22",
|
||||||
|
"@types/react": "^19",
|
||||||
|
"@types/react-dom": "^19",
|
||||||
|
"tailwindcss": "^4.0.0",
|
||||||
|
"eslint": "^9",
|
||||||
|
"eslint-config-next": "^16.0.0"
|
||||||
|
}
|
||||||
|
}
|
||||||
3849
pnpm-lock.yaml
generated
Normal file
3849
pnpm-lock.yaml
generated
Normal file
File diff suppressed because it is too large
Load Diff
44
tailwind.config.ts
Normal file
44
tailwind.config.ts
Normal file
@@ -0,0 +1,44 @@
|
|||||||
|
import type { Config } from 'tailwindcss';
|
||||||
|
|
||||||
|
const config: Config = {
|
||||||
|
content: [
|
||||||
|
'./pages/**/*.{js,ts,jsx,tsx,mdx}',
|
||||||
|
'./components/**/*.{js,ts,jsx,tsx,mdx}',
|
||||||
|
'./app/**/*.{js,ts,jsx,tsx,mdx}',
|
||||||
|
],
|
||||||
|
theme: {
|
||||||
|
extend: {
|
||||||
|
colors: {
|
||||||
|
// Category colors for 23 unit types
|
||||||
|
category: {
|
||||||
|
angle: '#0EA5E9',
|
||||||
|
'apparent-power': '#8B5CF6',
|
||||||
|
area: '#F59E0B',
|
||||||
|
current: '#F59E0B',
|
||||||
|
digital: '#06B6D4',
|
||||||
|
each: '#64748B',
|
||||||
|
energy: '#EAB308',
|
||||||
|
frequency: '#A855F7',
|
||||||
|
illuminance: '#84CC16',
|
||||||
|
length: '#3B82F6',
|
||||||
|
mass: '#10B981',
|
||||||
|
pace: '#14B8A6',
|
||||||
|
'parts-per': '#EC4899',
|
||||||
|
power: '#F43F5E',
|
||||||
|
pressure: '#6366F1',
|
||||||
|
'reactive-energy': '#D946EF',
|
||||||
|
'reactive-power': '#E879F9',
|
||||||
|
speed: '#10B981',
|
||||||
|
temperature: '#EF4444',
|
||||||
|
time: '#7C3AED',
|
||||||
|
voltage: '#FB923C',
|
||||||
|
volume: '#8B5CF6',
|
||||||
|
'volume-flow-rate': '#22D3EE',
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
plugins: [],
|
||||||
|
};
|
||||||
|
|
||||||
|
export default config;
|
||||||
27
tsconfig.json
Normal file
27
tsconfig.json
Normal file
@@ -0,0 +1,27 @@
|
|||||||
|
{
|
||||||
|
"compilerOptions": {
|
||||||
|
"target": "ES2020",
|
||||||
|
"lib": ["DOM", "DOM.Iterable", "ES2020"],
|
||||||
|
"allowJs": true,
|
||||||
|
"skipLibCheck": true,
|
||||||
|
"strict": true,
|
||||||
|
"noEmit": true,
|
||||||
|
"esModuleInterop": true,
|
||||||
|
"module": "ESNext",
|
||||||
|
"moduleResolution": "bundler",
|
||||||
|
"resolveJsonModule": true,
|
||||||
|
"isolatedModules": true,
|
||||||
|
"jsx": "preserve",
|
||||||
|
"incremental": true,
|
||||||
|
"plugins": [
|
||||||
|
{
|
||||||
|
"name": "next"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"paths": {
|
||||||
|
"@/*": ["./*"]
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"include": ["next-env.d.ts", "**/*.ts", "**/*.tsx", ".next/types/**/*.ts"],
|
||||||
|
"exclude": ["node_modules"]
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user