> DOCUMENTATION
React Installation Guide
Get your React template running with Vite, React Router, and Tailwind CSS.
> Prerequisites
Before you begin, ensure you have the following installed:
- Node.js 16.0+ — Download here
- npm (comes with Node.js) or yarn
- A code editor like VS Code (recommended)
- A modern web browser (Chrome, Firefox, Safari, or Edge)
To verify your installation:
node --version
npm --version> Installation Steps
Step 1: Download Your Template
After downloading your template, extract the .zip file to your projects folder:
# Navigate to your projects directory
cd ~/Projects
# Extract the template (replace with your actual filename)
unzip aurora_spectrum_ai-technology-aurora-react.zip
cd aurora_spectrum_ai-technology-auroraPackage Contents:
src/pages/— Page components (IndexPage.jsx, AboutPage.jsx, etc.)src/components/— Reusable UI components (Text, Button, Image, Link, etc.)src/data/— Content data file (content.js)src/styles/— Global CSS (globals.css)src/App.jsx— Main app with routingpublic/— Static assets and index.htmltailwind.config.js— Tailwind CSS settingspackage.json— Project dependencies
Step 2: Install Dependencies
Install all required packages using your preferred package manager:
Using npm (recommended):
npm installUsing yarn:
yarn installWhat gets installed:
- • React 18.x
- • React Router DOM
- • Vite (build tool)
- • Tailwind CSS
- • Lucide React (icons)
- • PostCSS & Autoprefixer
Installation time: 1-2 minutes
Step 3: Start the Development Server
Launch the Vite development server:
npm run devOr with yarn: yarn dev
Expected output:
VITE v5.0.0 ready in 300 ms ➜ Local: http://localhost:5173/ ➜ Network: http://192.168.1.x:5173/ ➜ press h + enter to show help
Features enabled:
- • Hot Module Replacement (HMR) — instant updates
- • Error overlay with source maps
- • Optimized dependency pre-bundling
- • Asset handling (images, fonts)
Step 4: View Your Site
Open your browser and navigate to:
Your React site is now running! Any changes you make will automatically appear in the browser.
> Building for Production
Create an optimized production build:
npm run buildThis process:
- 1. Bundles and minifies all JavaScript
- 2. Optimizes CSS with purging unused styles
- 3. Generates hashed filenames for caching
- 4. Creates the
dist/folder
Preview the production build locally:
npm run previewBuild output example:
vite v5.0.0 building for production... ✓ 42 modules transformed. dist/index.html 0.5 kB │ gzip: 0.3 kB dist/assets/index-a1b2c3d4.css 24.1 kB │ gzip: 5.2 kB dist/assets/index-e5f6g7h8.js 89.3 kB │ gzip: 28.7 kB ✓ built in 2.34s
> Deployment Options
Option 1: Vercel (Recommended)
Easiest deployment — takes 2 minutes:
- Push your code to GitHub/GitLab/Bitbucket
- Go to vercel.com
- Click "Import Project"
- Select your repository
- Click "Deploy" (Vercel auto-detects Vite)
Your site is live! Get a free .vercel.app domain + automatic deployments.
Option 2: Netlify
- Build locally:
npm run build - Go to netlify.com
- Drag and drop the
dist/folder
Or connect your Git repository for automatic deployments.
Option 3: GitHub Pages
1. Add base path to vite.config.js:
export default defineConfig({
base: '/your-repo-name/',
// ... rest of config
})2. Build and deploy:
npm run build
npx gh-pages -d distOption 4: Docker + Nginx
FROM node:18-alpine AS build
WORKDIR /app
COPY package*.json ./
RUN npm install
COPY . .
RUN npm run build
FROM nginx:alpine
COPY --from=build /app/dist /usr/share/nginx/html
EXPOSE 80
CMD ["nginx", "-g", "daemon off;"]> Customization Guide
Changing Colors & Branding
Edit tailwind.config.js:
module.exports = {
theme: {
extend: {
colors: {
primary: '#0891B2', // Your primary brand color
secondary: '#F97316', // Accent color
accent: '#8B5CF6', // Additional accent
},
fontFamily: {
sans: ['Inter', 'sans-serif'],
display: ['Poppins', 'sans-serif'],
},
},
},
}Adding Routes (React Router)
Routes are defined in src/App.jsx or src/main.jsx:
import { BrowserRouter, Routes, Route } from 'react-router-dom';
import Home from './pages/Home';
import About from './pages/About';
import Services from './pages/Services'; // New page
function App() {
return (
<BrowserRouter>
<Routes>
<Route path="/" element={<Home />} />
<Route path="/about" element={<About />} />
<Route path="/services" element={<Services />} /> {/* New route */}
</Routes>
</BrowserRouter>
);
}Creating New Components
Create components in src/components/:
// src/components/Button.jsx
export default function Button({ children, onClick, variant = 'primary' }) {
const styles = {
primary: 'bg-blue-600 hover:bg-blue-700 text-white',
secondary: 'bg-gray-200 hover:bg-gray-300 text-gray-800',
};
return (
<button
onClick={onClick}
className={`px-4 py-2 rounded-lg font-medium ${styles[variant]}`}
>
{children}
</button>
);
}Environment Variables
Create a .env file in the root:
VITE_API_URL=https://api.example.com
VITE_APP_TITLE=My React AppAccess in your code:
const apiUrl = import.meta.env.VITE_API_URL;
const title = import.meta.env.VITE_APP_TITLE;Note: Only variables prefixed with VITE_ are exposed to the browser.
> Troubleshooting
Error: Port 5173 is already in use
Option 1: Use a different port
npm run dev -- --port 3000Option 2: Kill the existing process
# macOS/Linux
lsof -ti:5173 | xargs kill -9
# Windows
netstat -ano | findstr :5173
taskkill /PID <PID> /FError: Cannot find module 'react'
# Remove and reinstall dependencies
rm -rf node_modules package-lock.json
npm installProblem: Production build shows blank page
- Check browser console for errors (F12)
- Verify
basepath in vite.config.js matches your deployment URL - For SPAs, configure your server to handle client-side routing
Problem: Components appear unstyled
- Verify tailwind.config.js content paths include your src files
- Check index.css has Tailwind directives
- Restart the development server
Problem: Refreshing a route returns 404
For Netlify, create a _redirects file in public/:
/* /index.html 200For Apache, create .htaccess:
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteRule ^index\.html$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.html [L]
</IfModule>> File Structure Reference
your-template/ ├── src/ │ ├── main.jsx # Entry point │ ├── App.jsx # Root component with routes │ ├── index.css # Global styles + Tailwind │ ├── components/ # Reusable components │ │ ├── Header.jsx │ │ ├── Footer.jsx │ │ └── Button.jsx │ └── pages/ # Page components │ ├── Home.jsx │ ├── About.jsx │ └── Contact.jsx ├── public/ # Static assets │ ├── images/ │ └── favicon.ico ├── vite.config.js # Vite configuration ├── tailwind.config.js # Tailwind CSS configuration ├── postcss.config.js # PostCSS configuration └── package.json # Dependencies & scripts
> Available Scripts
| Command | Description |
|---|---|
npm run dev | Start development server (port 5173) |
npm run build | Create optimized production build |
npm run preview | Preview production build locally |
npm run lint | Run ESLint to check code quality |
> Additional Resources
Estimated Setup Time: 3-5 minutes | Deployment Time: 2-5 minutes
Next Steps: Customize your content, deploy, and launch.