Pre-Development Frontend Setup


In this section, we will focus on the initial steps that a frontend developer must take before starting the development process. These preparatory steps ensure a smooth development workflow and help establish a solid foundation for your project.

Prerequisites

We will proceed with the following steps assuming that you have already:

  • Configured your project environment
  • Confirmed that everything runs smoothly when executing yarn workspace YOUR_WORKSPACE dev
  • Have access to the project mockups and design specifications

Preparation Steps

1. Examine the Mockup Thoroughly

Examine the mockup thoroughly: By doing so, you will gain a comprehensive understanding of the modules, widgets, and elements that need to be retained and identify those that should be removed from the code. This initial analysis will guide you in shaping the project's visual components.

Key activities:

  • Identify all UI components and their variations
  • Map components to existing Vactory widgets and modules
  • Note any custom components that need to be created
  • Document component relationships and dependencies

2. Eliminate Unnecessary Files

Eliminate unnecessary files: Thoroughly review and remove any redundant modules, widgets, and elements. Exercise caution to ensure that you do not delete necessary components or those that may be required in the future, as the mockup may undergo changes. Taking a prudent approach will maintain the project's integrity while streamlining its structure.

If you have deleted files that you may need later, simply retrieve them from the `apps/starter` folder.

Best practices:

  • Create a backup before deleting files
  • Document what was removed and why
  • Keep a list of potentially useful components for future reference

3. Establish Your Style Guide

Establish your style guide: Identify and export the essential elements that will define the project's visual aspects, including Colors (primary, secondary, tertiary, etc.), Typography, Spacing, Viewport configurations, Animations if available ... and more. Organize these elements systematically to ensure consistency and coherence throughout the project.

Style guide components:

  • Colors: Primary, secondary, accent, neutral palettes
  • Typography: Font families, sizes, weights, line heights
  • Spacing: Margin and padding scales
  • Breakpoints: Responsive design breakpoints
  • Shadows: Box shadow variations
  • Border Radius: Corner radius values
  • Animations: Transition and animation specifications
  • and others ...

4. Tailwind Configuration Setup

Tailwind.config Setup: With the essential elements derived from the mockup, proceed to configure your tailwind.config.js file. Define color variants, typography settings, and other necessary customizations to align with the project's design requirements.

Make sure to target the tailwind.config.js file within themes/default/tailwind.config.js since it's the default theme, and also other tailwind files within the themes/ folder since each theme has its own styling in case your project has multiple themes.

Learn more here: Customizing tailwind.config

5. Theme Essential Primitives

Theme Essential Primitives: Primitives such as Inputs, Buttons, Links, and others serve as fundamental building blocks within your project. By referring to the provided style guide in the mockup or closely examining the mockup itself, apply the appropriate theming to these elements. Ensure that they align with the visual specifications outlined in the style guide, allowing for consistent and cohesive design throughout your project.

Learn more by checking: Theming

Key primitives to configure:

  • Buttons (primary, secondary, outline, disabled variants ...)
  • Form inputs (text, select, checkbox, radio, textarea ...)
  • Links and navigation elements
  • Typography components (headings, paragraphs, lists ...)
  • Layout containers and grids

6. Develop Essential Widgets/Modules

Develop Essential Widgets/Modules: With all the required Elements prepared, begin by creating the necessary widgets. If the widgets are already available, focus on styling them appropriately. Ensure that you adhere to best practices and incorporate modern functionalities while developing the widgets. The same principles apply when working with modules, ensuring consistency and high-quality implementations throughout your project.

Development guidelines:

  • Follow component composition patterns
  • Implement responsive design principles
  • Ensure accessibility compliance
  • Write clean, maintainable code
  • Document component APIs and usage

7. Prioritize Performance

Prioritize Performance: Regularly assess bundle size, performance, accessibility, SEO, and best practices. Utilize Bundle Analyzer tools to generate reports and gain insights into any potential increases in bundle size. These measures allow you to make informed decisions and take appropriate actions to optimize performance and ensure a smooth user experience.

Performance checklist:

  • Monitor bundle size regularly
  • Optimize images and assets
  • Implement code splitting where appropriate
  • Test performance on various devices
  • Validate accessibility compliance
  • Check SEO optimization

Next Steps

After completing these preparation steps, you'll be ready to:

  1. Start implementing your design system
  2. Build out your component library
  3. Develop page templates and layouts
  4. Integrate with Drupal data sources

This systematic approach ensures a solid foundation for your frontend development process and helps maintain consistency throughout your project.