Skip to content

Commit

Permalink
Implemented: document the ving structure #84
Browse files Browse the repository at this point in the history
  • Loading branch information
rizen committed Apr 10, 2024
1 parent ea2a3f3 commit 1560a3d
Show file tree
Hide file tree
Showing 7 changed files with 54 additions and 0 deletions.
1 change: 1 addition & 0 deletions docs/.vitepress/config.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ export default defineConfig({
items: [
{ text: 'Installation', link: '/installation' },
{ text: 'Environment Variables', link: '/env' },
{ text: 'Architecture', link: '/architecture' },
{ text: 'Error Codes', link: '/error-codes' },
{ text: 'Change Log', link: '/change-log' },
]
Expand Down
43 changes: 43 additions & 0 deletions docs/architecture.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
---
outline: deep
---
# Architecture

Ving's architecture is made up of many components in many different layers. It's a complex web of systems that enables you to build really complex web-apps really quickly.

```
Presentation: PrimeVue
------------------------
Client: Nuxt Pages + Vue
------------------------
Server: Nuxt SSR + Rest + Bull MQ
------------------------
Application: Drizzle + Ving Record
------------------------
Foundation: Ving Schema
------------------------
Storage: MySQL + Redis + S3
```

## Storage
At its most basic, there is a storage layer that consists of MySQL, Redis, and AWS S3.

## Foundation

At the very heart of Ving are [Ving Schemas](subsystems/ving-schema). From the ving schema, everything else can be generated and configured. The ving schema sets up database tables, data validation, permissions, and more. Everything in the system can trace back to the ving schema.

## Application

At the application layer are [the various subsystems that make up Ving](subsystems/cache). It starts with the [Drizzle ORM](subsystems/drizzle), but extends out to a [caching system](susbsystems/cache), and ultimately culminates in the storage of all business logic in ving through the [Ving Records](subsystems/ving-record).

## Server

At the server level Nuxt runs the [REST interface](subsystems/rest) and Server Side Rendering (SSR) of [Pages](subsystems/ui#pages). There is also [a Jobs service](subsystems/jobs) based upon Bull MQ.

## Client

After Nuxt SSR renders the pages server-side it then hydrates them on the client side full of data and ready to connect to REST for updates. Vue then takes over for dynamic rendering.

## Presentation

And finally, we use PrimeVue and a whole suite of [custom components](subsystems/ui#components) for a list of client-side components and CSS.
1 change: 1 addition & 0 deletions docs/change-log.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ outline: deep
* Implemented: document Nuxt stuff #76
* Implemented: add --bare as an option in generators that gets rid of the boiler plate #75
* Implemented: cli improvements #83
* Implemented: document the ving structure #84

## 2024-04-08
* Breaking change: Refactored VingRecord isOwner(), canEdit(), and propsOptions() to be async.
Expand Down
3 changes: 3 additions & 0 deletions docs/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,9 @@ hero:
- theme: brand
text: Installation
link: /installation
- theme: alt
text: Architecture
link: /architecture
- theme: alt
text: Subsystems
link: /subsystems/cache
Expand Down
2 changes: 2 additions & 0 deletions docs/subsystems/rest.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@ Your Rest endpoints will be generated from your [Ving Schema](ving-schema) by us
./ving.mjs record --rest Foo
```

> Note that you will need a [Ving Schema](ving-schema) and [Ving Record](ving-record) for `Foo` before the rest interface can function.
These will be placed in the `server/api/v1/foo` folder and can be modified by you after the fact.


Expand Down
2 changes: 2 additions & 0 deletions docs/subsystems/ui.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@ You can automatically generate a set of pages for interacting with [ving records
./ving.mjs record --web Foo
```

> Note that you will need a [Ving Schema](ving-schema), [Ving Record](ving-record), and [Rest](rest) for `Foo` before the web interface can function.
That will give you a place to start, and then you can use the [composables](#composables) and [components](#components) we provide to build out a complex app.

## Icons
Expand Down
2 changes: 2 additions & 0 deletions docs/subsystems/ving-record.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@ You can use the [CLI](cli) to automatically generate a new record file for you f
./ving.mjs record --new Foo
```

> Note that you will need a [Ving Schema](ving-schema) for `Foo` before the record can function.
That will generate the file `#ving/record/records/Foo.mjs`. And in there you could add any custom functionality you may need. Or if you don't need any custom functionality, then it may work just as it is.

Once you're done adding functionality you can then generate a Rest API for it by invoing the CLI again like this:
Expand Down

0 comments on commit 1560a3d

Please sign in to comment.