Skip to content

Commit 28e089f

Browse files
committed
docs simplifications
1 parent fc13d0e commit 28e089f

File tree

6 files changed

+57
-80
lines changed

6 files changed

+57
-80
lines changed

adminforth/documentation/docs/tutorial/001-gettingStarted.md

Lines changed: 22 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -45,15 +45,16 @@ npx adminforth create-app
4545
CLI options:
4646

4747
* **`--app-name`** - name for your project. Used in `package.json`, `index.ts` branding, etc. Default value: **`adminforth-app`**.
48-
* **`--db`** - database connection string. Currently PostgreSQL, MongoDB and SQLite are supported. Default value: **`sqlite://.db.sqlite`**
48+
* **`--db`** - database connection string. Currently PostgreSQL, MongoDB, SQLite, Clickhouse are supported. Default value: **`sqlite://.db.sqlite`**
4949

5050
> ☝️ Database Connection String format:
5151
>
52-
> Format is `<scheme>://<username>:<password>@<host>:<port>/<database>`
52+
> Format is `<scheme>://<username>:<password>@<host>:<port>/<database>`. Examples:
5353
>
54-
> For SQLite, you can use `sqlite://.db.sqlite`. If database not yet exists it will be created.
55-
> For PostgreSQL — `postgres://user:password@localhost:5432/dbname`.
56-
> For MongoDB — `mongodb://localhost:27017/dbname`.
54+
> - SQLite — `sqlite://.db.sqlite`. If database not yet exists it will be created
55+
> - PostgreSQL — `postgres://user:password@localhost:5432/dbname`
56+
> - MongoDB — `mongodb://localhost:27017/dbname`
57+
> - Clickhouse — `clickhouse://localhost:8123/dbname`
5758
5859
### Understand the generated Project Structure
5960

@@ -97,6 +98,19 @@ npm run makemigration -- --name <name_of_changes>
9798

9899
Other developers need to pull migration and run `npm run migrate` to apply any unapplied migrations.
99100

101+
## Run the Server
102+
103+
Now you can run your app:
104+
105+
```bash
106+
npm start
107+
```
108+
109+
Open http://localhost:3500 in your browser and (default credentials are `adminforth`/`adminforth` if you haven’t changed them).
110+
111+
![alt text](localhost_3500_login.png)
112+
113+
100114
## AdminForth Basic Philosophy
101115

102116
AdminForth connects to existing databases and provides a back-office for managing data including CRUD operations, filtering, sorting, and more.
@@ -113,6 +127,8 @@ Also in AdminForth you can define in "Vue" way:
113127
* create own pages e.g. Dashboard using AdminForth Components Library (AFCL) or any other Vue componetns.
114128
* insert injections into standard pages (e.g. add diagram to list view)
115129

130+
131+
116132
## Adding an `apartments` Model
117133

