How mstiglic/o2-interview-assignment works
Project Type and Purpose
• This is a component-based UI library that revolves around a core React component (O2Input.tsx), meant to be used within web applications.
• It includes unit tests to ensure component quality and a Storybook playground for interactive development and demonstration.
• The project uses Vite as its build tool and TypeScript for type safety.
a. Core Component:
• O2Input component (located in src/components/input/O2Input.tsx) is the central piece.
b. Styling and Assets:
c. Supporting Utilities and Constants:
d. Testing Framework:
• Unit tests directory (src/components/__tests__) that exercises the functionality of your UI component.
e. Storybook Integration:
f. Configuration and Build System:
• Role of configuration files such as package.json, vite.config.ts, tsconfig.json files. This area shows how the project is built, served, and bundled.
• Index.html and main.tsx which are entry points for the application.
Relationships and Data Flow
• How main.tsx imports the core component (O2Input.tsx) along with the styling assets.
• That the Storybook environment (using .storybook and src/stories) renders variants of the component for demonstration.
• Dependency flows: components depend on constants, helpers, utilities, and styling.
Important Architectural Patterns
• Component-based architecture: Emphasize how UI elements are self-contained.
• Separation of Concerns: Divide responsibilities between component code, styling, testing, and documentation (Storybook).
• Modular Organization: Each aspect of the component is organized in separate directories (components, assets, tests, stories), reinforcing clarity and reusability.