This directory contains the visual presentation layer of the Cognito e-commerce platform. It separates the look & feel (HTML + CSS) from the business logic (state, handlers, API calls).
Below are the reference designs that showcase how the platform should look and feel:
The platform is mobile-first with full responsive support. Mobile designs are available in template/assets/Mobile/.
The design system defines the visual language including colors, typography, spacing, and components used throughout the platform.
📖 Complete Documentation: See styles/design-system.md for comprehensive design system documentation including:
- Full color palette (Primary, Secondary, Accent, Gray scale, Semantic colors)
- Typography system (headings, body text, font weights)
- Spacing and layout tokens
- Component styles (buttons, inputs, cards, alerts)
- SCSS mixins and utilities
- Responsive breakpoints
- Usage examples
The template system allows you to completely customize the appearance of the Cognito platform without touching any business logic. Simply replace the contents of this template/ directory with your own design.
template/
├── components/ # Presentational components (HTML structure)
│ └── LoginForm/
│ ├── LoginFormTemplate.tsx # React component (JSX + props)
│ └── LoginFormTemplate.module.scss # Component-specific styles
├── styles/ # Global styles and design tokens
│ ├── globals.scss # Global CSS reset and base styles
│ ├── variables.scss # Design tokens (colors, spacing, fonts, etc.)
│ ├── mixins.scss # Reusable SCSS mixins and utilities
│ └── design-system.md # Complete design system documentation
├── assets/ # Design references and mockups
│ ├── Desktop/ # Desktop design mockups
│ ├── Mobile/ # Mobile design mockups
│ └── design_system.png # Visual design system reference
└── README.md # This file
Business Logic (components/, app/, services/):
- Component state (useState, useReducer)
- Side effects (useEffect, API calls)
- Event handlers
- Data fetching and mutations
- Routing and navigation
Presentation (template/):
- HTML structure (JSX)
- CSS styles (SCSS modules)
- Visual design
- Layout and spacing
- Colors and typography
Logic Component (components/login/loginForm/LoginForm.tsx):
export const LoginForm = () => {
const [email, setEmail] = useState('');
const [password, setPassword] = useState('');
const handleSubmit = async (e) => {
// Business logic here
};
return (
<LoginFormTemplate
email={email}
password={password}
onEmailChange={setEmail}
onPasswordChange={setPassword}
onSubmit={handleSubmit}
// ... other props
/>
);
};Template Component (template/components/LoginForm/LoginFormTemplate.tsx):
export const LoginFormTemplate = ({
email,
password,
onEmailChange,
onPasswordChange,
onSubmit,
}) => {
return (
<form onSubmit={onSubmit}>
<input
type="email"
value={email}
onChange={(e) => onEmailChange(e.target.value)}
/>
{/* Pure presentation - no business logic */}
</form>
);
};cp -r template/ template-original/Edit template/styles/variables.scss to change colors, fonts, spacing:
// Brand Colors
$primary-color: #YOUR_BRAND_COLOR;
$secondary-color: #YOUR_SECONDARY_COLOR;
// Typography
$font-family-base: 'Your Font', sans-serif;Modify the HTML structure in template/components/*/ files:
Important: Keep the same:
- File names and export names
- Component props interfaces (TypeScript types)
- Event handler signatures
You can change:
- HTML structure and elements
- CSS classes and styling
- Visual layout and design
Edit the corresponding .module.scss files to style your components.
All design tokens (colors, typography, spacing, shadows, etc.) are centralized in template/styles/variables.scss.
📖 Complete Reference: See styles/design-system.md for full documentation.
Reusable SCSS mixins for common patterns are available in template/styles/mixins.scss including:
- Layout utilities (flexbox, container)
- Typography styles (headings, body text, links)
- Component styles (buttons, inputs, cards, alerts)
- Responsive breakpoints
- Text utilities (truncate, focus states)
📖 Complete Reference: See styles/design-system.md for full mixin documentation and usage examples.
Each template component exports a TypeScript interface that defines its props. You must maintain these interfaces when customizing:
export interface LoginFormTemplateProps {
title: string;
subtitle: string;
email: string;
password: string;
onEmailChange: (value: string) => void;
onSubmit: (e: React.FormEvent) => void;
// ... etc
}If you change the interface, you'll need to update the corresponding logic component.
- Keep template components pure (no state, no side effects)
- Use design tokens from
variables.scss - Maintain TypeScript interfaces
- Add visual enhancements (animations, transitions)
- Reorganize HTML structure as needed
- Use SCSS modules for component styles
- Add business logic to template components
- Make API calls from templates
- Use React hooks (useState, useEffect, etc.) in templates
- Change prop interfaces without updating logic components
- Import from
components/,services/, orapp/directories
After making changes:
- Visual testing: Check all pages in the browser
- Responsive testing: Test on mobile, tablet, and desktop
- Functionality testing: Ensure all interactions still work
- TypeScript: Run
npm run buildto check for type errors
If you create a custom template you'd like to share:
- Remove any business logic (should only be presentation)
- Document any special requirements
- Package the
template/directory - Share with the community!
For questions or issues related to the template system, please refer to the main project documentation or open an issue on GitHub.



