Skip to content

Commit b5f7f50

Browse files
committed
introducing login and user management
1 parent 4f53a4a commit b5f7f50

33 files changed

+5443
-516
lines changed

README.md

Lines changed: 34 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
* A minimalistic (as possible) startingpoint, following the official guides, and avoiding some pitfalls.
44
* It was important to me that all dependent packages are up to date.
55
* I didn't test the app for all possible and impossible scenarios, only for my very specific requirements.
6+
* It ist my public playground, where i test out concepts and implementations for my apps.
67

78
Goals
89

@@ -33,6 +34,11 @@ If you also want to build an app with this setup, this could be a good starting
3334
* Catalog-Module for local and remote pouchdb stores.
3435
* local stores can be backuped to zip archives.
3536
* switch between stores on the fly.
37+
* User-Management and Login
38+
* Provide a Login-form
39+
* Provide User-Management / Users and Roles (add, remove)
40+
* Encrypt and decrypt data to store them localy via Elecron-Conf
41+
* persist current user, for automatic login.
3642

3743
## React Pitfalls
3844

@@ -42,19 +48,23 @@ If you also want to build an app with this setup, this could be a good starting
4248

4349
Database. Settings and switch. This is an example for a `List`. The Name of the active catalog shows up in the Application-Title.
4450

45-
![Screenshot Database Settings and Switch](readme-images/screenshot-001.png)
51+
![login Screen](readme-images/screenshot-001.png)
52+
53+
Session stays open if you with so, so you will logged in automatically on next startup.
54+
55+
![Screenshot Database Settings and Switch](readme-images/screenshot-002.png)
4656

4757
IPC Ping-Pong. Note that the header buttons can also be hidden/deactivated.
4858

49-
![Screenshot IPC Ping-Pong](readme-images/screenshot-002.png)
59+
![Screenshot IPC Ping-Pong](readme-images/screenshot-003.png)
5060

5161
Example-Module User-`View`. THis is a non-editable view of a single entry from the list.
5262

53-
![Screenshot Example-Module User-View](readme-images/screenshot-003.png)
63+
![Screenshot Example-Module User-View](readme-images/screenshot-004.png)
5464

5565
Example-Module User-`Form`. A Formular, to create, or update Data:
5666

57-
![Screenshot Example-Module User-Form](readme-images/screenshot-004.png)
67+
![Screenshot Example-Module User-Form](readme-images/screenshot-005.png)
5868

5969
## Use the Repo
6070

@@ -140,7 +150,7 @@ git init
140150
# restore the backuped .gitignore
141151
```
142152

143-
run the commands:
153+
### run the commands
144154

145155
```bash
146156
#start the app
@@ -158,6 +168,11 @@ npm run make
158168
* Inspect the code for further reference.
159169
* Have fun and success with your project.
160170

171+
## Login
172+
173+
Login with username = `f_mueller` and password `f_mueller`.
174+
Example Users with different roles have username quals password.
175+
161176
## Update outdated packages
162177

163178
> [!IMPORTANT]
@@ -425,6 +440,20 @@ npm install zip-a-folder
425440
npm install dayjs
426441
```
427442

443+
### User Management and Login
444+
445+
* Encrypt and decrypt data to store them localy via Elecron-Conf
446+
* Users and Roles
447+
448+
### SVG Support
449+
450+
Display an SVG Image in this environment - used on the Login Page.
451+
452+
* `npm install @svgr/webpack --save-dev`
453+
* add to `webpack.rules.ts`
454+
* create `custom.d.ts`
455+
* add to `tsconfig.json`
456+
428457
### Sign the App
429458

430459
pending

assets/docs-json/users.json

Lines changed: 16 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,30 @@
11
[
22
{
33
"_id": "e0c9b078-3782-444a-baf7-6ac1e7873313",
4-
"name": "Fritz Schmitz"
4+
"name": "Fritz Müller-Admin",
5+
"userid": "f_mueller",
6+
"password":"$2a$10$vN6Wg9ilv2pohqd5WKpAHOYDJ7AOgc72wmvl7iHzxM8JBPuNpsHbi",
7+
"userrights": "admin"
58
},
69
{
710
"_id": "4e6969dd-a75c-40fb-a6c7-7c722fc5cdde",
8-
"name": "Hugo Roundup"
11+
"name": "Hugo ReadWrite",
12+
"userid": "h_readwrite",
13+
"password":"$2a$10$.lMO1kE/uwAtNYpmR7wZF.GQ.65gdfksOLu1.N8nS11LmXSDEG3Su",
14+
"userrights": "read-write"
915
},
1016
{
1117
"_id": "6d41e4f0-13a6-4a5a-9db5-2fab339fc430",
12-
"name": "Margarete Marksman"
18+
"name": "Margarete Readonly",
19+
"userid": "m_readonly",
20+
"password":"$2a$10$s6c0UcOi1WwrERcXmZhsB.0eMUdVEBN6U4KZZ3cQIZ5KREb1RdGx2",
21+
"userrights": "read-only"
1322
},
1423
{
1524
"_id": "fcf301fe-e098-42a2-9b67-3d0ec1b74379",
16-
"name": "Heribert Nothingnes"
25+
"name": "Heribert None",
26+
"userid": "h_none",
27+
"password":"$2a$10$EL8me4QUmeCWSAmLUJLsOOR/HYwDLui8X3MxFv66v/cTe6cODqy9K",
28+
"userrights": "none"
1729
}
1830
]

custom.d.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
declare module '*.svg' {
2+
const content: React.FunctionComponent<React.SVGAttributes<SVGElement>>;
3+
export default content;
4+
}

0 commit comments

Comments
 (0)