Skip to content

Commit

Permalink
Flesh out docs
Browse files Browse the repository at this point in the history
Replace more of the Starlight example project with real docs
  • Loading branch information
NigelBreslaw authored Dec 26, 2023
1 parent 512aaef commit 945df43
Show file tree
Hide file tree
Showing 10 changed files with 105 additions and 52 deletions.
24 changes: 1 addition & 23 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,30 +2,8 @@

As of Decemeber 2023 this is a monorepo built around going beyond the Ishtar Commander mobile applications.

The current short term plans are:

- [x] Setup github page and have a running CI.
- [x] Register the new domains.
- [] Learn how to setup a cloudflare D1 database and record CI related data.
- [] Setup a mini stats [dashboard](https://dashboard.guardianghost.com).
- [] Setup a mini [documentation](https://documentation.guardianghost.com) site. MKdocs or Starlight are options.
- [] Start with a React app for the main app. However React Native has potential for hitting mobile, desktop and web.

The tech choices are based on interesting new tools to learn. However the main app will use React.

## Developer environment

I did try to use [Bun](https://bun.sh/) which limits development to Linux and MacOS with Windows support only on [WSL](https://learn.microsoft.com/en-us/windows/wsl/about). However the monorepo and full node ecosystem support isn't quite there yet. Thus Node and [Pnpm](https://pnpm.io) are used instead. CI runs as of 25.12.2023 are ~25 seconds with PNPM and probably would be 5-8 seconds faster with Bun. I will revisit Bun later in 2024 when its compatibility and Monorepo support improves.



## CI / DevOps
The CI is powerered by github acctions and the aims are:
1. Full CI run should only take 1 min for the entire monorepo.
2. CI costs should happily fit inside githubs free tier. That's 2000 minutes a month. However none of these minutes is currently used as runs that take under a minute don't seem to count towards this total.
3. Try and use some of the new generation of Rust based tools to keep every stage as fast as possible.

[Dependabot](https://github.com/dependabot) is enabled on the repo and runs everyday. In general the number of dependencies is kept as low as possible. However the aim is to only have items updated on a weekly basis.

[Sonarqube](https://sonarcloud.io/organizations/nigelbreslaw/projects) offers a free tier for public projects and runs as a quality gate on every PR.

Full documentation and details about the project can be found [here](https://docs.guardianghost.com).
15 changes: 13 additions & 2 deletions docs/starlight/astro.config.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -10,16 +10,27 @@ export default defineConfig({
github: 'https://github.com/NigelBreslaw/guardian-ghost',
},
sidebar: [
{
label: 'Technologies',
items: [
{ label: 'CI', link: '/tech/ci/' },
{ label: 'Misc', link: '/tech/misc/' },
]
},
{
label: 'Guides',
items: [
// Each item here is one entry in the navigation menu.
{ label: 'Example Guide', link: '/guides/example/' },
{ label: 'Getting started', link: '/guides/getting-started/' },
{ label: 'Cloudflare', link: '/guides/cloudflare/' },

],
},
{
label: 'Reference',
autogenerate: { directory: 'reference' },
items: [
{ label: 'Costs', link: '/reference/costs/' },
]
},
],
}),
Expand Down
12 changes: 12 additions & 0 deletions docs/starlight/src/content/docs/guides/cloudflare.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
---
title: Cloudflare
description: Details of how the cloudflare setup works
---

This section records how the [Cloudflare]() setup works to avoid having to relearn this in the future.






11 changes: 0 additions & 11 deletions docs/starlight/src/content/docs/guides/example.md

This file was deleted.

20 changes: 20 additions & 0 deletions docs/starlight/src/content/docs/guides/getting-started.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
---
title: Getting Started
description: Instructions for setting up the Guardian Ghost monorepo and dev environment
---

Guardian Ghost is setup as a monorepo.

The following setup presumes you are using Git Worktree. If that is new to you check out this quick [video](https://www.youtube.com/watch?v=2uEqYw-N8uE).

First bare clone the repo `git clone --bare [email protected]:NigelBreslaw/guardian-ghost.git`.

Then cd in `cd guardian-ghost.git` and setup the origin `git config remote.origin.fetch "+refs/heads/*:refs/remotes/origin/*"` or git fetch won't work as expected.

When pushing a new branch you will see 'current branch has no upstream branch, blah blah blah'. As of git 2.37.0 and higher you can setup auto tracking and never have to deal with this again! `git config --global push.autoSetupRemote true`



## TODO

Create a bash script that checks you have the right version of various tools such as git, xcode, etc and clones and sets everything up for you.
10 changes: 5 additions & 5 deletions docs/starlight/src/content/docs/index.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -3,16 +3,16 @@ title: GG Guardian Ghost docs
description: Built using Astro Starlight
template: splash
hero:
tagline: Currently this is just the Starlight starter template
tagline: Developer focused documentation
image:
file: ../../assets/guardian-loot.webp
actions:
- text: Example Guide
link: /guides/example/
- text: Getting started
link: /guides/getting-started/
icon: right-arrow
variant: primary
- text: Read the Starlight docs
link: https://starlight.astro.build
- text: Visit the main Guardian Ghost page
link: https://guardianghost.com
icon: external
---

Expand Down
29 changes: 29 additions & 0 deletions docs/starlight/src/content/docs/reference/costs.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
---
title: Costs
description: Current yearly tool and hosting costs for developing Guardian Ghost
---

### Hosting
Source code: Github (free)

Web apps: Cloudflare Pages (free)


### App Stores and SDK
Windows and Android are either free or were a one off fee paid years ago.
Apple (iOS and MacOS): $99 a year.


### Domain registration
.com and .app yearly fees are ~$20 a year

# Yearly total
$120








11 changes: 0 additions & 11 deletions docs/starlight/src/content/docs/reference/example.md

This file was deleted.

19 changes: 19 additions & 0 deletions docs/starlight/src/content/docs/tech/ci.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
---
title: CI
description: Details on continuous integration
---

The aim is to have an ultra fast and simple CI.

The CI is powerered by github acctions and the aims are:
1. Full CI run should only take 1 min for the entire monorepo.
2. CI costs should happily fit inside githubs free tier. That's 2000 minutes a month. However none of these minutes is currently used as runs that take under a minute don't seem to count towards this total.
3. Try and use some of the new generation of Rust based tools to keep every stage as fast as possible.

[Dependabot](https://github.com/dependabot) is enabled on the repo and runs everyday. In general the number of dependencies is kept as low as possible. However the aim is to only have items updated on a weekly basis.

[Sonarqube](https://sonarcloud.io/organizations/nigelbreslaw/projects) offers a free tier for public projects and runs as a quality gate on every PR.

:::tip[Enterprise CI]
Self hosting a Gitlab runner would enable an even faster CI. Various installs and NPM packages would be auto cached. A higher end multicore VM could build, lint and test everything faster. Finally [Turborepo](https://turbo.build/) can be used to cache stages to avoid rebuilding and retesting unchanged projects in the monorepo.
:::
6 changes: 6 additions & 0 deletions docs/starlight/src/content/docs/tech/misc.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
title: Misc
description: Details on previous tech trials
---

December 2023: I did try to use [Bun](https://bun.sh/) which limits development to Linux and MacOS with Windows support only on [WSL](https://learn.microsoft.com/en-us/windows/wsl/about). However the monorepo and full node ecosystem support isn't quite there yet. Thus Node and [Pnpm](https://pnpm.io) are used instead. CI runs as of 25.12.2023 are ~25 seconds with PNPM and probably would be 5-8 seconds faster with Bun. I will revisit Bun later in 2024 when its compatibility and Monorepo support improves.

0 comments on commit 945df43

Please sign in to comment.