Skip to content

Commit ffe3628

Browse files
committed
docs(architecture): add guide on taking ownership of packages
- Create new markdown file for a step-by-step guide on cloning, hosting, and managing shared packages - Explain the importance of hosting packages privately for customization, privacy, and update management - Provide detailed instructions for transferring ownership of the 'core' package to a private GitHub repository - Include cautionary notes and explanations for each step in the process - Mention the next steps for customizing the UI theme after taking ownership
1 parent b4f7a16 commit ffe3628

File tree

1 file changed

+74
-0
lines changed

1 file changed

+74
-0
lines changed
Lines changed: 74 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,74 @@
1+
---
2+
title: Taking Ownership of Packages
3+
description: A step-by-step guide to cloning, hosting, and managing the shared packages for customization.
4+
---
5+
import { Steps, Aside } from '@astrojs/starlight/components';
6+
7+
To unlock the full power of the Flutter News App Toolkit and make it truly your own, you must take ownership of the shared packages. The applications (Mobile Client, Web Dashboard) are designed to be customized, but the deepest and most impactful changes—like altering data models or redesigning the UI theme—happen within the shared packages.
8+
9+
This guide will walk you through the essential, one-time process of moving a shared package from the original public repository into your own private repository.
10+
11+
<Aside type="caution" title="Critical Step">
12+
This is the most important guide for customizing the toolkit. You must follow this process for **any shared package** you intend to modify.
13+
</Aside>
14+
15+
### Why You Must Host the Packages Yourself
16+
17+
- **To Enable Customization:** You cannot push changes to the original public repositories. To modify a package, you need your own version that you control.
18+
- **For Privacy and Control:** Hosting the packages in your own private repositories ensures that your proprietary changes, business logic, and customizations remain confidential.
19+
- **To Manage Updates:** It gives you full control over when and how you pull in future updates from the original toolkit.
20+
21+
### The Workflow: A Step-by-Step Guide
22+
23+
Let's walk through the process using the `core` package as an example. You will repeat these steps for any other package you wish to customize, such as `ui_kit` or `data_repository`.
24+
25+
<Steps>
26+
1. **Clone the Original Package Repository**
27+
28+
First, clone the package's repository from the public GitHub organization to your local machine. Make sure you are **not** inside another Git repository when you do this.
29+
30+
```bash
31+
# Clone the 'core' package repository
32+
git clone https://github.com/flutter-news-app-full-source-code/core.git
33+
34+
# Navigate into the newly cloned directory
35+
cd core
36+
```
37+
38+
2. **Create a New Private Repository on GitHub**
39+
40+
Go to your GitHub account and create a new **private** repository.
41+
- Name it appropriately (e.g., `my-company-core-package`).
42+
- **Do not** initialize it with a README, .gitignore, or license file, as we will be pushing an existing repository.
43+
44+
3. **Update the Git Remote URL**
45+
46+
Back in your terminal, inside the `core` directory you cloned, you need to change the Git "remote" from the original public repository to your new private one.
47+
48+
First, view the existing remote:
49+
```bash
50+
git remote -v
51+
# origin https://github.com/flutter-news-app-full-source-code/core.git (fetch)
52+
# origin https://github.com/flutter-news-app-full-source-code/core.git (push)
53+
```
54+
55+
Now, change the URL to point to your new private repository:
56+
```bash
57+
git remote set-url origin https://github.com/YOUR_USERNAME/YOUR_NEW_PRIVATE_REPO_NAME.git
58+
```
59+
Replace `YOUR_USERNAME` and `YOUR_NEW_PRIVATE_REPO_NAME` with your actual GitHub details.
60+
61+
4. **Push the Code to Your Private Repository**
62+
63+
Finally, push the package code to your new private repository.
64+
65+
```bash
66+
git push -u origin --all
67+
git push -u origin --tags
68+
```
69+
70+
</Steps>
71+
72+
**Congratulations!** You have now successfully taken ownership of the `core` package. It is now hosted in your private repository, and you are free to make any modifications you need.
73+
74+
The next step is to tell your applications (Mobile Client, Web Dashboard) to use *your* version of the package instead of the original one. The next guide, [**Guide: Customizing the UI Theme**](/docs/architecture/03-guide-customizing-the-ui/), will walk you through this process in a practical, hands-on example.

0 commit comments

Comments
 (0)