Skip to content

Tryquetra/frontend-react-template

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

6 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

MUI Header & Footer Template

A professional React + TypeScript + Material UI template with a reusable header and footer, perfect for quickly starting new projects.

Features

  • ✨ Material UI v7 - Modern, professional UI components
  • 🎨 Dark/Light Mode - Built-in theme toggle with custom teal accent colors
  • 🌍 Internationalization (i18n) - Built-in EN/PT translations with easy-to-extend system
  • πŸ”„ Language Switcher - Seamless PT/EN toggle in header
  • πŸ“± Fully Responsive - Mobile-first design
  • 🎯 Glassmorphism Header - Fixed header with blur effect
  • βš™οΈ Easy Configuration - Centralized config file for quick customization
  • πŸš€ Vite - Lightning-fast development and build
  • 🎯 TypeScript - Full type safety for translations

Quick Start

Method 1: Using degit (Recommended)

npx degit SimpleSoftwareLTDA/frontend-react-template my-new-project && cd my-new-project && npm install && npm run dev

Method 2: GitHub Template Button

  1. Click "Use this template" on GitHub
  2. Create your new repository
  3. Clone and install:
git clone https://github.com/your-username/your-new-repo.git
cd your-new-repo
npm install
npm run dev

Customization

All customizable settings are centralized in src/config/siteConfig.ts:

export const siteConfig = {
  // Header Configuration
  header: {
    // Your GitHub profile URL
    githubUrl: 'https://github.com/yourusername',

    // Projects shown in dropdown (6-dots button)
    projects: [
      { name: 'Project Alpha', url: 'https://example.com/alpha' },
      { name: 'Project Beta', url: 'https://example.com/beta' },
      { name: 'Project Gamma', url: 'https://example.com/gamma' },
    ],
  },

  // Default Settings
  defaultLanguage: 'en' as 'en' | 'pt',
  defaultTheme: 'dark' as 'light' | 'dark',
};

To Customize Your Project:

  1. Update project info: Edit src/config/siteConfig.ts
  2. Add your projects: Update the projects array
  3. Set your GitHub URL: Change githubUrl
  4. Choose defaults: Set defaultLanguage and defaultTheme
  5. Customize footer: Edit src/locales/en.ts and src/locales/pt.ts (footer section)

Internationalization (i18n)

The template includes built-in support for English (EN) and Portuguese (PT) translations.

How It Works

All translations are stored in src/locales/:

  • en.ts - English translations
  • pt.ts - Portuguese translations

Using Translations in Your Components

import { useTranslation } from './contexts/LanguageContext';

function MyComponent() {
  const { t, translations, language } = useTranslation();

  return (
    <div>
      {/* Method 1: Direct access */}
      <h1>{translations.home.title}</h1>

      {/* Method 2: Using t() function with dot notation */}
      <p>{t('home.subtitle')}</p>

      {/* Method 3: With parameters */}
      <button>{t('header.toggleTheme', { mode: 'dark' })}</button>
    </div>
  );
}

Adding New Translations

  1. Edit translation files:
// src/locales/en.ts
export const en = {
  mySection: {
    greeting: 'Hello {{name}}!',
    button: 'Click me',
  },
};

// src/locales/pt.ts
export const pt: Translations = {
  mySection: {
    greeting: 'OlΓ‘ {{name}}!',
    button: 'Clique aqui',
  },
};
  1. Use in components:
const { t } = useTranslation();
return <h1>{t('mySection.greeting', { name: 'User' })}</h1>;

Language Switching

The language switcher in the header automatically updates all translated content across your app!

Project Structure

src/
β”œβ”€β”€ components/          # Reusable components
β”‚   β”œβ”€β”€ Header.tsx      # Fixed header with glassmorphism
β”‚   β”œβ”€β”€ Footer.tsx      # Centered footer
β”‚   └── index.ts        # Component exports
β”œβ”€β”€ contexts/           # React contexts
β”‚   β”œβ”€β”€ ThemeContext.tsx    # Theme provider (light/dark mode)
β”‚   └── LanguageContext.tsx # i18n provider
β”œβ”€β”€ config/             # Configuration
β”‚   └── siteConfig.ts   # ⭐ Main config file - Edit this!
β”œβ”€β”€ locales/            # Translation files
β”‚   β”œβ”€β”€ en.ts          # English translations
β”‚   β”œβ”€β”€ pt.ts          # Portuguese translations
β”‚   └── index.ts       # Exports
β”œβ”€β”€ App.tsx             # Main app component
β”œβ”€β”€ main.tsx            # App entry point
└── index.css           # Global styles

Theme Customization

The theme uses a professional teal color scheme. To customize colors, edit src/contexts/ThemeContext.tsx:

primary: {
  main: mode === 'light' ? '#0f766e' : '#34d399', // Change these!
}

Available Scripts

npm run dev      # Start development server
npm run build    # Build for production
npm run preview  # Preview production build
npm run lint     # Run ESLint

Tech Stack

  • React 19 - UI library
  • TypeScript - Type safety
  • Material UI v7 - Component library
  • Vite - Build tool
  • Emotion - CSS-in-JS styling

License

MIT License - Feel free to use this template for any project!

Credits

Template created by Brainon Queiroz

About

No description, website, or topics provided.

Resources

Code of conduct

Stars

0 stars

Watchers

0 watching

Forks

Releases

No releases published

Packages

 
 
 

Contributors