Skip to content

Commit 7a2ec3a

Browse files
committed
feat(adminjs): generate admin with mongo
1 parent b919d5d commit 7a2ec3a

File tree

4 files changed

+37
-34
lines changed

4 files changed

+37
-34
lines changed

README.md

Lines changed: 34 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ This generator will help you to build your own Nest.JS Mongodb/MySQL API using T
2222

2323
### Project Introduction
2424

25+
- Admin.js
2526
- Support ES6/ES7 features
2627
- Using Eslint followed [Airbnb JavaScript Style Guide](https://github.com/airbnb/javascript)
2728
- Husky
@@ -39,6 +40,39 @@ This generator will help you to build your own Nest.JS Mongodb/MySQL API using T
3940
- jwt authentication
4041
- passport google 2.0 strategy
4142

43+
### AdminJS
44+
45+
AdminJS is available to use if you select Mongo + JWT/Passport, on the route:
46+
47+
```bash
48+
http://localhost:3000/admin
49+
```
50+
51+
If you are not logged in, you will be redirected to the admin login page.
52+
53+
```bash
54+
http://localhost:3000/admin/login
55+
```
56+
57+
To login in the admin panel, you have to have registered verified user with admin role.
58+
59+
To create a default admin user you can run migrations:
60+
61+
```bash
62+
mingrate-mongo up
63+
```
64+
65+
The migrations will create a default admin user in db with creds:
66+
67+
```bash
68+
login: admin@test.com
69+
password: String_12345
70+
```
71+
72+
![Alt Text2](https://media.giphy.com/media/HdWGgOGfQa0QRLNXME/giphy.gif)
73+
74+
_Note: admin cat be generated only with mongo + jwt/passport_
75+
4276
### Roles
4377
For now, we are implement only few roles: `user` and `admin`
4478

@@ -78,37 +112,6 @@ use Exclude decorator to exclude properties from serialization
78112

79113
- Nodemailer
80114

81-
### AdminJS
82-
83-
AdminJS is available to use if you select Mongo + JWT/Passport, on the route:
84-
85-
```bash
86-
http://localhost:3000/admin
87-
```
88-
89-
If you are not logged in, you will be redirected to the admin login page.
90-
91-
```bash
92-
http://localhost:3000/admin/login
93-
```
94-
95-
To login in the admin panel, you have to have registered verified user with admin role.
96-
97-
To create a default admin user you can run migrations:
98-
99-
```bash
100-
mingrate-mongo up
101-
```
102-
103-
The migrations will create a default admin user in db with creds:
104-
105-
```bash
106-
login: admin@test.com
107-
password: String_12345
108-
```
109-
110-
![Alt Text2](https://media.giphy.com/media/HdWGgOGfQa0QRLNXME/giphy.gif)
111-
112115
## Requirements
113116

114117
- node >= 14

generators/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "generator-nest-js-boilerplate",
3-
"version": "2.30.0",
3+
"version": "3.0.0",
44
"description": "This generator will help you to build your own Nest.js Mongodb API using TypeScript 4",
55
"author": "onix-systems",
66
"license": "MIT",

package-lock.json

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "generator-nest-js-boilerplate",
3-
"version": "2.30.0",
3+
"version": "3.0.0",
44
"description": "This generator will help you to build your own Nest.js Mongodb API using TypeScript 4",
55
"author": "onix-systems",
66
"license": "MIT",

0 commit comments

Comments
 (0)