|
1 | | -# AdminForth - fully free Node.js admin panel framework on Vue & Tailwind |
| 1 | +# AdminForth - free powerfull Node.js admin panel framework on Vue & Tailwind |
2 | 2 |
|
3 | 3 |
|
4 | 4 | <a href="https://adminforth.dev"><img src="https://img.shields.io/badge/website-adminforth.dev-blue" style="height:24px"/></a> <a href="https://adminforth.dev"><img src="https://img.shields.io/npm/dw/adminforth" style="height:24px"/></a> <a href="https://devforth.io"><img src="https://raw.githubusercontent.com/devforth/OnLogs/e97944fffc24fec0ce2347b205c9bda3be8de5c5/.assets/df_powered_by.svg" style="height:28px"/></a> |
|
20 | 20 | <br/> |
21 | 21 |
|
22 | 22 | Why AdminForth: |
23 | | -* AdminForth is always free and open-source (no paid versions, no cloud subscriptions sh*t) |
24 | | -* Init AdminForth with your database URL in Node.js file, easily describe the tables you wish to see in admin, and get fully functional UI for your data (filter, create, edit, remove) |
25 | | -* Define Vue components to change look of various parts of admin (place in data cell, instead of row, add something above the table, inject something to header or sidebar, add custom page with charts or custom components) |
26 | | -* Rich build-in Components library (AdminForth AFCL) with premade easy-to-use build-blocks which follow your theme |
| 23 | + |
| 24 | +* Init AdminForth project with `npx adminforth create-app` and pass your database URL, import the tables you wish to see in admin using `npx adminforth resource`, and get fully functional UI for your data (filter, create, edit, remove) |
| 25 | +* Modern look and simple Tailwind-ish ability to adjust it |
| 26 | +* Supports Postgres, MySQL, Mongo, SQLite, Clickhouse |
| 27 | +* Define Vue components to change look of various parts of admin using `npx adminforth component` (edit data cells, edit fields, add something above the table, inject something to header or sidebar, add custom page with charts or custom components) |
| 28 | +* Build-in Components library (AdminForth AFCL) with premade easy-to-use build-blocks which follow your theme |
27 | 29 | * Define express APIs and call them from your components and pages |
28 | | -* Use various modern back-office-must-have plugins like audit log, files/image upload, TOTP 2FA, I18N, Copilot-style AI writing and image generation |
| 30 | +* Use various modern back-office-must-have plugins like audit log, files/image upload, TOTP 2FA, I18N, Copilot-style AI writing and image generation and many more |
| 31 | +* AdminForth is always free and open-source (no paid versions, no cloud subscriptions sh*t) |
29 | 32 |
|
30 | 33 |
|
31 | 34 | ## Project initialisation |
@@ -54,41 +57,76 @@ npx adminforth create-app |
54 | 57 |
|
55 | 58 |
|
56 | 59 |
|
57 | | - |
58 | 60 | # For developers |
59 | 61 |
|
60 | 62 | The most convenient way to add new features or fixes is using `dev-demo`. It imports the source code of the repository and plugins so you can edit them and see changes on the fly. |
61 | 63 |
|
62 | | -Fork repo, pull it and do next: |
| 64 | +To run dev demo: |
| 65 | +```sh |
| 66 | +cd dev-demo |
63 | 67 |
|
| 68 | +npm run setup-dev-demo |
| 69 | +npm run migrate:all |
64 | 70 |
|
65 | | -```sh |
66 | | -cd adminforth |
67 | | -npm ci |
68 | | -npm run build |
| 71 | +npm start |
| 72 | +``` |
69 | 73 |
|
70 | | -# this will install all official plugins and link adminforth package, if plugin installed it will git pull and npm ci |
71 | | -npm run install-plugins |
| 74 | +## Adding columns to a database in dev-demo |
| 75 | + |
| 76 | +Open `./migrations` folder. There is prisma migration folder for the sqlite, postgres and mysql and `clickhouse_migrations` folder for the clickhouse: |
| 77 | + |
| 78 | +### Migrations for the MySQL, SQLite and Postgres |
| 79 | +To make migration add to the .prisma file in folder with database you need and add new tables or columns. Then run: |
72 | 80 |
|
73 | | -# same for official adapters |
74 | | -npm run install-adapters |
| 81 | + |
| 82 | +``` |
| 83 | +npm run makemigration:sqlite -- --name init |
75 | 84 | ``` |
76 | 85 |
|
77 | | -To run dev demo: |
78 | | -```sh |
79 | | -cd dev-demo |
80 | | -cp .env.sample .env |
81 | | -npm ci |
82 | | -npm run migrate |
83 | | -npm start |
| 86 | +and |
| 87 | + |
| 88 | +``` |
| 89 | +npm run migrate:sqlite |
84 | 90 | ``` |
85 | 91 |
|
86 | | -## Adding columns to a database in dev-demo |
| 92 | +to apply migration |
| 93 | + |
| 94 | +> use :sqlite, :mysql or :postgres for you case |
87 | 95 |
|
88 | | -Open `.prisma` file, modify it, and run: |
| 96 | +### Migrations for the clickhouse |
89 | 97 |
|
| 98 | +In order to make migration for the clickhouse, go to the `./migrations/clickhouse_migrations` folder and add migration file to the folder. |
| 99 | + |
| 100 | +Then run |
90 | 101 | ``` |
91 | | -npm run namemigration -- --name desctiption_of_changes |
| 102 | +npm run migrate:clickhouse |
92 | 103 | ``` |
93 | 104 |
|
| 105 | +to apply the migration. |
| 106 | + |
| 107 | +## Testing CLI commands during development |
| 108 | + |
| 109 | + |
| 110 | +Make sure you have not `adminforth` globally installed. If you have it, remove it: |
| 111 | + |
| 112 | + |
| 113 | +```sh |
| 114 | +npm uninstall -g adminforth |
| 115 | +``` |
| 116 | + |
| 117 | +Then, in the root of the project, run once: |
| 118 | + |
| 119 | +``` |
| 120 | +cd adminforth/adminforth |
| 121 | +npm run build |
| 122 | +``` |
| 123 | + |
| 124 | +This will automatically make an npm link to the `adminforth` package in the root of the project. |
| 125 | + |
| 126 | +Then, go to testing app, e.g. created with CLI, and use next command: |
| 127 | + |
| 128 | +``` |
| 129 | +npx -g adminforth <your command under development> |
| 130 | +``` |
94 | 131 |
|
| 132 | +This will always run latest version of adminforth package. |
0 commit comments