Skip to content

Commit daa92ca

Browse files
committed
feat: docs
1 parent c6242b6 commit daa92ca

18 files changed

Lines changed: 300 additions & 0 deletions

File tree

.vscode/extensions.json

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
{
2+
"recommendations": ["astro-build.astro-vscode"],
3+
"unwantedRecommendations": []
4+
}

apps/docs/.gitignore

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
# build output
2+
dist/
3+
# generated types
4+
.astro/
5+
6+
# dependencies
7+
node_modules/
8+
9+
# logs
10+
npm-debug.log*
11+
yarn-debug.log*
12+
yarn-error.log*
13+
pnpm-debug.log*
14+
15+
16+
# environment variables
17+
.env
18+
.env.production
19+
20+
# macOS-specific files
21+
.DS_Store

apps/docs/README.md

Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
# Starlight Starter Kit: Basics
2+
3+
[![Built with Starlight](https://astro.badg.es/v2/built-with-starlight/tiny.svg)](https://starlight.astro.build)
4+
5+
```
6+
npm create astro@latest -- --template starlight
7+
```
8+
9+
[![Open in StackBlitz](https://developer.stackblitz.com/img/open_in_stackblitz.svg)](https://stackblitz.com/github/withastro/starlight/tree/main/examples/basics)
10+
[![Open with CodeSandbox](https://assets.codesandbox.io/github/button-edit-lime.svg)](https://codesandbox.io/p/sandbox/github/withastro/starlight/tree/main/examples/basics)
11+
[![Deploy to Netlify](https://www.netlify.com/img/deploy/button.svg)](https://app.netlify.com/start/deploy?repository=https://github.com/withastro/starlight&create_from_path=examples/basics)
12+
[![Deploy with Vercel](https://vercel.com/button)](https://vercel.com/new/clone?repository-url=https%3A%2F%2Fgithub.com%2Fwithastro%2Fstarlight%2Ftree%2Fmain%2Fexamples%2Fbasics&project-name=my-starlight-docs&repository-name=my-starlight-docs)
13+
14+
> 🧑‍🚀 **Seasoned astronaut?** Delete this file. Have fun!
15+
16+
## 🚀 Project Structure
17+
18+
Inside of your Astro + Starlight project, you'll see the following folders and files:
19+
20+
```
21+
.
22+
├── public/
23+
├── src/
24+
│ ├── assets/
25+
│ ├── content/
26+
│ │ ├── docs/
27+
│ │ └── config.ts
28+
│ └── env.d.ts
29+
├── astro.config.mjs
30+
├── package.json
31+
└── tsconfig.json
32+
```
33+
34+
Starlight looks for `.md` or `.mdx` files in the `src/content/docs/` directory. Each file is exposed as a route based on its file name.
35+
36+
Images can be added to `src/assets/` and embedded in Markdown with a relative link.
37+
38+
Static assets, like favicons, can be placed in the `public/` directory.
39+
40+
## 🧞 Commands
41+
42+
All commands are run from the root of the project, from a terminal:
43+
44+
| Command | Action |
45+
| :------------------------ | :----------------------------------------------- |
46+
| `npm install` | Installs dependencies |
47+
| `npm run dev` | Starts local dev server at `localhost:4321` |
48+
| `npm run build` | Build your production site to `./dist/` |
49+
| `npm run preview` | Preview your build locally, before deploying |
50+
| `npm run astro ...` | Run CLI commands like `astro add`, `astro check` |
51+
| `npm run astro -- --help` | Get help using the Astro CLI |
52+
53+
## 👀 Want to learn more?
54+
55+
Check out [Starlight’s docs](https://starlight.astro.build/), read [the Astro documentation](https://docs.astro.build), or jump into the [Astro Discord server](https://astro.build/chat).

apps/docs/astro.config.mjs

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
// @ts-check
2+
import { defineConfig } from 'astro/config'
3+
import starlight from '@astrojs/starlight'
4+
5+
// https://astro.build/config
6+
export default defineConfig({
7+
integrations: [
8+
starlight({
9+
title: 'Softnetics RBAC',
10+
social: {
11+
github: 'https://github.com/softnetics/rbac',
12+
},
13+
sidebar: [
14+
{
15+
label: 'Getting Started',
16+
autogenerate: { directory: 'getting-started' },
17+
// items: [
18+
// // Each item here is one entry in the navigation menu.
19+
// { label: 'Introduction', slug: 'getting-started/introduction' },
20+
// ],
21+
},
22+
{
23+
label: 'Reference',
24+
autogenerate: { directory: 'reference' },
25+
},
26+
],
27+
}),
28+
],
29+
})

apps/docs/package.json

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
{
2+
"name": "docs",
3+
"type": "module",
4+
"version": "0.0.1",
5+
"scripts": {
6+
"dev": "astro dev",
7+
"start": "astro dev",
8+
"build": "astro check && astro build",
9+
"preview": "astro preview",
10+
"astro": "astro"
11+
},
12+
"dependencies": {
13+
"@astrojs/starlight": "^0.29.2",
14+
"astro": "^4.16.10",
15+
"sharp": "^0.32.5",
16+
"@astrojs/check": "^0.9.4",
17+
"typescript": "^5.7.2"
18+
}
19+
}

apps/docs/public/favicon.svg

Lines changed: 1 addition & 0 deletions
Loading

apps/docs/src/assets/houston.webp

96.2 KB
Loading
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
import { createIdentity } from '@softnetics/rbac'
2+
3+
const identity = createIdentity({
4+
policies: [policy],
5+
identities: {
6+
student: ['todo.viewer'],
7+
teacher: ['todo.editor', 'todo.viewer'],
8+
},
9+
})
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
createPolicy({
2+
name: 'todo',
3+
permissions: {
4+
todo: ['create', 'read', 'update', 'delete'],
5+
comment: ['create', 'read', 'delete'],
6+
},
7+
roles: {
8+
viewer: ['todo.read', 'comment.read'],
9+
editor: ['todo.*', 'comment.delete'],
10+
admin: '*',
11+
},
12+
})
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
import { createPolicy } from '@softnetics/rbac'
2+
3+
const policy = createPolicy({
4+
name: 'todo',
5+
permissions: {
6+
todo: ['create', 'read', 'update', 'delete'],
7+
comment: ['create', 'read', 'update'],
8+
},
9+
roles: {
10+
viewer: ['todo.read', 'comment.read'],
11+
editor: ['todo.create', 'todo.update', 'comment.create', 'comment.update'],
12+
},
13+
})

0 commit comments

Comments
 (0)