1.1.0 • Published 4 months ago

expo-template-elink v1.1.0

Weekly downloads
-
License
MIT
Repository
-
Last release
4 months ago

eLink App Template

🌟 Overview

An internal mobile application template by eLink Design, built using cutting-edge mobile development technologies. This template provides a robust starting point for React Native developers within our organization.

šŸš€ Tech Stack

  • Framework: Expo
  • Styling: NativeWind (Tailwind CSS for React Native)
  • Language: TypeScript
  • State Management: React Context API
  • Navigation: Expo Routing

šŸ“‚ Project Structure

src/
ā”œā”€ā”€ app/
│   ā”œā”€ā”€ components/           # Reusable UI components
│   │   ā”œā”€ā”€ atoms/            # Smallest, most basic components
│   │   ā”œā”€ā”€ molecules/        # Slightly more complex components
│   │   ā”œā”€ā”€ organisms/        # Complex, composed components
│   │   └── primitives/       # Special-purpose components
│   ā”œā”€ā”€ contexts/             # Global state management
│   ā”œā”€ā”€ hooks/                # Custom React hooks
│   ā”œā”€ā”€ screens/              # Full-page screen components
│   └── types/                # TypeScript type definitions
ā”œā”€ā”€ types/                    # Additional type definitions
└── global.css                # Global styling

šŸ”‘ Key Features

  • Modular component architecture
  • Responsive design with NativeWind
  • Context-based state management
  • Accessibility-focused
  • Platform-agnostic components

šŸ›  Development Conventions

  • PascalCase for components
  • camelCase for variables and functions
  • Strict TypeScript typing
  • Comprehensive error handling
  • Performance-optimized rendering

🌐 Context Annotations

Our project uses inline comment-based context annotations to provide clear, standardized documentation for context providers.

Annotation Format

Context annotations follow this pattern:

// @context: propertyName - type - description

Why Context Annotations?

  1. Self-Documenting Code: Inline comments provide immediate context
  2. Easy Documentation: Annotations can be parsed for automatic documentation
  3. Developer Experience: Quickly understand context properties

Real-World Examples

Network Context

// @context: isConnected - boolean - true if the device is connected to the internet, false otherwise
// @context: connectionType - string - the type of connection the device is using (wifi, cellular, etc.)
// @context: networkDetails - NetInfoState - the details of the network connection
const NetworkContext = createContext<NetworkContextType>({
  isConnected: true,
  connectionType: null,
  networkDetails: null
});

Theme Context

// @context: isDarkMode - boolean - true if the device is in dark mode, false otherwise
// @context: toggleTheme - function - toggles the theme between dark and light
const ThemeContext = createContext<ThemeContextType>({
  isDarkMode: false,
  toggleTheme: () => {}
});

Generating Context Metadata

Context metadata is automatically generated using a custom script:

# Manually generate context metadata
node scripts/generate-context-metadata.js

# Or simply start the app (script runs automatically)
npm start

šŸ Getting Started

# Install dependencies
npm install

# Start the development server
npm start

# Run on iOS simulator
npm run ios

# Run on Android emulator
npm run android

šŸ“¦ Available Scripts

  • npm start: Start the Expo development server (generates context metadata)
  • npm run ios: Run on iOS simulator
  • npm run android: Run on Android emulator

šŸ“ Contributing

This is an internal project for eLink Design. Contributions are welcome from team members only.

šŸ“ License

This project is proprietary and confidential. All rights reserved by eLink Design.