Build & Development Process
Relevant source files
The following files were used as context for generating this wiki page:This document outlines the build and development process for the ai-saas-landing project. The project is a modern web application built using React and Vite, providing a fast development experience with Hot Module Replacement (HMR). The styling is managed by Tailwind CSS, and code quality is maintained using ESLint.
The setup is based on a minimal Vite template for React, designed for high performance during development and optimized builds for production. It leverages modern tooling like PostCSS for CSS processing and provides a clear structure for managing dependencies and scripts.
Sources: README.md, package.json
Core Technologies and Dependencies
The project relies on a set of core libraries and tools for its functionality and build process. These are categorized into production dependencies and development dependencies.
Sources: package.json:14-36
Production Dependencies
These packages are essential for the application to run in a production environment.
| Package | Version | Description |
|---|---|---|
react | ^19.2.0 | The core library for building the user interface. |
react-dom | ^19.2.0 | Provides DOM-specific methods for React. |
framer-motion | ^12.23.24 | A production-ready motion library for creating animations. |
lucide-react | ^0.554.0 | A library of simply designed, beautiful icons. |
cobe | ^0.6.5 | Used for creating the interactive globe visualization. |
Sources: package.json:14-20
Development Dependencies
These packages are used during the development and build phases, including the build tool, linter, and plugins.
| Package | Version | Description |
|---|---|---|
vite | ^7.2.4 | The core build tool and development server. |
@vitejs/plugin-react | ^5.1.1 | Vite plugin that enables React support using Babel for Fast Refresh. |
tailwindcss | ^3.4.17 | A utility-first CSS framework for styling. |
postcss | ^8.5.6 | A tool for transforming CSS with JavaScript plugins. |
autoprefixer | ^10.4.22 | A PostCSS plugin to parse CSS and add vendor prefixes. |
eslint | ^9.39.1 | A tool for identifying and reporting on patterns found in ECMAScript/JavaScript code. |
Sources: package.json:21-36
The following diagram illustrates the relationship between the main development tools.
This diagram shows how Vite orchestrates the build, using its React plugin for JSX and PostCSS (with Tailwind and Autoprefixer) for styling.
Sources: package.json:21-36, vite.config.js, tailwind.config.js
Scripts and Workflows
The package.json file defines several scripts to manage the development, build, and maintenance lifecycle of the application.
Sources: package.json:6-12
| Script | Command | Description |
|---|---|---|
dev | vite | Starts the Vite development server with HMR enabled. |
build | vite build | Creates a production-ready build of the application. |
lint | eslint . | Runs the ESLint linter across the entire project to check for code quality issues. |
preview | vite preview | Serves the production build locally to preview it before deployment. |
Sources: package.json:7-11
Development Workflow
The development process is initiated with the npm run dev command. This starts the Vite dev server, which serves the application from index.html and provides features like Hot Module Replacement (HMR) for a fast feedback loop.
This flow shows the typical development cycle where code changes are instantly reflected in the browser without a full page reload.
Sources: package.json:7, README.md:3-5
Production Build Workflow
To create an optimized build for deployment, the npm run build command is used. Vite bundles the React code, processes the CSS with Tailwind and PostCSS, and outputs static assets.
This diagram illustrates how the vite build command transforms the source code into optimized static files for production.
Sources: package.json:8, vite.config.js
Configuration
The build and development environment is configured through several key files.
Vite Configuration
The vite.config.js file configures the Vite build tool. It primarily uses the @vitejs/plugin-react to enable React support. This plugin handles JSX transformation and enables Fast Refresh during development.
// vite.config.js
import { defineConfig } from 'vite'
import react from '@vitejs/plugin-react'
// https://vitejs.dev/config/
export default defineConfig({
plugins: [react()],
})
The README.md notes that @vitejs/plugin-react-swc is an alternative for even faster refresh times using SWC instead of Babel.
Sources: vite.config.js, README.md:6-8
Styling Configuration
Styling is managed by Tailwind CSS. The configuration is located in tailwind.config.js. This file specifies which files Tailwind should scan for utility classes. It also extends the default theme with custom colors and fonts defined as CSS variables in src/index.css.
tailwind.config.js
// tailwind.config.js
/** @type {import('tailwindcss').Config} */
export default {
content: [
"./index.html",
"./src/**/*.{js,ts,jsx,tsx}",
],
theme: {
extend: {
colors: {
'bg-primary': 'var(--bg-primary)',
// ... other custom colors
},
fontFamily: {
sans: ['Inter', 'sans-serif'],
},
},
},
plugins: [],
}
Sources: tailwind.config.js
src/index.css
The src/index.css file imports Tailwind's base styles and defines custom CSS variables that are then referenced in tailwind.config.js.
/* src/index.css:5-18 */
:root {
/* Enterprise Color System - Dark Mode Default */
--bg-primary: #050505;
--bg-secondary: #0A0A0A;
--bg-tertiary: #111111;
--text-primary: #FFFFFF;
--text-secondary: #A1A1AA;
--text-tertiary: #71717A;
--accent-primary: #3B82F6;
--accent-glow: rgba(59, 130, 246, 0.5);
--border-subtle: rgba(255, 255, 255, 0.08);
--border-highlight: rgba(255, 255, 255, 0.15);
}
This setup allows for a consistent and themable design system.
Sources: src/index.css:5-18, tailwind.config.js:8-17
Application Entry Point
The application's entry point is index.html. This file is served by Vite and contains the root DOM element where the React application is mounted. It also includes a script tag that points to /src/main.jsx, which Vite handles to start the React application.
<!-- index.html -->
<!doctype html>
<html lang="en">
<head>
<!-- ... meta tags and font links ... -->
<title>OptiFlow AI</title>
</head>
<body>
<div id="root"></div>
<script type="module" src="/src/main.jsx"></script>
</body>
</html>
The <div id="root"></div> is the container for the React app, and the <script type="module" src="/src/main.jsx"></script> is the entry script that initializes React.
Sources: index.html
Summary
The project utilizes a streamlined and modern front-end development stack centered around Vite and React. The build process is fast and efficient, with clear separation of development and production configurations. Scripts in package.json provide simple commands for common tasks like running the dev server, building for production, and linting. Styling is robustly handled by Tailwind CSS, integrated into the Vite build pipeline via PostCSS. This setup ensures a productive developer experience and an optimized, performant final application.