Skip to content

Commit

Permalink
Solara
Browse files Browse the repository at this point in the history
  • Loading branch information
IdeaS0ft committed Sep 20, 2024
1 parent ed20b1b commit 63c1513
Show file tree
Hide file tree
Showing 2 changed files with 62 additions and 5 deletions.
63 changes: 60 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,8 @@ command-line interactions, local interfaces, or online access.
# How Solara Works?

To enable Solara in your project, you must first initialize it at the root directory.
Open your terminal, ensure your current directory is set to the root of your project, and then run the following command:
Open your terminal, ensure your current directory is set to the root of your project, and then run the following
command:

```bash
solara init
Expand Down Expand Up @@ -230,9 +231,11 @@ See the diagram below

## How Does Solara Work with Brands?

In the previous [Solara Diagram](#solara-diagram), we explored how Solara transforms a single codebase into multiple apps, each tailored to specific brand configurations.
In the previous [Solara Diagram](#solara-diagram), we explored how Solara transforms a single codebase into multiple
apps, each tailored to specific brand configurations.

This transformation process is referred to as **Brand Switching** in the context of Solara. Below is a diagram illustrating this process:
This transformation process is referred to as **Brand Switching** in the context of Solara. Below is a diagram
illustrating this process:

#### Brand Switching Diagram

Expand Down Expand Up @@ -304,6 +307,60 @@ And here is the details:

---

### Brand Artifacts

Solara deploys resources and generated code into specific directories within the codebase, referred to as **Solara Artifacts**. The following diagram illustrates the deployment of artifacts across each platform:

### Solara Artifacts Diagram

```
+------------------------------------------------------------------------------------------------------------+
| Solara Artifacts |
+------------------------------------------------------------------------------------------------------------+
| | |
v v v
+--------------------+ +--------------------+ +---------------------+
| Android | | Flutter | | iOS |
+--------------------+ +--------------------+ +---------------------+
| | |
v v v
+---------------------------------------+ +---------------------------+ +--------------------------------+
| ./solara_artifacts | | ./lib/solara_artifacts | | SolaraArtifacts |
| ./app/src/main/solara_artifacts | | ./assets/solara_artifacts | | Assets.xcassets/SolaraArtifacts|
| ./app/src/main/java/solara_artifacts | | ./assets/solara_fonts | | |
| ./app/src/main/assets/solara_artifacts| | | | |
+---------------------------------------+ +---------------------------+ +--------------------------------+
```

1. **Android**
- **Paths**:
- `./solara_artifacts`: Contains the generated `brand.properties` file.
- `./app/src/main/solara_artifacts`:
- This path is where the brand's `res` directory is deployed.
- It is included as a `sourceSet` in the `app/build.gradle` to generate resources for Android.
- `./app/src/main/java/solara_artifacts`:
- This directory holds the `BrandConfig.kt` and `BrandTheme.kt` files.
- `./app/src/main/assets/solara_artifacts`:
- Contains assets that are directly utilized in the Android application.

2. **iOS**
- **Paths**:
- `SolaraArtifacts`:
- This directory includes `BrandConfig.kt`, `BrandTheme.kt`, `Brand.xcconfig`, and the `Fonts` folder.
- `Assets.xcassets/SolaraArtifacts`:
- A dedicated location for assets deployed by Solara.

3. **Flutter**
- **Paths**:
- `./lib/solara_artifacts`:
- Contains the `brand_config.dart` and `brand_theme.dart` files.
- `./assets/solara_artifacts`:
- A directory for various assets used in the Flutter application.
- `./assets/solara_fonts`:
- Specifically designated for font assets utilized in Flutter.

---

### Brand Configurations

Solara allows for flexible and customizable configurations for each brand, enabling tailored settings based on specific
Expand Down
4 changes: 2 additions & 2 deletions solara/lib/core/brands/brand_switcher.rb
Original file line number Diff line number Diff line change
Expand Up @@ -168,9 +168,9 @@ def directories_for_platform
class FlutterArtifactSwitcher
def directories
[
FilePath.flutter_project_fonts,
FilePath.flutter_assets_artifacts,
FilePath.flutter_lib_artifacts,
FilePath.flutter_assets_artifacts,
FilePath.flutter_project_fonts,
]
end
end
Expand Down

0 comments on commit 63c1513

Please sign in to comment.