Skip to content

Commit bd570cd

Browse files
committed
feat: add README template for CLI
1 parent 00ad2ca commit bd570cd

File tree

2 files changed

+45
-0
lines changed

2 files changed

+45
-0
lines changed
Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
## Starting the application
2+
3+
Install dependencies:
4+
5+
```bash
6+
npm ci
7+
```
8+
9+
Migrate the database:
10+
11+
```bash
12+
npm run migrateLocal
13+
```
14+
15+
Start the server:
16+
17+
```bash
18+
npm start
19+
```
20+
21+
{{#if prismaDbUrl}}
22+
## Changing schema
23+
24+
Open `schema.prisma` and change schema as needed: add new tables, columns, etc (See [Prisma schema reference](https://www.prisma.io/docs/reference/tools-and-interfaces/prisma-schema)).
25+
26+
Run the following command to generate a new migration and apply it instantly in local database:
27+
28+
```bash
29+
npm run makemigration -- --name <name_of_changes>
30+
```
31+
32+
Your colleagues will need to pull the changes and run `npm run migrateLocal` to apply the migration in their local database.
33+
{{/if}}
34+
35+
## Documentation
36+
37+
- [Customizing AdminForth Branding](https://adminforth.dev/docs/tutorial/Customization/branding/)
38+
- [Custom Field Rendering](https://adminforth.dev/docs/tutorial/Customization/customFieldRendering/)
39+
- [Hooks](https://adminforth.dev/docs/tutorial/Customization/hooks/)
40+
- [Custom Pages](https://adminforth.dev/docs/tutorial/Customization/customPages/)

adminforth/commands/createApp/utils.js

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -186,6 +186,11 @@ async function writeTemplateFiles(dirname, cwd, options) {
186186
dest: '.env.local',
187187
data: { dbUrl, prismaDbUrl },
188188
},
189+
{
190+
src: 'readme.md.hbs',
191+
dest: 'README.md',
192+
data: { dbUrl, prismaDbUrl },
193+
},
189194
{
190195
// We'll write .env using the same content as .env.sample
191196
src: '.env.local.hbs',

0 commit comments

Comments
 (0)