Skip to content

A web application for showcasing company logos and information with multilingual support (English/Chinese) built using vanilla JavaScript and Vite.

License

Notifications You must be signed in to change notification settings

danielviki/ShowCompanyLogo

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

39 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

🌏 Show Company Logo

A modern, bilingual company directory React application that seamlessly displays company information in English and Chinese. Built with React 18, Vite, and WordPress REST API.

React Vite i18next TypeScript

✨ Key Features

  • 🌐 Seamless English/Chinese language switching
  • πŸ–ΌοΈ Smart image lazy loading for optimal performance
  • πŸ’« Smooth animations and transitions
  • 🎯 SEO-friendly URL structure
  • πŸ“± Fully responsive design
  • ⚑ Lightning-fast loading with Vite
  • πŸ”„ Real-time language switching
  • 🎨 Clean, modern UI

πŸš€ Quick Start

Prerequisites

  • Node.js >= 14
  • WordPress backend with REST API
  • npm or yarn

Installation

# Clone the repository
git clone https://github.com/yourusername/ShowCompanyLogo.git

# Navigate to project
cd ShowCompanyLogo

# Install dependencies
npm install

# Start development server
npm run dev

πŸ› οΈ Technologies

  • Frontend:

    • React 18
    • TypeScript
    • i18next
    • Intersection Observer API
    • CSS Grid & Flexbox
  • Build Tools:

    • Vite
    • ESLint
    • Prettier
  • Backend Integration:

    • WordPress REST API
    • Custom Post Types

πŸ“– Documentation

Project Structure

ShowCompanyLogo/
β”œβ”€β”€ public/
β”‚   └── locales/                # Translation files
β”‚       β”œβ”€β”€ en/
β”‚       └── zh/
β”‚
β”œβ”€β”€ src/
β”‚   β”œβ”€β”€ components/             # React components
β”‚   β”‚   β”œβ”€β”€ CompanyCard/        # Company card component
β”‚   β”‚   β”œβ”€β”€ CompanyList/        # Company list container
β”‚   β”‚   └── LanguageSwitcher/   # Language switching component
β”‚   β”‚
β”‚   β”œβ”€β”€ services/               # Business logic and API services
β”‚   β”‚   β”œβ”€β”€ auth.ts             # Authentication and API calls
β”‚   β”‚   └── imageLoader.ts      # Image lazy loading utility
β”‚   β”‚
β”‚   β”œβ”€β”€ assets/                 # Static assets
β”‚   β”‚   β”œβ”€β”€ fonts/         
β”‚   β”‚   └── main.css            # Global styles   
β”‚   β”œβ”€β”€ App.jsx                 # Root component
β”‚   └── main.jsx                # Application entry point
β”‚
β”œβ”€β”€ vite.config.js              # Vite configuration
└── package.json                # Project metadata

Key Components

🎯 CompanyCard

Core component for displaying company information:

  • Props: company: Company
  • Features:
    • Lazy loaded company logo
    • Bilingual content display
    • Contact information
    • Responsive layout

πŸ“‹ CompanyList

Container component managing company data:

  • Features:
    • Data fetching and caching
    • Language-based filtering
    • Error handling
    • Loading states

🌐 LanguageSwitcher

Handles language switching functionality:

  • Features:
    • URL-based language routing
    • Language persistence
    • Smooth transitions
    • SEO-friendly links

⚑ ImageLoader

Utility service for optimized image loading:

  • Features:
    • Intersection Observer implementation
    • Progressive loading
    • Error handling
    • Memory management

Service Layer

πŸ” AuthService

Manages API communication:

interface AuthService {
  fetchCompanies(): Promise<Company[]>;
  fetchMediaWithAuth(mediaId: string): Promise<string>;
}

πŸ–ΌοΈ ImageLoaderService

Handles image optimization:

interface ImageLoaderService {
  init(): void;
  observe(element: HTMLImageElement): void;
  cleanup(): void;
}

🌐 Language Support

Currently supports:

  • English (en)
  • Chinese (zh)

Add new languages by creating translation files in public/locales/{lang}/common.json

🀝 Contributing

We welcome contributions! Please see our Contributing Guide for details.

  1. Fork the repository
  2. Create your feature branch
  3. Commit your changes
  4. Push to the branch
  5. Submit a pull request

πŸ“œ License

This project is licensed under the MIT License - see the LICENSE file for details.

MIT Β© [2024] [Daniel Viki]

πŸ™ Acknowledgments

πŸ“ž Contact & Support


Made with ❀️ by Daniel Viki

About

A web application for showcasing company logos and information with multilingual support (English/Chinese) built using vanilla JavaScript and Vite.

Resources

License

Contributing

Security policy

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 2

  •  
  •