Modern Frontend Development Standards & Implementation Guide
A Q&A guide to building reusable, responsive, themeable and SEO-friendly Next.js apps: consistent design, layouts, and how to add or edit pages and sections.
On this page
A practical question-and-answer guide for building reusable, responsive, SEO-friendly, and maintainable Next.js applications.
The goal is to establish a consistent development approach so that pages and features can be added or edited easily across projects.
1. HTML / DESIGN SYSTEM
Q: How should we maintain a consistent design across the project?#
Context / Problem: Different components can easily develop inconsistent colors, spacing, typography, borders, and themes.
Solution / Approach: Use Tailwind CSS + shadcn/ui + CSS variables, with tweakcn-compatible theme variables for centralized design customization.
Reference:
- shadcn/ui
- Tailwind CSS
- tweakcn
Q: How should we make the application themeable?#
Context / Problem: Changing the entire application's visual style should not require editing individual components.
Solution / Approach: Store colors, typography-related values, radius, and other design tokens in CSS variables and consume them through Tailwind/shadcn components.
Reference:
- shadcn/ui theming
- tweakcn
Q: How should HTML be structured?#
Context / Problem:
Using generic <div> elements everywhere makes the page harder to understand and can negatively affect accessibility and SEO.
Solution / Approach:
Use semantic HTML5 elements such as <header>, <nav>, <main>, <section>, <article>, <aside>, and <footer> according to their meaning.
Reference:
- MDN
- HTML Living Standard
Q: How should pages work on different screen sizes?#
Context / Problem: The same page must work correctly on mobile, tablet, laptop, and large desktop screens.
Solution / Approach: Use mobile-first responsive Tailwind CSS utilities with reusable responsive layout/container components.
Reference:
- Tailwind CSS responsive design
- CSS media queries
Q: How should reusable layouts be created?#
Context / Problem: Repeatedly writing flex, grid, spacing, alignment, and container CSS makes pages harder to maintain.
Solution / Approach: Create reusable layout primitives such as Container, Stack, Center, Grid, Split, Section, PageLayout, and Sidebar layouts.
Reference:
- Internal component library
- CSS Flexbox
- CSS Grid
2. STATIC PAGES
Q: How should static pages be created?#
Context / Problem:
Hardcoding every page directly inside page.tsx makes content difficult to maintain and pages difficult to reuse.
Solution / Approach: Use configuration/data-driven pages where page content and sections are defined through configuration and rendered using reusable components.
Reference:
- Internal page architecture
- Next.js App Router
Q: How should I add a new page quickly?#
Context / Problem: Creating a new page should not require rebuilding the same layout and components.
Solution / Approach:
Create route → Create page config → Select sections → Add content → Configure SEO → Validate
Reference:
- Internal page configuration system
Q: How should existing pages be edited?#
Context / Problem: Changing content should not require modifying complex UI components.
Solution / Approach: Keep content and page configuration separate from presentation components, so content can be edited without changing the underlying UI.
Reference:
- Internal config-driven page system
Q: How should reusable page sections be handled?#
Context / Problem: Most pages contain repeated patterns such as Hero, Features, FAQ, CTA, Testimonials, Pricing, and Contact sections.
Solution / Approach: Build a reusable section library and allow pages to compose sections through configuration.
Reference:
- Internal section library
3. TEMPLATE / PROJECT STARTER
Q: How should a new Next.js project be started?#
Context / Problem: Setting up the same architecture, dependencies, UI system, utilities, SEO, and configurations repeatedly wastes time.
Solution / Approach:
Maintain a reusable create-next-template containing the project's standard architecture and commonly required features.
Reference:
- Internal
create-next-template`
Q: What should the project template contain?#
Context / Problem: A starter template should provide more than a basic Next.js installation.
Solution / Approach: Include TypeScript, Tailwind CSS, shadcn/ui, theme system, reusable components, layouts, forms, validation, SEO, image handling, utilities, and project conventions.
Reference:
- Internal project template
- Next.js documentation
4. FORMS
Q: How should forms be implemented?#
Context / Problem: Different forms can end up with different state management, validation, error handling, and submission behavior.
Solution / Approach:
Use React Hook Form with reusable form components such as GlobalInputForm and centralized validation schemas.
Reference:
- React Hook Form
- Zod
Q: How should form validation be handled?#
Context / Problem: Validation logic should not be duplicated across individual input components.
Solution / Approach: Keep validation in schema-based validation definitions and connect them to React Hook Form.
Reference:
- Zod
- React Hook Form
Q: How should multiple forms share common behavior?#
Context / Problem: Login, registration, contact, search, profile, and other forms often repeat the same UI and behavior.
Solution / Approach: Create reusable form primitives and a common form pattern while allowing each form to provide its own fields, schema, and submit logic.
Reference:
- Internal form component system
- React Hook Form
Q: How should CAPTCHA be integrated?#
Context / Problem: Public forms can receive automated spam and bot submissions.
Solution / Approach: Integrate Google reCAPTCHA through a reusable CAPTCHA component that can be attached to required forms.
Reference:
- Google reCAPTCHA
5. IMAGES
Q: How should images be displayed in Next.js?#
Context / Problem: Raw images can cause unnecessary bandwidth usage and poor loading performance.
Solution / Approach:
Use the Next.js Image component for responsive sizing, optimization, lazy loading, and modern image formats.
Reference:
Q: Which image formats should we use?#
Context / Problem: JPEG and PNG images can be unnecessarily large for web delivery.
Solution / Approach: Prefer AVIF/WebP where appropriate, while keeping suitable fallbacks and source images when required.
Reference:
- Next.js Image
- MDN image formats
Q: How should uploaded images be compressed?#
Context / Problem: Large source images increase storage and page-transfer size.
Solution / Approach: Compress images before publishing using TinyPNG or an equivalent image optimization tool.
Reference:
- TinyPNG
- Web performance guidelines
Q: What should be checked before adding an image?#
Context / Problem: Images need to satisfy both visual and technical requirements.
Solution / Approach: Check format, dimensions, file size, compression, aspect ratio, responsive behavior, loading strategy, and alt text.
Reference:
- Next.js Image
- Accessibility guidelines
6. SEO
Q: How should page metadata be managed?#
Context / Problem: Every page needs unique and correct title and description information.
Solution / Approach: Use Next.js Metadata API or next-seo where appropriate, with metadata generated from page configuration.
Reference:
- Next.js Metadata
- next-seo
Q: How should canonical URLs be handled?#
Context / Problem: The same content can sometimes be accessible through multiple URLs.
Solution / Approach: Generate canonical URLs centrally from the page's route/configuration.
Reference:
- Google Search Central
- Next.js SEO documentation
Q: How should Open Graph metadata be handled?#
Context / Problem: Shared URLs should display the correct title, description, and image on social platforms.
Solution / Approach: Generate Open Graph metadata from the same page configuration used for SEO metadata.
Reference:
- Open Graph Protocol
- Next.js Metadata
Q: How should breadcrumbs be implemented?#
Context / Problem: Users and search engines need to understand the hierarchy of pages.
Solution / Approach: Create a reusable breadcrumb component driven by route/page configuration and add appropriate structured data where applicable.
Reference:
- Schema.org BreadcrumbList
- Google Search Central
Q: How should robots.txt be handled?#
Context / Problem: Search engines need instructions about which parts of the site can be crawled.
Solution / Approach:
Generate and maintain robots.txt through Next.js configuration/routing rather than manually duplicating environment-specific values.
Reference:
- Google Search Central
- Next.js
Q: How should XML sitemaps be handled?#
Context / Problem: Search engines need to discover important URLs efficiently.
Solution / Approach: Generate the XML sitemap dynamically from available routes and content.
Reference:
- Google Search Central
- Next.js sitemap
Q: How should structured data be implemented?#
Context / Problem: Search engines need machine-readable information about content such as articles, products, organizations, breadcrumbs, and FAQs.
Solution / Approach: Generate Schema.org JSON-LD based on the page/content type.
Reference:
- Schema.org
- Google Search Central
Q: How should SEO be handled when creating a new page?#
Context / Problem: SEO tasks are often forgotten when focusing primarily on UI development.
Solution / Approach:
Page → Title → Description → Canonical → Open Graph → Breadcrumb → Structured Data → Sitemap
Reference:
- Google Search Central
- Next.js Metadata
7. LLM / AI DISCOVERABILITY
Q: How should websites provide useful information to AI/LLM systems?#
Context / Problem: AI systems increasingly consume websites as information sources, but traditional SEO alone may not cover every emerging AI discovery mechanism.
Solution / Approach: Maintain clear semantic HTML, structured data, high-quality content, descriptive metadata, crawlable pages, and appropriate machine-readable site information.
Reference:
- Schema.org
- Google Search Central
- Relevant emerging AI/web standards
8. RESPONSIVE DESIGN
Q: How should responsive behavior be designed?#
Context / Problem: Simply shrinking desktop layouts does not produce good mobile experiences.
Solution / Approach: Design mobile-first layouts, then progressively enhance them for tablet and desktop using reusable responsive components.
Reference:
- Tailwind CSS
- CSS Grid
- CSS Flexbox
Q: How should layout widths be controlled?#
Context / Problem: Unlimited content width creates poor readability while overly fixed widths break responsive layouts.
Solution / Approach:
Use responsive containers with configurable max-width, padding, and width behavior.
Reference:
- Internal Container component
- CSS layout standards
9. COMPONENT REUSABILITY
Q: When should something become a reusable component?#
Context / Problem: Creating a component for every small piece can add unnecessary complexity, while duplicating UI creates maintenance problems.
Solution / Approach: Extract components when they represent a repeated UI pattern, meaningful layout primitive, reusable behavior, or project-wide standard.
Reference:
- Internal component guidelines
Q: How should reusable components be designed?#
Context / Problem: Components become difficult to reuse when they contain hardcoded content or project-specific assumptions.
Solution / Approach: Keep components composable, prop-driven, accessible, responsive, and independent of page-specific content.
Reference:
- React component design
- Internal component guidelines
10. REFERENCE / RESEARCH PROCESS
Q: What should I do when I have a reference?#
Context / Problem: A reference such as Figma, an existing website, documentation, or an existing project provides a known implementation target.
Solution / Approach: Analyze the reference → identify patterns → extract reusable components → implement → validate against the reference.
Reference:
- Provided design/reference
- Official documentation
Q: What should I do when I don't have a reference?#
Context / Problem: Not every requirement has an existing design, example, or implementation to copy.
Solution / Approach: Check official documentation → check web standards → research established UI patterns → compare alternatives → choose and document the best approach.
Reference:
- Official documentation
- Web standards
- Established UI/UX patterns
Q: What if multiple approaches are valid?#
Context / Problem: There is often no single "correct" implementation.
Solution / Approach: Choose the approach with the best maintainability, reusability, accessibility, performance, simplicity, and project fit, then document the decision.
Reference:
- Official documentation
- Internal architecture decision
Q: What should be done when no suitable reference exists?#
Context / Problem: Searching indefinitely for an exact reference wastes development time.
Solution / Approach: Create an internal implementation pattern, document why it was chosen, and mark it for future review.
Reference:
Internal Pattern / Architecture Decision
11. GENERAL IMPLEMENTATION FLOW
Q: What is the standard approach for implementing a new feature?#
Context / Problem: Starting implementation immediately can lead to duplicated work and inconsistent architecture.
Solution / Approach:
Requirement
↓
Find Reference
↓
Analyze / Research
↓
Choose Approach
↓
Check Existing Components
↓
Create or Reuse Component
↓
Implement
↓
Responsive Check
↓
Accessibility Check
↓
SEO Check
↓
Performance Check
↓
Document / Reuse
12. QUICK PROJECT CHECKLIST
HTML / UI#
- Semantic HTML
- Responsive layout
- Tailwind CSS
- shadcn/ui
- Theme variables
- Reusable components
- Reusable layout primitives
Pages#
- Config-driven page where appropriate
- Reusable sections
- Content separated from presentation
- Easy page creation/editing
Forms#
- React Hook Form
- Reusable form components
- Schema validation
- Error handling
- CAPTCHA where required
Images#
-
next/image - Correct dimensions
- AVIF/WebP where appropriate
- Compression
- Responsive sizing
- Alt text
SEO#
- Title
- Description
- Canonical URL
- Open Graph
- Breadcrumb
- Structured data
-
robots.txt - XML sitemap
- LLM/AI discoverability considerations
Final#
- Mobile tested
- Tablet tested
- Desktop tested
- Accessibility checked
- Performance checked
- Reference documented
- Reusable pattern identified
| Area | Context / Problem | Solution / Approach | Reference |
|---|---|---|---|
| HTML | Need a consistent design system across projects | Use Tailwind CSS + shadcn/ui + tweakcn themes + CSS variables | shadcn/ui, tweakcn, Tailwind CSS |
| HTML | Pages should use proper HTML structure | Use semantic HTML5 elements such as header, nav, main, section, article, footer | MDN, HTML Living Standard |
| HTML | Need pages that work on all screen sizes | Use responsive Tailwind CSS utilities with mobile-first layouts | Tailwind CSS |
| HTML | Creating similar pages repeatedly is time-consuming | Use config/data-driven page definitions with reusable sections/components | Internal pattern |
| HTML | Need reusable project starting points | Maintain a create-next-template starter with predefined architecture, UI, SEO and utilities | Internal template |
| FORM | Multiple forms need consistent validation and behavior | Use React Hook Form + reusable GlobalInputForm + schema-based validation | React Hook Form, Zod |
| FORM | Forms need bot/spam protection | Integrate Google reCAPTCHA through a reusable form/CAPTCHA component | Google reCAPTCHA |
| IMAGE | Large images hurt page performance | Use Next.js Image with AVIF/WebP optimization | Next.js Image |
| IMAGE | Uploaded images may be unnecessarily large | Compress images before use with TinyPNG or equivalent optimization | TinyPNG |
| SEO | Each page needs consistent search-engine metadata | Create centralized/config-driven metadata using Next.js Metadata API / next-seo where appropriate | Next.js SEO docs |
| SEO | Users/search engines need page hierarchy | Generate reusable breadcrumbs from route/page configuration | Schema.org, breadcrumb patterns |
| SEO | Duplicate URLs can cause SEO problems | Generate canonical URLs centrally from page configuration | Google Search Central |
| SEO | Social platforms need proper previews | Generate Open Graph and Twitter metadata from page configuration | Open Graph |
| SEO | Search engines need crawling instructions | Generate and maintain robots.txt from project configuration | Google Search Central |
| SEO | Search engines need discoverable pages | Generate XML sitemap dynamically from available routes/content | Google Search Central |
| SEO | Search engines need to understand page content | Add Schema.org structured data based on page/content type | Schema.org, Google Search Central |
| SEO | AI/LLM systems need useful site information | Provide machine-readable site/content information and appropriate AI/LLM discovery files where applicable | Emerging web/LLM standards |