@vivekcsein-logo
  • Home
  • About
  • Development

    • Web Development
    • Performance & Optimization
    • Backend & APIs
    • Authentication & Security

    Specialized

    • SEO & Ad Monetization
    • AR Experiences
    • Animation
    • Figma to Code
  • Articles
  • Projects
  • Marketplace
  • Contact
@vivekcsein-logo

A portfolio full stack developer with a passion for building scalable and high-performance web applications.

Explore

  • Home
  • About

Services

  • Web Development
  • Backend & APIs
  • Performance Optimization
  • Security & Authentication

Connect

  • Contact
  • Privacy
  • Terms
  • Home
  • About
  • Web Development
  • Backend & APIs
  • Performance Optimization
  • Security & Authentication
  • Contact
  • Privacy
  • Terms

© @vivekcsein. All rights reserved.

  • Home
  • All Articles47
  • Featured
  • Recently Added
  • Most Read
  • Bookmarks
Topics
  • Interview3
  • 3d4
  • Ai Prompts2
  • Business3
  • Deployment1
  • Dev2
  • Frontend5
    • JavaScript & React Errors Handbook
    • Folder Structure Guide
    • Modern Frontend Development Standards & Implementation Guide
    • React Hooks — The Complete Beginner's Guide (2026 Edition)
    • Reusable UI Layout Components
  • Getting Started2
  • Security2
  • Seo2
  • Workflow10
  • Backend1
  • Deployment1
  • Security1
  • Javascript1
  • Client Advisory5
  • Engineering2
Collections
  • Docs
  • Tutorials
  • Resources
  • Articles
“A better developer every single day.”
— Vivek
  1. Docs
  2. Frontend
  3. Modern Frontend Development Standards & Implementation Guide
Frontend

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.

Updated Sep 12, 202612 min read
On this page

On this page

  • Q: How should we maintain a consistent design across the project?
  • Q: How should we make the application themeable?
  • Q: How should HTML be structured?
  • Q: How should pages work on different screen sizes?
  • Q: How should reusable layouts be created?
  • Q: How should static pages be created?
  • Q: How should I add a new page quickly?
  • Q: How should existing pages be edited?
  • Q: How should reusable page sections be handled?
  • Q: How should a new Next.js project be started?
  • Q: What should the project template contain?
  • Q: How should forms be implemented?
  • Q: How should form validation be handled?
  • Q: How should multiple forms share common behavior?
  • Q: How should CAPTCHA be integrated?
  • Q: How should images be displayed in Next.js?
  • Q: Which image formats should we use?
  • Q: How should uploaded images be compressed?
  • Q: What should be checked before adding an image?
  • Q: How should page metadata be managed?
  • Q: How should canonical URLs be handled?
  • Q: How should Open Graph metadata be handled?
  • Q: How should breadcrumbs be implemented?
  • Q: How should robots.txt be handled?
  • Q: How should XML sitemaps be handled?
  • Q: How should structured data be implemented?
  • Q: How should SEO be handled when creating a new page?
  • Q: How should websites provide useful information to AI/LLM systems?
  • Q: How should responsive behavior be designed?
  • Q: How should layout widths be controlled?
  • Q: When should something become a reusable component?
  • Q: How should reusable components be designed?
  • Q: What should I do when I have a reference?
  • Q: What should I do when I don't have a reference?
  • Q: What if multiple approaches are valid?
  • Q: What should be done when no suitable reference exists?
  • Q: What is the standard approach for implementing a new feature?
  • HTML / UI
  • Pages
  • Forms
  • Images
  • SEO
  • Final

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:

