[ ]To Do[x]Done[-]Skipped / Not Applicable
Organize the project files into a standard Next.js (App Router) structure and create necessary configuration files to enable the development server to run correctly.
- Project root:
C:\Projects\Champion-Electrical package.json,pnpm-lock.yaml, andnode_modulesexist in the root.- Core application files (
layout.tsx,page.tsx,globals.css) and components (Header.tsx, etc.) are incorrectly located directly in the root. - Essential configuration files (
next.config.mjs,tsconfig.json,tailwind.config.ts,postcss.config.js) are missing. - The
champion-electrical-exportdirectory appears to be an incomplete/outdated export and should be ignored for core development.
Create the following files in the project root (C:\Projects\Champion-Electrical) with the standard content below:
next.config.mjs
/** @type {import('next').NextConfig} */
const nextConfig = {
reactStrictMode: true,
// Add any other necessary Next.js configurations here
// For App Router, ensure experimental.appDir is not needed (it's default in newer versions)
};
export default nextConfig;tsconfig.json
{
"compilerOptions": {
"target": "es5",
"lib": ["dom", "dom.iterable", "esnext"],
"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": {
"@/*": ["./src/*"]
}
},
"include": ["next-env.d.ts", "**/*.ts", "**/*.tsx", ".next/types/**/*.ts"],
"exclude": ["node_modules"]
}tailwind.config.ts
import type { Config } from "tailwindcss";
const config: Config = {
content: [
"./src/pages/**/*.{js,ts,jsx,tsx,mdx}", // Include if using pages dir eventually
"./src/components/**/*.{js,ts,jsx,tsx,mdx}",
"./src/app/**/*.{js,ts,jsx,tsx,mdx}",
],
theme: {
extend: {
// Add custom theme extensions from globals.css if needed, e.g.:
colors: {
'primary-blue': '#2A4D69',
'primary-blue-light': '#3A6389',
'primary-blue-dark': '#1A3D59',
'accent-gold': '#C8A951',
'accent-gold-light': '#D8B961',
'accent-gold-dark': '#B89941',
'background-light': '#F8F5F0',
'background-off-white': '#F5F2EA',
'text-dark': '#333333',
'text-medium': '#555555',
'text-light': '#777777',
},
fontFamily: {
sans: ['Lato', 'sans-serif'], // Ensure 'Lato' matches globals.css import/usage
serif: ['Playfair Display', 'serif'], // Ensure 'Playfair Display' matches globals.css
},
backgroundImage: {
"gradient-radial": "radial-gradient(var(--tw-gradient-stops))",
"gradient-conic": "conic-gradient(from 180deg at 50% 50%, var(--tw-gradient-stops))",
},
// Add other extensions like spacing, keyframes etc. if defined
},
},
plugins: [],
};
export default config;postcss.config.js
module.exports = {
plugins: {
tailwindcss: {},
autoprefixer: {},
},
};Create the following directory structure within the project root:
src/
├── app/
├── components/
└── lib/
Move the following files from the project root to their correct locations:
layout.tsx->src/app/layout.tsxpage.tsx->src/app/page.tsxglobals.css->src/app/globals.cssHeader.tsx->src/components/Header.tsxFooter.tsx->src/components/Footer.tsxZipCodeValidator.tsx->src/components/ZipCodeValidator.tsxCustomIcons.tsx->src/components/CustomIcons.tsxPremiumElements.tsx->src/components/PremiumElements.tsxsupabaseClient.ts->src/lib/supabaseClient.tsemailService.ts->src/lib/emailService.ts
(Note: This list is based on files identified in the root. Double-check if other relevant .tsx or .ts files exist in the root that should also be moved, e.g., specific page components that might belong under src/app/ subdirectories as per the documentation).
After moving the files, import paths within these files (and potentially others not moved yet) might be broken. For example, Header.tsx might import CustomIcons.tsx. These paths will need to be updated relative to the new file locations (e.g., changing import CustomIcons from './CustomIcons' to import CustomIcons from './CustomIcons' if they are in the same directory, or using alias paths like import CustomIcons from '@/components/CustomIcons' if the tsconfig.json paths are set up).
- Run
pnpm dev: Attempt to start the development server from the root directory (C:\Projects\Champion-Electrical). - Debug Errors: Address any errors that occur during startup or runtime. Common issues might include:
- Incorrect import paths (fix as described in Step 4 above).
- Missing packages (install using
pnpm add <package-name>and add topackage.json). - TypeScript errors (adjust types or code as needed).
- Tailwind CSS class issues (ensure
tailwind.config.tsincludes all necessary paths and theme customizations).
- Verify Functionality: Once the server runs, test the landing page flow and core site navigation.
- Supabase Table: Remember to create the
leadstable in the Supabase project as outlined in thedocumentation.mdfile, including defining columns and configuring Row Level Security (RLS). - Email Service: Plan and implement the email sending logic in
src/lib/emailService.ts.
This restructuring plan is now complete. The project files were organized into the standard Next.js App Router structure (src/app, src/components, src/hooks, src/lib). Necessary configuration files (next.config.mjs, tsconfig.json, tailwind.config.ts, postcss.config.js) were created.
During the process, we identified multiple potential codebase versions:
- Files initially in the root.
- An export in
champion-electrical-export/. - An unpacked archive in
contents of a zip archive found/.
After comparison and investigation, the version backed up to archive_20250428_133909/ was identified as the most recent stable version containing the correct styling (gold accents, etc.) and page structure (excluding the blog). This version was restored.
The hooks directory, missing from the restored version, was copied from the unpacked archive (contents of a zip archive found/.../src/hooks).
Recent Changes/Fixes Applied:
- The
frosted-glassstyle for the header was adjusted inglobals.css(increased background opacity to 95%) to improve text contrast on scroll. - The link on the lead thank-you page (
src/app/thank-you/lead/page.tsx) was corrected to point to/core-site.
Next Steps (Reflected in todo.md):
- Implement the Supabase backend logic for lead capture (table creation, RLS, form submission handling).
- Implement the email notification service (
emailService.ts). - Create the missing blog section (
src/app/core-site/blog). - Continue with general testing and other items outlined in
todo.md.