This is a client-side of the FraiOS Semantic Layer project!
Before using the client-side of the project, ensure that you have the following components installed:
- NodeJS: Version 20.8.1 or higher.
- FraiOS Backend: Ensure the FraiOS backend is properly set up and running.
To install the client-side of the project, follow these steps:
# Clone the FraiOS Semantic Layer Client repository
git clone https://github.com/smartdataHQ/client-v2
# Navigate to the project directory
cd client-v2
# Install required packages using Yarn
yarn
# Start the client-side application
yarn startAfter completing these steps, open your web browser and go to to access the FraiOS Semantic Layer client.
For detailed guidance on utilizing the FraiOS Semantic Layer client and exploring its features, please consult the FraiOS Documentation.
Explore the interactive UI components and functionalities of the FraiOS Semantic Layer client using Storybook. Storybook provides a convenient environment to showcase and test UI components in isolation.
To launch Storybook, use the following command:
yarn storybookOnce the command is executed, navigate to
Maintain code consistency and quality in the FraiOS Semantic Layer client by implementing linting. Follow these steps to configure linting in Visual Studio Code (VS Code):
- Install ESLint and Prettier VS Code extensions.
- Open your VS Code settings (settings.json) and add the following configuration:
{
"eslint.enable": true,
"eslint.format.enable": true,
"editor.formatOnSave": true
}This configures VS Code to run ESLint and Prettier on file save.
We adhere to the Conventional Commits specification to ensure consistent and meaningful commit messages. The structure of our commits follows the pattern:
<type>[optional scope]: <description>
[optional body]
[optional footer(s)]
For a detailed understanding of Conventional Commits, refer to the Conventional Commits specification.
In the FraiOS Semantic Layer project, components follow a consistent structure to enhance maintainability and organization. Each component typically consists of the following files:
-
index.tsx: The main file containing the component's implementation. This file includes the React component code.
-
index.module.less: A Less file containing the component's styles. Using module.less ensures that styles are scoped to the component and won't conflict with styles from other components.
-
index.stories.tsx: A file dedicated to Storybook stories for the component. Storybook stories help in visually testing and documenting the component's variations and use cases.
-
index.test.tsx: The file containing unit tests for the component using testing framework vitest. Writing tests ensures the reliability and correctness of the component's functionality.
Here's an example directory structure for a component named ExampleComponent:
/src
/components
/ExampleComponent
index.tsx
index.module.less
index.stories.tsx
index.test.tsx
Ensure the reliability and correctness of the FraiOS Semantic Layer client by utilizing testing functionalities powered by Vitest. Vitest provides a robust testing framework to validate the behavior of your components and functionalities.
To run tests, use the following command:
yarn testExecuting this command will initiate the testing suite, allowing you to assess the client's performance and functionality. Any detected issues or failures will be highlighted, providing valuable insights for debugging and maintaining code quality.
Efficiently build and package the FraiOS Semantic Layer client with the following commands:
-
Build the Client:
yarn build
This command utilizes Vite to build the FraiOS Semantic Layer client.
-
Post-Build Tasks:
yarn postbuild
After the build, this command creates compressed archives (dist.tar.gz and dist.zip) of the generated distribution files.
-
Build Storybook:
yarn build-storybook
Use this command to build the Storybook for the client.
-
Serve the Built Client Locally:
yarn serve
This command previews the built client locally using Vite.
Incorporate these commands into your workflow to streamline the build process and prepare the FraiOS Semantic Layer client for deployment.