text
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:

  • Next.js Image`

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:

text
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:

text
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
AreaContext / ProblemSolution / ApproachReference
HTMLNeed a consistent design system across projectsUse Tailwind CSS + shadcn/ui + tweakcn themes + CSS variablesshadcn/ui, tweakcn, Tailwind CSS
HTMLPages should use proper HTML structureUse semantic HTML5 elements such as header, nav, main, section, article, footerMDN, HTML Living Standard
HTMLNeed pages that work on all screen sizesUse responsive Tailwind CSS utilities with mobile-first layoutsTailwind CSS
HTMLCreating similar pages repeatedly is time-consumingUse config/data-driven page definitions with reusable sections/componentsInternal pattern
HTMLNeed reusable project starting pointsMaintain a create-next-template starter with predefined architecture, UI, SEO and utilitiesInternal template
FORMMultiple forms need consistent validation and behaviorUse React Hook Form + reusable GlobalInputForm + schema-based validationReact Hook Form, Zod
FORMForms need bot/spam protectionIntegrate Google reCAPTCHA through a reusable form/CAPTCHA componentGoogle reCAPTCHA
IMAGELarge images hurt page performanceUse Next.js Image with AVIF/WebP optimizationNext.js Image
IMAGEUploaded images may be unnecessarily largeCompress images before use with TinyPNG or equivalent optimizationTinyPNG
SEOEach page needs consistent search-engine metadataCreate centralized/config-driven metadata using Next.js Metadata API / next-seo where appropriateNext.js SEO docs
SEOUsers/search engines need page hierarchyGenerate reusable breadcrumbs from route/page configurationSchema.org, breadcrumb patterns
SEODuplicate URLs can cause SEO problemsGenerate canonical URLs centrally from page configurationGoogle Search Central
SEOSocial platforms need proper previewsGenerate Open Graph and Twitter metadata from page configurationOpen Graph
SEOSearch engines need crawling instructionsGenerate and maintain robots.txt from project configurationGoogle Search Central
SEOSearch engines need discoverable pagesGenerate XML sitemap dynamically from available routes/contentGoogle Search Central
SEOSearch engines need to understand page contentAdd Schema.org structured data based on page/content typeSchema.org, Google Search Central
SEOAI/LLM systems need useful site informationProvide machine-readable site/content information and appropriate AI/LLM discovery files where applicableEmerging web/LLM standards
PreviousFolder Structure GuideNext React Hooks — The Complete Beginner's Guide (2026 Edition)

Keep reading

  • Frontend

    Reusable UI Layout Components

    Composable layout primitives for React and Next.js: why to build layouts from reusable components, and how they improve spacing, responsiveness and readability.

    15 min read·Sep 12, 2026
  • Frontend

    Folder Structure Guide

    The mandatory folder layout for backend (Hono and Bun) and frontend projects, with no deviations allowed without a documented reason in the README.

    4 min read·Sep 12, 2026
  • Frontend

    JavaScript & React Errors Handbook

    Why common JavaScript and React errors happen and how to fix them: undefined properties, non-functions, const reassignment, re-renders, hooks rules, try/catch and more.

    9 min read·Sep 12, 2026

On this page

  • Q: How should we maintain a consistent design across the project?
  • Q: How should we make the application themeable?
  • Q: How should HTML be structured?
  • Q: How should pages work on different screen sizes?
  • Q: How should reusable layouts be created?
  • Q: How should static pages be created?
  • Q: How should I add a new page quickly?
  • Q: How should existing pages be edited?
  • Q: How should reusable page sections be handled?
  • Q: How should a new Next.js project be started?
  • Q: What should the project template contain?
  • Q: How should forms be implemented?
  • Q: How should form validation be handled?
  • Q: How should multiple forms share common behavior?
  • Q: How should CAPTCHA be integrated?
  • Q: How should images be displayed in Next.js?
  • Q: Which image formats should we use?
  • Q: How should uploaded images be compressed?
  • Q: What should be checked before adding an image?
  • Q: How should page metadata be managed?
  • Q: How should canonical URLs be handled?
  • Q: How should Open Graph metadata be handled?
  • Q: How should breadcrumbs be implemented?
  • Q: How should robots.txt be handled?
  • Q: How should XML sitemaps be handled?
  • Q: How should structured data be implemented?
  • Q: How should SEO be handled when creating a new page?
  • Q: How should websites provide useful information to AI/LLM systems?
  • Q: How should responsive behavior be designed?
  • Q: How should layout widths be controlled?
  • Q: When should something become a reusable component?
  • Q: How should reusable components be designed?
  • Q: What should I do when I have a reference?
  • Q: What should I do when I don't have a reference?
  • Q: What if multiple approaches are valid?
  • Q: What should be done when no suitable reference exists?
  • Q: What is the standard approach for implementing a new feature?
  • HTML / UI
  • Pages
  • Forms
  • Images
  • SEO
  • Final