Skip to content

Commit b99da60

Browse files
authored
Update README.md
Added some documentation, diagrams
1 parent 4798dd4 commit b99da60

File tree

1 file changed

+62
-1
lines changed

1 file changed

+62
-1
lines changed

README.md

Lines changed: 62 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,62 @@
1-
# rubberduckvba
1+
# rubberduckvba.com
2+
This solution contains the projects and resources that are hosted on a **Microsoft Azure** virtual machine that serves the [rubberduckvba.com](https://rubberduckvba.com) website.
3+
4+
- **rubberduckvba.client**
5+
The typescript/Angular front-end client; the actual website.
6+
7+
- **rubberudckvba.Server**
8+
The back-end server, served in production at [api.rubberduckvba.com](https://api.rubberduckvba.com).
9+
10+
- **rubberduckvba.database**
11+
The SQL Server database holding site data. The database is accessed using two connection strings, making it possible to write to test or production databases from a local debug session with a local hangfire server.
12+
- **RubberduckDb** is used for storing all content under the `[dbo]` schema
13+
- **HangfireDb** is used for accessing the `[hangfire]` schema (scheduled tasks)
14+
15+
- **RubberduckServices**
16+
Services involving Rubberduck 2.x libraries:
17+
- Rubberduck.Parsing.dll
18+
- Rubberduck.SmartIndenter.dll
19+
- Rubberduck.VBEditor.dll
20+
21+
___
22+
23+
# Local Setup
24+
Microsoft SQL Server Express is required; double-click the `rubberduckvba.database.localdb.publish.xml` file under the database project to deploy the database schema locally. The Angular site should run out of the box, even without data.
25+
26+
Updating GitHub metadata requires a GitHub access token; configure user secrets to define the following values:
27+
28+
```json
29+
"GitHub:OrgToken": "required",
30+
"GitHub:ClientSecretId": "optional",
31+
"GitHub:ClientId": "optional",
32+
```
33+
34+
Where **OrgToken** is a valid _personal access token_ (PAT); generate one from your GitHub profile, under _developer settings_. **ClientId** and **ClientSecretId** are for OAuth login controllers, which was used by an older version of the site to grant certain content editing accesses to org members; create a GitHub OAuth application from your profile. The feature/content update pipelines use the PAT for credentials instead.
35+
___
36+
37+
# Hangfire Tasks
38+
The server uses Hangfire to schedule and run background tasks, and creates two jobs at startup:
39+
- **update_installer_downloads** is scheduled to run on a daily basis
40+
- **update_xmldoc_content** is created but not scheduled
41+
42+
## Installer download stats
43+
When triggered, the **update_installer_downloads** job creates a TPL DataFlow pipeline that can be documented as follows:
44+
45+
![diagram](https://github.com/user-attachments/assets/a1b81d49-3bfa-4660-b399-7da2a39a2538)
46+
47+
Essentially, we're hitting GitHub (using the **GitHub:OrgToken** credentials) to retrieve all tags from the **rubberduck-vba/Rubberduck** repository. Once we have all the tags, we identify the current **release** (main) and **pre-release** (next) tags and proceed to retrieve the xmldoc assets from these tags, and then we either update existing records with the updated data, or we insert new records with the new data - either way the website's front page displays updated figures and an updated timestamp immediately after it completes.
48+
49+
The task can be launched manually from the back-end API with an authenticated POST request to `/admin/update/tags`.
50+
51+
## Update XmlDoc content
52+
Similarly, this job creates a TPL DataFlow pipeline that can be documented as follows:
53+
54+
![diagram](https://github.com/user-attachments/assets/519e1d61-514f-4186-a694-4db69d7e8da9)
55+
56+
This pipeline hits GitHub to download the code inspections' default configuration from the **rubberduck-vba/Rubberduck** repository, fetches the current-latest tags from the database to compare against the current-latest tags from GitHub, then downloads the .xml assets and parses them into "feature items" and proceeds to merge the contents:
57+
- Items that exist in **next** but not **main** are considered/marked as NEW
58+
- Items that exist in **main** but not in **next** are considered/marked as DISCONTINUED
59+
- Items that exist in both branches get their content from **next**
60+
- Items for which the json-serialized data has changed get updated; the others are left alone.
61+
62+
The task can be launched manually from the back-end API with an authenticated POST request to `/admin/update/xmldoc`; the endpoint is intended to be invoked by a webhook listening for GitHub tag/release activity, automatically updating the inspections, quickfixes, and annotations content accordingly.

0 commit comments

Comments
 (0)