118134
So far, our freshly generated AdminForth project includes a default `adminuser` model and a corresponding `users` resource.
@@ -355,19 +371,7 @@ export const admin = new AdminForth({
355371

356372
```
357373

358-
## Run the Server
359-
360-
Now you can run your app:
361-
362-
```bash
363-
npm start
364-
```
365-
366-
Open http://localhost:3500 in your browser and (default credentials are `adminforth`/`adminforth` if you haven’t changed them).
367-
368-
![alt text](localhost_3500_login.png)
369-
370-
## Generating fake records
374+
## Generating fake appartments
371375

372376
```ts title="./index.ts"
373377
//diff-add
@@ -430,6 +434,3 @@ This will create records during first launch. Now you should see:
430434
431435
Feel free to play with the data, add more fields, and customize the UI to your liking.
432436
433-
## Possible configuration options
434-
435-
Check [AdminForthConfig](/docs/api/types/Back/interfaces/AdminForthConfig.md) for all possible options.

adminforth/documentation/docs/tutorial/01-helloWorld.md

Lines changed: 33 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,9 @@ sidebar_class_name: hidden-sidebar
66

77
# Hello world app without CLI
88

9-
No water. Pure code to get started ASAP.
9+
While AdminForth CLI is the fastest way to create a new project, you can also create a new project manually.
10+
11+
This might help you better understand how AdminForth project is structured and how to customize it.
1012

1113
Here we create database with users and posts tables and admin panel for it.
1214

@@ -305,6 +307,36 @@ Open http://localhost:3500 in your browser and login with credentials `adminfort
305307
![alt text](localhost_3500_login.png)
306308

307309

310+
## Initializing custom directory
311+
312+
If you are not using CLI, you can create `custom` directory and initialize it with `npm`:
313+
314+
```bash
315+
cd ./custom
316+
npm init -y
317+
```
318+
319+
Also, for better development experience we recommend to create file `custom/tsconfig.json` with the following content:
320+
321+
```json
322+
{
323+
"compilerOptions": {
324+
"baseUrl": ".",
325+
"paths": {
326+
"@/*": [
327+
"../node_modules/adminforth/dist/spa/src/*"
328+
],
329+
"*": [
330+
"../node_modules/adminforth/dist/spa/node_modules/*"
331+
],
332+
"@@/*": [
333+
"."
334+
]
335+
}
336+
}
337+
}
338+
```
339+
308340

309341
## Possible configuration options
310342

adminforth/documentation/docs/tutorial/03-Customization/02-customFieldRendering.md

Lines changed: 1 addition & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -143,33 +143,12 @@ const props = defineProps<{
143143
</script>
144144
```
145145

146-
## Using 3rd-party npm packages in the components
146+
## Using 3rd-party npm packages in the Vue components
147147

148148
To install 3rd-party npm packages you should create npm package in the `custom` directory:
149149

150150
```bash
151151
cd custom
152-
npm init -y
153-
```
154-
155-
> 👆 Note: for better development experience we recommend to create file `custom/tsconfig.json` with the following content:
156-
> ```json
157-
> {
158-
> "compilerOptions": {
159-
> "baseUrl": ".",
160-
> "paths": {
161-
> "@/*": [
162-
> "../node_modules/adminforth/dist/spa/src/*"
163-
> ],
164-
> "*": [
165-
> "../node_modules/adminforth/dist/spa/node_modules/*"
166-
> ],
167-
> "@@/*": [
168-
> "."
169-
> ]
170-
> }
171-
> }
172-
> }
173152
```
174153

175154
And simply do `npm install` for the package you need:

adminforth/documentation/docs/tutorial/03-Customization/06-customPages.md

Lines changed: 0 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -4,33 +4,6 @@ Most Admin Panels should have some Dashboards or custom pages.
44

55
In AdminForth creation of custom page is very simple.
66

7-
To add custom package to SPA bundle you have to initialize npm in `custom` directory and install required packages:
8-
9-
```bash
10-
cd ./custom
11-
npm init -y
12-
npm i apexcharts -D
13-
```
14-
15-
> 👆 Note: for better development experience we recommend to create file `custom/tsconfig.json` with the following content:
16-
> ```json
17-
> {
18-
> "compilerOptions": {
19-
> "baseUrl": ".",
20-
> "paths": {
21-
> "@/*": [
22-
> "../node_modules/adminforth/dist/spa/src/*"
23-
> ],
24-
> "*": [
25-
> "../node_modules/adminforth/dist/spa/node_modules/*"
26-
> ],
27-
> "@@/*": [
28-
> "."
29-
> ]
30-
> }
31-
> }
32-
> }
33-
> ```
347

358
Create a Vue component in the `custom` directory of your project, e.g. `Dashboard.vue`:
369

adminforth/documentation/docs/tutorial/03-Customization/08-pageInjections.md

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -136,11 +136,6 @@ onMounted(async () => {
136136
</script>
137137
```
138138

139-
Then initialize npm in `custom` directory if you didn't do this and install required packages:
140-
```bash
141-
npm init -y
142-
npm i apexcharts -D
143-
```
144139

145140
Also we have to add an Api to get percentages:
146141

@@ -316,8 +311,7 @@ For this demo we will use text-analyzer package:
316311
317312
```bash
318313
cd custom
319-
npm init -y
320-
npm install text-analyzer --save
314+
npm i text-analyzer
321315
```
322316
323317

adminforth/documentation/docusaurus.config.ts

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,6 @@ import {themes as prismThemes} from 'prism-react-renderer';
22
import type {Config} from '@docusaurus/types';
33
import type * as Preset from '@docusaurus/preset-classic';
44

5-
console.log('⭐⭐⭐⭐⭐⭐⭐⭐', process.env.NODE_ENV)
6-
75

86
const config: Config = {
97
title: 'Vue & Node admin panel framework',

0 commit comments

Comments
 (0)