Compare commits
71 Commits
develop/mo
...
develop/fr
Author | SHA1 | Date | |
---|---|---|---|
![]() |
c1b71fca64 | ||
![]() |
08642a2bf6 | ||
![]() |
043d45862c | ||
![]() |
8444b947a4 | ||
![]() |
e791b01160 | ||
![]() |
8383be13bc | ||
![]() |
d82afe5a5f | ||
![]() |
1216bef8f8 | ||
![]() |
02058981bf | ||
![]() |
b7cd25b614 | ||
![]() |
c319c103f6 | ||
![]() |
3213ef951b | ||
![]() |
cc35015a3e | ||
![]() |
253c2f2487 | ||
![]() |
c74a273928 | ||
![]() |
bebf9834e6 | ||
![]() |
45bac1b3c8 | ||
![]() |
862c5bd29c | ||
![]() |
1e1a2d63ae | ||
![]() |
3d2a8bb4f8 | ||
![]() |
f53cf9d932 | ||
![]() |
48e90bca1b | ||
![]() |
c3c93fbde9 | ||
![]() |
17080edb40 | ||
![]() |
17249dee44 | ||
![]() |
bd7e6dd9e0 | ||
![]() |
87ccb2f1ff | ||
![]() |
46f784d587 | ||
![]() |
66b9bf5bdd | ||
![]() |
35b1cd1eba | ||
![]() |
4de7a564e3 | ||
![]() |
08d6727dca | ||
![]() |
d767108fcf | ||
![]() |
5ff3393f54 | ||
![]() |
5a531e1288 | ||
![]() |
5b7cf25753 | ||
![]() |
19b2357771 | ||
![]() |
9f7624fa56 | ||
![]() |
346992d4ec | ||
![]() |
f23a6b7d9c | ||
![]() |
ebc8a81641 | ||
![]() |
f487427b2c | ||
![]() |
cc4d035f97 | ||
![]() |
84b223ff60 | ||
![]() |
fca048074e | ||
![]() |
bc35e25616 | ||
![]() |
15f8d2e6aa | ||
![]() |
592a099f7b | ||
![]() |
4c1b30e5c6 | ||
![]() |
c765bb49a4 | ||
![]() |
9aeb58379d | ||
![]() |
6419567005 | ||
![]() |
e2076fe67b | ||
![]() |
766720e075 | ||
![]() |
19af60c410 | ||
![]() |
ed95621b2f | ||
![]() |
2258fd8fb9 | ||
![]() |
0f674badd9 | ||
![]() |
bc731ea2b8 | ||
![]() |
c11dba6297 | ||
![]() |
b9fbe4e476 | ||
![]() |
0d844eed3f | ||
![]() |
2862cddb6b | ||
![]() |
55509b483c | ||
![]() |
3f2ac2a285 | ||
![]() |
1216de4ff9 | ||
![]() |
7966d8abf5 | ||
![]() |
e975aebfcd | ||
![]() |
7f6970b183 | ||
![]() |
e83854ed2a | ||
![]() |
6961f058df |
19
.gitconfig
Normal file
19
.gitconfig
Normal file
@@ -0,0 +1,19 @@
|
||||
[user]
|
||||
email = louiscklaw@users.noreply.github.com
|
||||
name = louiscklaw
|
||||
[http]
|
||||
version = HTTP/1.1
|
||||
postBuffer = 5368709120
|
||||
[init]
|
||||
defaultBranch = master
|
||||
[core]
|
||||
autocrlf = false
|
||||
[pull]
|
||||
ff = only
|
||||
rebase = true
|
||||
[lfs]
|
||||
allowincompletepush = true
|
||||
locksverify = true
|
||||
[credential]
|
||||
autoDetectTimeout = -1
|
||||
helper = cache --timeout=2592000
|
3
.gitignore
vendored
3
.gitignore
vendored
@@ -1,3 +1,6 @@
|
||||
_del
|
||||
_test
|
||||
|
||||
04_poc
|
||||
**/*del
|
||||
**/*bak
|
||||
|
@@ -77,12 +77,12 @@ const Chat = () => {
|
||||
const [toastMessage, setToastMessage] = useState("");
|
||||
|
||||
// Refs
|
||||
const contentRef = useRef();
|
||||
const contentRef = useRef(null);
|
||||
const swiperRefs = useRef([]);
|
||||
const textareaRef = useRef();
|
||||
const sideRef = useRef();
|
||||
const sendRef = useRef();
|
||||
const replyToAnimationRef = useRef();
|
||||
const textareaRef = useRef(null);
|
||||
const sideRef = useRef(null);
|
||||
const sendRef = useRef(null);
|
||||
const replyToAnimationRef = useRef(null);
|
||||
|
||||
const actionSheetButtons = [
|
||||
{
|
||||
@@ -104,7 +104,7 @@ const Chat = () => {
|
||||
icon: alertOutline,
|
||||
handler: () =>
|
||||
toaster(
|
||||
"I haven't implemented unsend :) Simple store update though",
|
||||
"I haven't implemented unsend :) Simple store update though"
|
||||
),
|
||||
},
|
||||
{
|
||||
@@ -165,11 +165,11 @@ const Chat = () => {
|
||||
const chatMessageID = elementID.includes("chatText")
|
||||
? parseInt(elementID.replace("chatText_", ""))
|
||||
: elementID.includes("chatTime")
|
||||
? parseInt(elementID.replace("chatTime_", ""))
|
||||
: parseInt(elementID.replace("chatBubble_", ""));
|
||||
? parseInt(elementID.replace("chatTime_", ""))
|
||||
: parseInt(elementID.replace("chatBubble_", ""));
|
||||
|
||||
const chatMessage = chat.filter(
|
||||
(message) => parseInt(message.id) === parseInt(chatMessageID),
|
||||
(message) => parseInt(message.id) === parseInt(chatMessageID)
|
||||
)[0];
|
||||
|
||||
setActionMessage(chatMessage);
|
||||
@@ -278,7 +278,7 @@ const Chat = () => {
|
||||
replyToMessage,
|
||||
replyToMessage ? replyToMessage.id : false,
|
||||
image,
|
||||
imagePath,
|
||||
imagePath
|
||||
);
|
||||
setMessage("");
|
||||
|
||||
@@ -329,7 +329,7 @@ const Chat = () => {
|
||||
fill="clear"
|
||||
onClick={() =>
|
||||
toaster(
|
||||
"As this is a UI only, video calling wouldn't work here.",
|
||||
"As this is a UI only, video calling wouldn't work here."
|
||||
)
|
||||
}
|
||||
>
|
||||
@@ -352,7 +352,7 @@ const Chat = () => {
|
||||
{chat.map((message, index) => {
|
||||
const repliedMessage = chat.filter(
|
||||
(subMessage) =>
|
||||
parseInt(subMessage.id) === parseInt(message.replyID),
|
||||
parseInt(subMessage.id) === parseInt(message.replyID)
|
||||
)[0];
|
||||
|
||||
return (
|
||||
@@ -360,7 +360,9 @@ const Chat = () => {
|
||||
ref={(ref) => (swiperRefs.current[index] = ref)}
|
||||
id={`chatBubble_${message.id}`}
|
||||
key={index}
|
||||
className={`chat-bubble ${message.sent ? "bubble-sent" : "bubble-received"}`}
|
||||
className={`chat-bubble ${
|
||||
message.sent ? "bubble-sent" : "bubble-received"
|
||||
}`}
|
||||
{...longPressEvent}
|
||||
>
|
||||
<div id={`chatText_${message.id}`}>
|
||||
|
@@ -22,7 +22,7 @@ import { useRef } from "react";
|
||||
import ContactModal from "../components/ContactModal";
|
||||
|
||||
const Chats = () => {
|
||||
const pageRef = useRef();
|
||||
const pageRef = useRef(null);
|
||||
const contacts = ContactStore.useState(getContacts);
|
||||
const latestChats = ChatStore.useState(getChats);
|
||||
|
||||
@@ -43,7 +43,7 @@ const Chats = () => {
|
||||
contacts
|
||||
.filter((c) => c.id === chat.contact_id)[0]
|
||||
.name.toLowerCase()
|
||||
.includes(searchTermLower),
|
||||
.includes(searchTermLower)
|
||||
);
|
||||
setResults(newResults);
|
||||
} else {
|
||||
|
21
01_Requirements/REQ0119/index.md
Normal file
21
01_Requirements/REQ0119/index.md
Normal file
@@ -0,0 +1,21 @@
|
||||
---
|
||||
tags: mobile
|
||||
---
|
||||
|
||||
# REQ0119-Demo2FaExample
|
||||
|
||||
## description
|
||||
|
||||
A demonstration of two-factor authentication implementation examples
|
||||
|
||||
## schema
|
||||
|
||||
```dbml
|
||||
{
|
||||
// To be defined
|
||||
}
|
||||
```
|
||||
|
||||
## related
|
||||
|
||||
-
|
21
01_Requirements/REQ0120/index.md
Normal file
21
01_Requirements/REQ0120/index.md
Normal file
@@ -0,0 +1,21 @@
|
||||
---
|
||||
tags:
|
||||
---
|
||||
|
||||
# REQ0120-PlaceholderFeature
|
||||
|
||||
## description
|
||||
|
||||
T.B.A.
|
||||
|
||||
## schema
|
||||
|
||||
```dbml
|
||||
{
|
||||
// To be defined
|
||||
}
|
||||
```
|
||||
|
||||
## related
|
||||
|
||||
-
|
21
01_Requirements/REQ0121/index.md
Normal file
21
01_Requirements/REQ0121/index.md
Normal file
@@ -0,0 +1,21 @@
|
||||
---
|
||||
tags:
|
||||
---
|
||||
|
||||
# REQ0121-UserProfileFeature
|
||||
|
||||
## description
|
||||
|
||||
T.B.A.
|
||||
|
||||
## schema
|
||||
|
||||
```dbml
|
||||
{
|
||||
// To be defined
|
||||
}
|
||||
```
|
||||
|
||||
## related
|
||||
|
||||
-
|
21
01_Requirements/REQ0122/index.md
Normal file
21
01_Requirements/REQ0122/index.md
Normal file
@@ -0,0 +1,21 @@
|
||||
---
|
||||
tags:
|
||||
---
|
||||
|
||||
# REQ0122-NotificationSystem
|
||||
|
||||
## description
|
||||
|
||||
T.B.A.
|
||||
|
||||
## schema
|
||||
|
||||
```dbml
|
||||
{
|
||||
// To be defined
|
||||
}
|
||||
```
|
||||
|
||||
## related
|
||||
|
||||
-
|
21
01_Requirements/REQ0123/index.md
Normal file
21
01_Requirements/REQ0123/index.md
Normal file
@@ -0,0 +1,21 @@
|
||||
---
|
||||
tags:
|
||||
---
|
||||
|
||||
# REQ0123-AnalyticsDashboard
|
||||
|
||||
## description
|
||||
|
||||
T.B.A.
|
||||
|
||||
## schema
|
||||
|
||||
```dbml
|
||||
{
|
||||
// To be defined
|
||||
}
|
||||
```
|
||||
|
||||
## related
|
||||
|
||||
-
|
22
01_Requirements/REQ0124/index.md
Normal file
22
01_Requirements/REQ0124/index.md
Normal file
@@ -0,0 +1,22 @@
|
||||
---
|
||||
tags: [placeholder-tag1, placeholder-tag2]
|
||||
---
|
||||
|
||||
# REQ0124-PlaceholderTitle
|
||||
|
||||
## description
|
||||
|
||||

|
||||
|
||||
## schema
|
||||
|
||||
```dbml
|
||||
{
|
||||
placeholderField1: Type;
|
||||
placeholderField2: Type;
|
||||
}
|
||||
```
|
||||
|
||||
## related
|
||||
|
||||
[[REQXXXX]]
|
22
01_Requirements/REQ0125/index.md
Normal file
22
01_Requirements/REQ0125/index.md
Normal file
@@ -0,0 +1,22 @@
|
||||
---
|
||||
tags: [placeholder-tag1, placeholder-tag2]
|
||||
---
|
||||
|
||||
# REQ0125-PlaceholderTitle
|
||||
|
||||
## description
|
||||
|
||||

|
||||
|
||||
## schema
|
||||
|
||||
```dbml
|
||||
{
|
||||
placeholderField1: Type;
|
||||
placeholderField2: Type;
|
||||
}
|
||||
```
|
||||
|
||||
## related
|
||||
|
||||
[[REQXXXX]]
|
22
01_Requirements/REQ0126/index.md
Normal file
22
01_Requirements/REQ0126/index.md
Normal file
@@ -0,0 +1,22 @@
|
||||
---
|
||||
tags: [placeholder-tag1, placeholder-tag2]
|
||||
---
|
||||
|
||||
# REQ0126-PlaceholderTitle
|
||||
|
||||
## description
|
||||
|
||||

|
||||
|
||||
## schema
|
||||
|
||||
```dbml
|
||||
{
|
||||
placeholderField1: Type;
|
||||
placeholderField2: Type;
|
||||
}
|
||||
```
|
||||
|
||||
## related
|
||||
|
||||
[[REQXXXX]]
|
22
01_Requirements/REQ0127/index.md
Normal file
22
01_Requirements/REQ0127/index.md
Normal file
@@ -0,0 +1,22 @@
|
||||
---
|
||||
tags: [placeholder-tag1, placeholder-tag2]
|
||||
---
|
||||
|
||||
# REQ0127-PlaceholderTitle
|
||||
|
||||
## description
|
||||
|
||||

|
||||
|
||||
## schema
|
||||
|
||||
```dbml
|
||||
{
|
||||
placeholderField1: Type;
|
||||
placeholderField2: Type;
|
||||
}
|
||||
```
|
||||
|
||||
## related
|
||||
|
||||
[[REQXXXX]]
|
22
01_Requirements/REQ0128/index.md
Normal file
22
01_Requirements/REQ0128/index.md
Normal file
@@ -0,0 +1,22 @@
|
||||
---
|
||||
tags: [placeholder-tag1, placeholder-tag2]
|
||||
---
|
||||
|
||||
# REQ0128-PlaceholderTitle
|
||||
|
||||
## description
|
||||
|
||||

|
||||
|
||||
## schema
|
||||
|
||||
```dbml
|
||||
{
|
||||
placeholderField1: Type;
|
||||
placeholderField2: Type;
|
||||
}
|
||||
```
|
||||
|
||||
## related
|
||||
|
||||
[[REQXXXX]]
|
22
01_Requirements/REQ0129/index.md
Normal file
22
01_Requirements/REQ0129/index.md
Normal file
@@ -0,0 +1,22 @@
|
||||
---
|
||||
tags: [placeholder-tag1, placeholder-tag2]
|
||||
---
|
||||
|
||||
# REQ0129-PlaceholderTitle
|
||||
|
||||
## description
|
||||
|
||||

|
||||
|
||||
## schema
|
||||
|
||||
```dbml
|
||||
{
|
||||
placeholderField1: Type;
|
||||
placeholderField2: Type;
|
||||
}
|
||||
```
|
||||
|
||||
## related
|
||||
|
||||
[[REQXXXX]]
|
22
01_Requirements/REQ0130/index.md
Normal file
22
01_Requirements/REQ0130/index.md
Normal file
@@ -0,0 +1,22 @@
|
||||
---
|
||||
tags: [placeholder-tag1, placeholder-tag2]
|
||||
---
|
||||
|
||||
# REQ0130-PlaceholderTitle
|
||||
|
||||
## description
|
||||
|
||||

|
||||
|
||||
## schema
|
||||
|
||||
```dbml
|
||||
{
|
||||
placeholderField1: Type;
|
||||
placeholderField2: Type;
|
||||
}
|
||||
```
|
||||
|
||||
## related
|
||||
|
||||
[[REQXXXX]]
|
22
01_Requirements/REQ0131/index.md
Normal file
22
01_Requirements/REQ0131/index.md
Normal file
@@ -0,0 +1,22 @@
|
||||
---
|
||||
tags: requirements
|
||||
---
|
||||
|
||||
# REQ0131-DemoInstagramClone
|
||||
|
||||
## description
|
||||
|
||||
<Party Page.png>
|
||||
|
||||
## schema
|
||||
|
||||
```dbml
|
||||
// Add your DBML here
|
||||
Table users {
|
||||
id integer
|
||||
}
|
||||
```
|
||||
|
||||
## related
|
||||
|
||||
[[REQ0110-PartyPage]]
|
23
01_Requirements/REQ0132/index.md
Normal file
23
01_Requirements/REQ0132/index.md
Normal file
@@ -0,0 +1,23 @@
|
||||
---
|
||||
tags: requirements
|
||||
---
|
||||
|
||||
# REQ0132-DemoKanbanBoard
|
||||
|
||||
## description
|
||||
|
||||
<Kanban Board.png>
|
||||
|
||||
## schema
|
||||
|
||||
```dbml
|
||||
// Add your DBML here
|
||||
Table tasks {
|
||||
id integer
|
||||
status string
|
||||
}
|
||||
```
|
||||
|
||||
## related
|
||||
|
||||
[[REQ0131-DemoInstagramClone]]
|
23
01_Requirements/REQ0133/index.md
Normal file
23
01_Requirements/REQ0133/index.md
Normal file
@@ -0,0 +1,23 @@
|
||||
---
|
||||
tags: requirements
|
||||
---
|
||||
|
||||
# REQ0133-DemoList
|
||||
|
||||
## description
|
||||
|
||||
<Demo List.png>
|
||||
|
||||
## schema
|
||||
|
||||
```dbml
|
||||
// Add your DBML here
|
||||
Table lists {
|
||||
id integer
|
||||
name string
|
||||
}
|
||||
```
|
||||
|
||||
## related
|
||||
|
||||
[[REQ0132-DemoKanbanBoard]]
|
23
01_Requirements/REQ0134/index.md
Normal file
23
01_Requirements/REQ0134/index.md
Normal file
@@ -0,0 +1,23 @@
|
||||
---
|
||||
tags: requirements
|
||||
---
|
||||
|
||||
# REQ0134-DemoOrderingApp
|
||||
|
||||
## description
|
||||
|
||||
<Ordering App.png>
|
||||
|
||||
## schema
|
||||
|
||||
```dbml
|
||||
// Add your DBML here
|
||||
Table orders {
|
||||
id integer
|
||||
item string
|
||||
}
|
||||
```
|
||||
|
||||
## related
|
||||
|
||||
[]
|
24
01_Requirements/REQ0135/index.md
Normal file
24
01_Requirements/REQ0135/index.md
Normal file
@@ -0,0 +1,24 @@
|
||||
---
|
||||
tags: requirements
|
||||
---
|
||||
|
||||
# REQ0135-DemoPinterestFloatingTabBar
|
||||
|
||||
## description
|
||||
|
||||
<Pinterest Floating Tab Bar.png>
|
||||
|
||||
## schema
|
||||
|
||||
```dbml
|
||||
// Add your DBML here
|
||||
Table floating_tab_bars {
|
||||
id integer
|
||||
position string
|
||||
items json
|
||||
}
|
||||
```
|
||||
|
||||
## related
|
||||
|
||||
[[REQ0134-DemoList]]
|
24
01_Requirements/REQ0136/index.md
Normal file
24
01_Requirements/REQ0136/index.md
Normal file
@@ -0,0 +1,24 @@
|
||||
---
|
||||
tags: requirements
|
||||
---
|
||||
|
||||
# REQ0136-DemoProfileExample
|
||||
|
||||
## description
|
||||
|
||||
<Profile Example.png>
|
||||
|
||||
## schema
|
||||
|
||||
```dbml
|
||||
// Add your DBML here
|
||||
Table profiles {
|
||||
id integer
|
||||
name string
|
||||
avatar_url string
|
||||
}
|
||||
```
|
||||
|
||||
## related
|
||||
|
||||
[[REQ0135-DemoPinterestFloatingTabBar]]
|
24
01_Requirements/REQ0137/index.md
Normal file
24
01_Requirements/REQ0137/index.md
Normal file
@@ -0,0 +1,24 @@
|
||||
---
|
||||
tags: [requirements]
|
||||
---
|
||||
|
||||
# REQ0137-DemoPullstateTutorial
|
||||
|
||||
## Description
|
||||
|
||||

|
||||
|
||||
## Schema
|
||||
|
||||
```dbml
|
||||
// Add your DBML here
|
||||
Table pullstates {
|
||||
id integer
|
||||
state json
|
||||
timestamp datetime
|
||||
}
|
||||
```
|
||||
|
||||
## Related
|
||||
|
||||
- [REQ0136-DemoProfileExample](#)
|
24
01_Requirements/REQ0138/index.md
Normal file
24
01_Requirements/REQ0138/index.md
Normal file
@@ -0,0 +1,24 @@
|
||||
---
|
||||
tags: [requirements]
|
||||
---
|
||||
|
||||
# REQ0138-DemoQrScanner
|
||||
|
||||
## Description
|
||||
|
||||

|
||||
|
||||
## Schema
|
||||
|
||||
```dbml
|
||||
// Add your DBML here
|
||||
Table qr_scanners {
|
||||
id integer
|
||||
scan_data string
|
||||
scan_time datetime
|
||||
}
|
||||
```
|
||||
|
||||
## Related
|
||||
|
||||
- [REQ0137-DemoPullstateTutorial](#)
|
24
01_Requirements/REQ0139/index.md
Normal file
24
01_Requirements/REQ0139/index.md
Normal file
@@ -0,0 +1,24 @@
|
||||
---
|
||||
tags: [requirements]
|
||||
---
|
||||
|
||||
# REQ0139-DemoQuizApp
|
||||
|
||||
## Description
|
||||
|
||||

|
||||
|
||||
## Schema
|
||||
|
||||
```dbml
|
||||
// Add your DBML here
|
||||
Table quizzes {
|
||||
id integer
|
||||
questions json
|
||||
results json
|
||||
}
|
||||
```
|
||||
|
||||
## Related
|
||||
|
||||
- [REQ0138-DemoQrScanner](#)
|
25
01_Requirements/REQ0140/index.md
Normal file
25
01_Requirements/REQ0140/index.md
Normal file
@@ -0,0 +1,25 @@
|
||||
---
|
||||
tags: [requirements]
|
||||
---
|
||||
|
||||
# REQ0140-DemoQuoteApp
|
||||
|
||||
## Description
|
||||
|
||||

|
||||
|
||||
## Schema
|
||||
|
||||
```dbml
|
||||
// Add your DBML here
|
||||
Table quotes {
|
||||
id integer
|
||||
content string
|
||||
author string
|
||||
category string
|
||||
}
|
||||
```
|
||||
|
||||
## Related
|
||||
|
||||
- [REQ0139-DemoQuizApp](#)
|
25
01_Requirements/REQ0141/index.md
Normal file
25
01_Requirements/REQ0141/index.md
Normal file
@@ -0,0 +1,25 @@
|
||||
---
|
||||
tags: [requirements]
|
||||
---
|
||||
|
||||
# REQ0141-DemoReactAddToCart
|
||||
|
||||
## Description
|
||||
|
||||

|
||||
|
||||
## Schema
|
||||
|
||||
```dbml
|
||||
// Add your DBML here
|
||||
Table cart_items {
|
||||
id integer
|
||||
product_id integer
|
||||
quantity integer
|
||||
user_id integer
|
||||
}
|
||||
```
|
||||
|
||||
## Related
|
||||
|
||||
- [REQ0140-DemoQuoteApp](#)
|
25
01_Requirements/REQ0142/index.md
Normal file
25
01_Requirements/REQ0142/index.md
Normal file
@@ -0,0 +1,25 @@
|
||||
---
|
||||
tags: [requirements]
|
||||
---
|
||||
|
||||
# REQ0142-DemoReactCalculator
|
||||
|
||||
## Description
|
||||
|
||||

|
||||
|
||||
## Schema
|
||||
|
||||
```dbml
|
||||
// Add your DBML here
|
||||
Table calculations {
|
||||
id integer
|
||||
expression string
|
||||
result float
|
||||
timestamp datetime
|
||||
}
|
||||
```
|
||||
|
||||
## Related
|
||||
|
||||
- [REQ0141-DemoReactAddToCart](#)
|
25
01_Requirements/REQ0143/index.md
Normal file
25
01_Requirements/REQ0143/index.md
Normal file
@@ -0,0 +1,25 @@
|
||||
---
|
||||
tags: [requirements]
|
||||
---
|
||||
|
||||
# REQ0143-DemoReactDrawingCanvas
|
||||
|
||||
## Description
|
||||
|
||||

|
||||
|
||||
## Schema
|
||||
|
||||
```dbml
|
||||
// Add your DBML here
|
||||
Table drawings {
|
||||
id integer
|
||||
canvas_data json
|
||||
created_at datetime
|
||||
updated_at datetime
|
||||
}
|
||||
```
|
||||
|
||||
## Related
|
||||
|
||||
- [REQ0142-DemoReactCalculator](#)
|
25
01_Requirements/REQ0144/index.md
Normal file
25
01_Requirements/REQ0144/index.md
Normal file
@@ -0,0 +1,25 @@
|
||||
---
|
||||
tags: [requirements]
|
||||
---
|
||||
|
||||
# REQ0144-DemoReactHookFormExample
|
||||
|
||||
## Description
|
||||
|
||||

|
||||
|
||||
## Schema
|
||||
|
||||
```dbml
|
||||
// Add your DBML here
|
||||
Table forms {
|
||||
id integer
|
||||
form_data json
|
||||
submitted_at datetime
|
||||
user_id integer
|
||||
}
|
||||
```
|
||||
|
||||
## Related
|
||||
|
||||
- [REQ0143-DemoReactDrawingCanvas](#)
|
26
01_Requirements/REQ0145/index.md
Normal file
26
01_Requirements/REQ0145/index.md
Normal file
@@ -0,0 +1,26 @@
|
||||
---
|
||||
tags: [requirements]
|
||||
---
|
||||
|
||||
# REQ0145-DemoReactItemList
|
||||
|
||||
## Description
|
||||
|
||||

|
||||
|
||||
## Schema
|
||||
|
||||
```dbml
|
||||
// Add your DBML here
|
||||
Table items {
|
||||
id integer
|
||||
name string
|
||||
description text
|
||||
price decimal
|
||||
created_at datetime
|
||||
}
|
||||
```
|
||||
|
||||
## Related
|
||||
|
||||
- [REQ0144-DemoReactHookFormExample](#)
|
26
01_Requirements/REQ0146/index.md
Normal file
26
01_Requirements/REQ0146/index.md
Normal file
@@ -0,0 +1,26 @@
|
||||
---
|
||||
tags: [requirements]
|
||||
---
|
||||
|
||||
# REQ0146-DemoReactLifecycles
|
||||
|
||||
## Description
|
||||
|
||||

|
||||
|
||||
## Schema
|
||||
|
||||
```dbml
|
||||
// Add your DBML here
|
||||
Table components {
|
||||
id integer
|
||||
name string
|
||||
lifecycle_stage string
|
||||
mounted_at datetime
|
||||
updated_at datetime
|
||||
}
|
||||
```
|
||||
|
||||
## Related
|
||||
|
||||
- [REQ0145-DemoReactItemList](#)
|
26
01_Requirements/REQ0147/index.md
Normal file
26
01_Requirements/REQ0147/index.md
Normal file
@@ -0,0 +1,26 @@
|
||||
---
|
||||
tags: [requirements]
|
||||
---
|
||||
|
||||
# REQ0147-DemoReactLogin
|
||||
|
||||
## Description
|
||||
|
||||

|
||||
|
||||
## Schema
|
||||
|
||||
```dbml
|
||||
// Add your DBML here
|
||||
Table users {
|
||||
id integer
|
||||
username string
|
||||
password_hash string
|
||||
last_login_at datetime
|
||||
login_count integer
|
||||
}
|
||||
```
|
||||
|
||||
## Related
|
||||
|
||||
- [REQ0146-DemoReactLifecycles](#)
|
26
01_Requirements/REQ0148/index.md
Normal file
26
01_Requirements/REQ0148/index.md
Normal file
@@ -0,0 +1,26 @@
|
||||
---
|
||||
tags: [requirements]
|
||||
---
|
||||
|
||||
# REQ0148-DemoReactMarvelApp
|
||||
|
||||
## Description
|
||||
|
||||

|
||||
|
||||
## Schema
|
||||
|
||||
```dbml
|
||||
// Add your DBML here
|
||||
Table characters {
|
||||
id integer
|
||||
name string
|
||||
description text
|
||||
thumbnail_url string
|
||||
comics_available integer
|
||||
}
|
||||
```
|
||||
|
||||
## Related
|
||||
|
||||
- [REQ0147-DemoReactLogin](#)
|
27
01_Requirements/REQ0149/index.md
Normal file
27
01_Requirements/REQ0149/index.md
Normal file
@@ -0,0 +1,27 @@
|
||||
---
|
||||
tags: [requirements]
|
||||
---
|
||||
|
||||
# REQ0149-DemoReactMovieAppWithAlgolia
|
||||
|
||||
## Description
|
||||
|
||||

|
||||
|
||||
## Schema
|
||||
|
||||
```dbml
|
||||
// Add your DBML here
|
||||
Table movies {
|
||||
id integer
|
||||
title string
|
||||
year integer
|
||||
rating decimal
|
||||
search_index string
|
||||
last_updated datetime
|
||||
}
|
||||
```
|
||||
|
||||
## Related
|
||||
|
||||
- [REQ0148-DemoReactMarvelApp](#)
|
27
01_Requirements/REQ0150/index.md
Normal file
27
01_Requirements/REQ0150/index.md
Normal file
@@ -0,0 +1,27 @@
|
||||
---
|
||||
tags: [requirements]
|
||||
---
|
||||
|
||||
# REQ0150-DemoReactNotes
|
||||
|
||||
## Description
|
||||
|
||||

|
||||
|
||||
## Schema
|
||||
|
||||
```dbml
|
||||
// Add your DBML here
|
||||
Table notes {
|
||||
id integer
|
||||
title string
|
||||
content text
|
||||
created_at datetime
|
||||
updated_at datetime
|
||||
is_pinned boolean
|
||||
}
|
||||
```
|
||||
|
||||
## Related
|
||||
|
||||
- [REQ0149-DemoReactMovieAppWithAlgolia](#)
|
27
01_Requirements/REQ0151/index.md
Normal file
27
01_Requirements/REQ0151/index.md
Normal file
@@ -0,0 +1,27 @@
|
||||
---
|
||||
tags: [requirements]
|
||||
---
|
||||
|
||||
# REQ0151-DemoReactOnboardingUi
|
||||
|
||||
## Description
|
||||
|
||||

|
||||
|
||||
## Schema
|
||||
|
||||
```dbml
|
||||
// Add your DBML here
|
||||
Table onboarding_steps {
|
||||
id integer
|
||||
title string
|
||||
description text
|
||||
is_completed boolean
|
||||
order_number integer
|
||||
component_name string
|
||||
}
|
||||
```
|
||||
|
||||
## Related
|
||||
|
||||
- [REQ0150-DemoReactNotes](#)
|
26
01_Requirements/REQ0152/index.md
Normal file
26
01_Requirements/REQ0152/index.md
Normal file
@@ -0,0 +1,26 @@
|
||||
---
|
||||
tags: [requirements]
|
||||
---
|
||||
|
||||
# REQ0152-DemoReactOverlayHooks
|
||||
|
||||
## Description
|
||||
|
||||

|
||||
|
||||
## Schema
|
||||
|
||||
```dbml
|
||||
// Add your DBML here
|
||||
Table overlays {
|
||||
id integer
|
||||
component_name string
|
||||
is_visible boolean
|
||||
z_index integer
|
||||
animation_type string
|
||||
}
|
||||
```
|
||||
|
||||
## Related
|
||||
|
||||
- [REQ0151-DemoReactOnboardingUi](#)
|
10
01_Requirements/REQ0153/index.md
Normal file
10
01_Requirements/REQ0153/index.md
Normal file
@@ -0,0 +1,10 @@
|
||||
---
|
||||
tags: [requirements]
|
||||
---
|
||||
|
||||
# REQ0153-DemoReactPollApp
|
||||
|
||||
## Description
|
||||

|
||||
|
||||
## Schema
|
1
01_Requirements/REQ0154/index.md
Normal file
1
01_Requirements/REQ0154/index.md
Normal file
@@ -0,0 +1 @@
|
||||
# DemoReactProfileDashboardUi
|
1
01_Requirements/REQ0155/index.md
Normal file
1
01_Requirements/REQ0155/index.md
Normal file
@@ -0,0 +1 @@
|
||||
# DemoReactQuotes
|
1
01_Requirements/REQ0156/index.md
Normal file
1
01_Requirements/REQ0156/index.md
Normal file
@@ -0,0 +1 @@
|
||||
# DemoReactShop
|
1
01_Requirements/REQ0157/index.md
Normal file
1
01_Requirements/REQ0157/index.md
Normal file
@@ -0,0 +1 @@
|
||||
# DemoReactShopUi
|
1
01_Requirements/REQ0158/index.md
Normal file
1
01_Requirements/REQ0158/index.md
Normal file
@@ -0,0 +1 @@
|
||||
# DemoReactSwitchTabs
|
1
01_Requirements/REQ0159/index.md
Normal file
1
01_Requirements/REQ0159/index.md
Normal file
@@ -0,0 +1 @@
|
||||
# DemoReactTabsMenusCustom
|
1
01_Requirements/REQ0160/index.md
Normal file
1
01_Requirements/REQ0160/index.md
Normal file
@@ -0,0 +1 @@
|
||||
# DemoReactThemeSwitcher
|
1
01_Requirements/REQ0161/index.md
Normal file
1
01_Requirements/REQ0161/index.md
Normal file
@@ -0,0 +1 @@
|
||||
# DemoReactTravelApp
|
1
01_Requirements/REQ0162/index.md
Normal file
1
01_Requirements/REQ0162/index.md
Normal file
@@ -0,0 +1 @@
|
||||
# DemoRecipeApp
|
1
01_Requirements/REQ0163/index.md
Normal file
1
01_Requirements/REQ0163/index.md
Normal file
@@ -0,0 +1 @@
|
||||
# DemoRestaurantFinder
|
1
01_Requirements/REQ0164/index.md
Normal file
1
01_Requirements/REQ0164/index.md
Normal file
@@ -0,0 +1 @@
|
||||
# DemoScoreBoard
|
1
01_Requirements/REQ0165/index.md
Normal file
1
01_Requirements/REQ0165/index.md
Normal file
@@ -0,0 +1 @@
|
||||
# DemoShopAppUi
|
1
01_Requirements/REQ0166/index.md
Normal file
1
01_Requirements/REQ0166/index.md
Normal file
@@ -0,0 +1 @@
|
||||
# DemoSkeletonText
|
1
01_Requirements/REQ0167/index.md
Normal file
1
01_Requirements/REQ0167/index.md
Normal file
@@ -0,0 +1 @@
|
||||
# DemoSlidingProfile
|
1
01_Requirements/REQ0168/index.md
Normal file
1
01_Requirements/REQ0168/index.md
Normal file
@@ -0,0 +1 @@
|
||||
# DemoStickyBottomSheetExample
|
1
01_Requirements/REQ0169/index.md
Normal file
1
01_Requirements/REQ0169/index.md
Normal file
@@ -0,0 +1 @@
|
||||
# DemoStorageExample
|
1
01_Requirements/REQ0170/index.md
Normal file
1
01_Requirements/REQ0170/index.md
Normal file
@@ -0,0 +1 @@
|
||||
# DemoWeatherAppUi
|
16
01_Requirements/REQ0180/index.md
Normal file
16
01_Requirements/REQ0180/index.md
Normal file
@@ -0,0 +1,16 @@
|
||||
---
|
||||
tags: docker, ports
|
||||
---
|
||||
|
||||
# REQ0180 service port schedule
|
||||
|
||||
## Port Usage
|
||||
|
||||
| Service | Host **Port** | Container Port | Environment | Purpose | subdomain |
|
||||
| ----------- | ------------- | -------------- | ----------- | -------------------------------- | ------------------------ |
|
||||
| Frontend | 10001 | 8080 | All | Web application access | pa_admin.louislabs.com |
|
||||
| Mobile | 10004 | 3000 | All | Mobile application access | pa_mobile.louislabs.com |
|
||||
| CMS Backend | 10002 | 7272 | All | Main API access | pa_backend.louislabs.com |
|
||||
| CMS Backend | 10003 | 5555 | All | Additional service access | --- |
|
||||
| Postgres | - | 5432 | Production | Database access (container only) | --- |
|
||||
| Postgres | 5432 | 5432 | Development | Database access | --- |
|
9
01_Requirements/REQ0181/index.md
Normal file
9
01_Requirements/REQ0181/index.md
Normal file
@@ -0,0 +1,9 @@
|
||||
---
|
||||
tags: frontend, side-menu
|
||||
---
|
||||
|
||||
# REQ0181 frontend side menu configuration
|
||||
|
||||
## sources
|
||||
|
||||
`src/layouts/nav-config-dashboard.tsx`
|
11
01_Requirements/REQ0182/index.md
Normal file
11
01_Requirements/REQ0182/index.md
Normal file
@@ -0,0 +1,11 @@
|
||||
---
|
||||
tags: frontend, product, details
|
||||
---
|
||||
|
||||
# REQ0182 frontend product details
|
||||
|
||||
frontend page to display product details
|
||||
|
||||
## sources
|
||||
|
||||
T.B.A.
|
15
01_Requirements/REQ0183/index.md
Normal file
15
01_Requirements/REQ0183/index.md
Normal file
@@ -0,0 +1,15 @@
|
||||
---
|
||||
tags: frontend, product, new
|
||||
---
|
||||
|
||||
# REQ0183 frontend product new
|
||||
|
||||
frontend page to create new product
|
||||
|
||||
## sources
|
||||
|
||||
T.B.A.
|
||||
|
||||
## branch
|
||||
|
||||
develop/requirements/REQ0183
|
17
01_Requirements/REQ0184/index.md
Normal file
17
01_Requirements/REQ0184/index.md
Normal file
@@ -0,0 +1,17 @@
|
||||
---
|
||||
tags: frontend, product, delete
|
||||
---
|
||||
|
||||
# REQ0184 frontend product delete
|
||||
|
||||
frontend page to delete product
|
||||
|
||||
list page
|
||||
|
||||
## sources
|
||||
|
||||
T.B.A.
|
||||
|
||||
## branch
|
||||
|
||||
develop/requirements/REQ0184
|
17
01_Requirements/REQ0185/index.md
Normal file
17
01_Requirements/REQ0185/index.md
Normal file
@@ -0,0 +1,17 @@
|
||||
---
|
||||
tags: frontend, product, update
|
||||
---
|
||||
|
||||
# REQ0185 frontend product update
|
||||
|
||||
frontend page to update product
|
||||
|
||||
edit page T.B.A.
|
||||
|
||||
## sources
|
||||
|
||||
T.B.A.
|
||||
|
||||
## branch
|
||||
|
||||
develop/requirements/REQ0185
|
@@ -105,3 +105,61 @@
|
||||
- [REQ0116: REQ0116/main-tab](./REQ0116/index.md)
|
||||
- [REQ0117: REQ0117/default-route](./REQ0117/index.md)
|
||||
- [REQ0118: REQ0118/Not-Implemented-page](./REQ0118/index.md)
|
||||
- [REQ0119: REQ0119-Demo2FaExample](./REQ0119/index.md)
|
||||
- [REQ0120: REQ0120-PlaceholderFeature](./REQ0120/index.md)
|
||||
- [REQ0121: REQ0121-UserProfileFeature](./REQ0121/index.md)
|
||||
- [REQ0122: REQ0122-NotificationSystem](./REQ0122/index.md)
|
||||
- [REQ0123: REQ0123-AnalyticsDashboard](./REQ0123/index.md)
|
||||
- [REQ0124: REQ0124-PlaceholderTitle](./REQ0124/index.md)
|
||||
- [REQ0125: REQ0125-PlaceholderTitle](./REQ0125/index.md)
|
||||
- [REQ0126: REQ0126-PlaceholderTitle](./REQ0126/index.md)
|
||||
- [REQ0127: REQ0127-PlaceholderTitle](./REQ0127/index.md)
|
||||
- [REQ0128: REQ0128-PlaceholderTitle](./REQ0128/index.md)
|
||||
- [REQ0129: REQ0129-PlaceholderTitle](./REQ0129/index.md)
|
||||
- [REQ0130: REQ0130-PlaceholderTitle](./REQ0130/index.md)
|
||||
- [REQ0131: REQ0131-DemoInstagramClone](./REQ0131/index.md)
|
||||
- [REQ0132: REQ0132-DemoKanbanBoard](./REQ0132/index.md)
|
||||
- [REQ0133: REQ0133-DemoList](./REQ0133/index.md)
|
||||
- [REQ0134: REQ0134-DemoOrderingApp](./REQ0134/index.md)
|
||||
- [REQ0135: REQ0135-DemoPinterestFloatingTabBar](./REQ0135/index.md)
|
||||
- [REQ0136: REQ0136-DemoProfileExample](./REQ0136/index.md)
|
||||
- [REQ0137: REQ0137-DemoPullstateTutorial](./REQ0137/index.md)
|
||||
- [REQ0138: REQ0138-DemoQrScanner](./REQ0138/index.md)
|
||||
- [REQ0139: REQ0139-DemoQuizApp](./REQ0139/index.md)
|
||||
- [REQ0140: REQ0140-DemoQuoteApp](./REQ0140/index.md)
|
||||
- [REQ0141: REQ0141-DemoReactAddToCart](./REQ0141/index.md)
|
||||
- [REQ0142: REQ0142-DemoReactCalculator](./REQ0142/index.md)
|
||||
- [REQ0143: REQ0143-DemoReactDrawingCanvas](./REQ0143/index.md)
|
||||
- [REQ0144: REQ0144-DemoReactHookFormExample](./REQ0144/index.md)
|
||||
- [REQ0145: REQ0145-DemoReactItemList](./REQ0145/index.md)
|
||||
- [REQ0146: REQ0146-DemoReactLifecycles](./REQ0146/index.md)
|
||||
- [REQ0147: REQ0147-DemoReactLogin](./REQ0147/index.md)
|
||||
- [REQ0148: REQ0148-DemoReactMarvelApp](./REQ0148/index.md)
|
||||
- [REQ0149: REQ0149-DemoReactMovieAppWithAlgolia](./REQ0149/index.md)
|
||||
- [REQ0150: REQ0150-DemoReactNotes](./REQ0150/index.md)
|
||||
- [REQ0151: REQ0151-DemoReactOnboardingUi](./REQ0151/index.md)
|
||||
- [REQ0152: REQ0152-DemoReactOverlayHooks](./REQ0152/index.md)
|
||||
- [REQ0153: REQ0153-DemoReactPollApp](./REQ0153/index.md)
|
||||
- [REQ0154: DemoReactProfileDashboardUi](./REQ0154/index.md)
|
||||
- [REQ0155: DemoReactQuotes](./REQ0155/index.md)
|
||||
- [REQ0156: DemoReactShop](./REQ0156/index.md)
|
||||
- [REQ0157: DemoReactShopUi](./REQ0157/index.md)
|
||||
- [REQ0158: DemoReactSwitchTabs](./REQ0158/index.md)
|
||||
- [REQ0159: DemoReactTabsMenusCustom](./REQ0159/index.md)
|
||||
- [REQ0160: DemoReactThemeSwitcher](./REQ0160/index.md)
|
||||
- [REQ0161: DemoReactTravelApp](./REQ0161/index.md)
|
||||
- [REQ0162: DemoRecipeApp](./REQ0162/index.md)
|
||||
- [REQ0163: DemoRestaurantFinder](./REQ0163/index.md)
|
||||
- [REQ0164: DemoScoreBoard](./REQ0164/index.md)
|
||||
- [REQ0165: DemoShopAppUi](./REQ0165/index.md)
|
||||
- [REQ0166: DemoSkeletonText](./REQ0166/index.md)
|
||||
- [REQ0167: DemoSlidingProfile](./REQ0167/index.md)
|
||||
- [REQ0168: DemoStickyBottomSheetExample](./REQ0168/index.md)
|
||||
- [REQ0169: DemoStorageExample](./REQ0169/index.md)
|
||||
- [REQ0170: DemoWeatherAppUi](./REQ0170/index.md)
|
||||
- [REQ0180: REQ0180 service port schedule](./REQ0180/index.md)
|
||||
- [REQ0181: REQ0181 frontend side menu configuration](./REQ0181/index.md)
|
||||
- [REQ0182: REQ0182 frontend product details](./REQ0182/index.md)
|
||||
- [REQ0183: REQ0183 frontend product new](./REQ0183/index.md)
|
||||
- [REQ0184: REQ0184 frontend product delete](./REQ0184/index.md)
|
||||
- [REQ0185: REQ0185 frontend product update](./REQ0185/index.md)
|
||||
|
@@ -1,4 +0,0 @@
|
||||
node_modules
|
||||
.git
|
||||
.gitignore
|
||||
.DS_Store
|
@@ -1,9 +0,0 @@
|
||||
root = true
|
||||
|
||||
[*]
|
||||
indent_style = space
|
||||
indent_size = 2
|
||||
end_of_line = lf
|
||||
charset = utf-8
|
||||
trim_trailing_whitespace = true
|
||||
insert_final_newline = true
|
@@ -1,25 +0,0 @@
|
||||
# Port number
|
||||
PORT=3000
|
||||
|
||||
# Postgres URL
|
||||
DATABASE_URL="postgresql://postgres:secret@localhost:5432/mydb?schema=public"
|
||||
|
||||
# JWT
|
||||
# JWT secret key
|
||||
JWT_SECRET=thisisasamplesecret
|
||||
# Number of minutes after which an access token expires
|
||||
JWT_ACCESS_EXPIRATION_MINUTES=30
|
||||
# Number of days after which a refresh token expires
|
||||
JWT_REFRESH_EXPIRATION_DAYS=30
|
||||
# Number of minutes after which a reset password token expires
|
||||
JWT_RESET_PASSWORD_EXPIRATION_MINUTES=10
|
||||
# Number of minutes after which a verify email token expires
|
||||
JWT_VERIFY_EMAIL_EXPIRATION_MINUTES=10
|
||||
|
||||
# SMTP configuration options for the email service
|
||||
# For testing, you can use a fake SMTP service like Ethereal: https://ethereal.email/create
|
||||
SMTP_HOST=email-server
|
||||
SMTP_PORT=587
|
||||
SMTP_USERNAME=email-server-username
|
||||
SMTP_PASSWORD=email-server-password
|
||||
EMAIL_FROM=support@yourapp.com
|
@@ -1,2 +0,0 @@
|
||||
node_modules
|
||||
bin
|
@@ -1,14 +0,0 @@
|
||||
{
|
||||
"parser": "@typescript-eslint/parser",
|
||||
"extends": [
|
||||
"plugin:@typescript-eslint/recommended",
|
||||
"plugin:prettier/recommended"
|
||||
],
|
||||
"parserOptions": {
|
||||
"ecmaVersion": 2018,
|
||||
"sourceType": "module"
|
||||
},
|
||||
"rules": {
|
||||
"@typescript-eslint/no-explicit-any": "off"
|
||||
}
|
||||
}
|
21
03_source/api_server.del/.gitignore
vendored
21
03_source/api_server.del/.gitignore
vendored
@@ -1,21 +0,0 @@
|
||||
# Dependencies
|
||||
node_modules
|
||||
|
||||
# yarn error logs
|
||||
yarn-error.log
|
||||
|
||||
# Environment varibales
|
||||
.env*
|
||||
!.env*.example
|
||||
|
||||
# Code coverage
|
||||
coverage
|
||||
|
||||
# misc
|
||||
.DS_Store
|
||||
|
||||
# Dev db data
|
||||
db
|
||||
|
||||
# TypeScript
|
||||
build
|
@@ -1,3 +0,0 @@
|
||||
{
|
||||
"*.ts": "eslint"
|
||||
}
|
@@ -1,7 +0,0 @@
|
||||
{
|
||||
"semi": true,
|
||||
"tabWidth": 2,
|
||||
"printWidth": 100,
|
||||
"singleQuote": true,
|
||||
"trailingComma": "none"
|
||||
}
|
@@ -1,5 +0,0 @@
|
||||
{
|
||||
"recommendations": [
|
||||
"prisma.prisma"
|
||||
]
|
||||
}
|
@@ -1,3 +0,0 @@
|
||||
{
|
||||
"python.formatting.provider": "yapf"
|
||||
}
|
@@ -1,61 +0,0 @@
|
||||
# Contributing to prisma-express-typescript-boilerplate
|
||||
|
||||
Thank you for your interest in contributing to the prisma-express-typescript-boilerplate project! Your contributions are valuable in making this project better for everyone. Before you start contributing, please take a moment to review the guidelines below.
|
||||
|
||||
## Getting Started
|
||||
|
||||
1. **Fork the Repository**: Start by forking the prisma-express-typescript-boilerplate repository to your own GitHub account. You can do this by clicking the "Fork" button on the repository page.
|
||||
|
||||
2. **Clone the Repository**: Clone your forked repository to your local machine using the following command:
|
||||
|
||||
```git clone https://github.com/your-username/prisma-express-typescript-boilerplate.git ```
|
||||
|
||||
|
||||
3. **Install Dependencies**: Navigate to the cloned repository directory and install the project dependencies by running:
|
||||
|
||||
```npm install```
|
||||
|
||||
|
||||
## Making Changes
|
||||
|
||||
1. **Create a Branch**: Create a new branch for your changes. Use a descriptive name that reflects the nature of your contribution. For example:
|
||||
|
||||
```git checkout -b my-contribution```
|
||||
|
||||
2. **Implement Your Changes**: Make the necessary modifications and improvements to the project. This could involve bug fixes, feature enhancements, documentation updates, or any other relevant changes.
|
||||
|
||||
3. **Test Your Changes**: Ensure that your modifications work as intended and don't introduce any regressions. Run the existing tests using:
|
||||
|
||||
```npm test```
|
||||
|
||||
If you're adding new features, consider writing tests to cover the new functionality.
|
||||
|
||||
4. **Commit Your Changes**: Once you're satisfied with your changes, commit them with a clear and descriptive commit message:
|
||||
|
||||
```git add .```
|
||||
|
||||
```git commit -m "Add my contribution```
|
||||
|
||||
|
||||
5. **Push Your Changes**: Push your changes to your forked repository:
|
||||
|
||||
|
||||
## Submitting a Pull Request
|
||||
|
||||
1. **Open a Pull Request**: Go to the main page of your forked repository on GitHub and switch to the branch you just pushed. Click on the "Compare & pull request" button next to the branch name.
|
||||
|
||||
2. **Provide a Description**: In the pull request description, clearly explain the purpose and details of your contribution. Reference any relevant issues or feature requests if applicable.
|
||||
|
||||
3. **Review Process**: The project maintainers will review your pull request, providing feedback or suggesting changes if necessary. Be open to discussion and iterate on your changes based on the feedback received.
|
||||
|
||||
4. **Merge Your Pull Request**: Once your pull request has been approved and passes the review process, it will be merged into the main repository. Congratulations on your successful contribution!
|
||||
|
||||
## Code of Conduct
|
||||
|
||||
Please note that the prisma-express-typescript-boilerplate project follows a Code of Conduct. Respectful and inclusive behavior is expected from all contributors. Familiarize yourself with the project's Code of Conduct to ensure a positive and welcoming environment for everyone.
|
||||
|
||||
## Getting Help
|
||||
|
||||
If you have any questions or need assistance during the contribution process, don't hesitate to reach out to the project maintainers by opening an issue on the repository. They will be happy to help you.
|
||||
|
||||
Thank you for your interest in contributing to the prisma-express-typescript-boilerplate project. Your contributions make a difference!
|
@@ -1,15 +0,0 @@
|
||||
FROM node:18-alpine3.16
|
||||
|
||||
RUN mkdir -p /usr/src/node-app && chown -R node:node /usr/src/node-app
|
||||
|
||||
WORKDIR /usr/src/node-app
|
||||
|
||||
COPY package.json yarn.lock ./
|
||||
|
||||
USER node
|
||||
|
||||
RUN yarn install --pure-lockfile
|
||||
|
||||
COPY --chown=node:node . .
|
||||
|
||||
EXPOSE 3000
|
@@ -1,21 +0,0 @@
|
||||
MIT License
|
||||
|
||||
Copyright (c) 2022 Antonio Lázaro
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
in the Software without restriction, including without limitation the rights
|
||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
copies of the Software, and to permit persons to whom the Software is
|
||||
furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in all
|
||||
copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
SOFTWARE.
|
@@ -1,370 +0,0 @@
|
||||
# RESTful API Node Server Boilerplate
|
||||
|
||||
A boilerplate/starter project for quickly building RESTful APIs using [Node.js](https://nodejs.org), [TypeScript](https://www.typescriptlang.org), [Express](https://expressjs.com), and [Prisma](https://www.prisma.io).
|
||||
|
||||
This project is an adaptation of the project [RESTful API Node Server Boilerplate](https://github.com/hagopj13/node-express-boilerplate) using a [PostgreSQL](https://www.postgresql.org) database with [Prisma](https://www.prisma.io) ORM. Many of the files are just an adaptation to [TypeScript](https://www.typescriptlang.org) from the files of the previously mentioned project.
|
||||
|
||||
## Quick Start
|
||||
|
||||
Clone the repo:
|
||||
|
||||
```bash
|
||||
git clone --depth 1 https://github.com/antonio-lazaro/prisma-express-typescript-boilerplate.git
|
||||
cd prisma-express-typescript-boilerplate
|
||||
npx rimraf ./.git
|
||||
```
|
||||
|
||||
Install the dependencies:
|
||||
|
||||
```bash
|
||||
yarn install
|
||||
```
|
||||
|
||||
Set the environment variables:
|
||||
|
||||
```bash
|
||||
cp .env.example .env
|
||||
|
||||
# open .env and modify the environment variables (if needed)
|
||||
```
|
||||
|
||||
## Table of Contents
|
||||
|
||||
- [RESTful API Node Server Boilerplate](#restful-api-node-server-boilerplate)
|
||||
- [Quick Start](#quick-start)
|
||||
- [Table of Contents](#table-of-contents)
|
||||
- [Features](#features)
|
||||
- [Commands](#commands)
|
||||
- [Environment Variables](#environment-variables)
|
||||
- [Project Structure](#project-structure)
|
||||
- [API Documentation](#api-documentation)
|
||||
- [API Endpoints](#api-endpoints)
|
||||
- [Error Handling](#error-handling)
|
||||
- [Validation](#validation)
|
||||
- [Authentication](#authentication)
|
||||
- [Authorization](#authorization)
|
||||
- [Logging](#logging)
|
||||
- [Linting](#linting)
|
||||
- [Contributing](#contributing)
|
||||
- [Inspirations](#inspirations)
|
||||
- [License](#license)
|
||||
|
||||
## Features
|
||||
|
||||
- **SQL database**: [PostgreSQL](https://www.postgresql.org) object data modeling using [Prisma](https://www.prisma.io) ORM
|
||||
- **Authentication and authorization**: using [passport](http://www.passportjs.org)
|
||||
- **Validation**: request data validation using [Joi](https://joi.dev)
|
||||
- **Logging**: using [winston](https://github.com/winstonjs/winston) and [morgan](https://github.com/expressjs/morgan)
|
||||
- `future` **Testing**: unit and integration tests using [Jest](https://jestjs.io)
|
||||
- **Error handling**: centralized error handling mechanism
|
||||
- **API documentation**: with [swagger-jsdoc](https://github.com/Surnet/swagger-jsdoc) and [swagger-ui-express](https://github.com/scottie1984/swagger-ui-express)
|
||||
- **Process management**: advanced production process management using [PM2](https://pm2.keymetrics.io)
|
||||
- **Dependency management**: with [Yarn](https://yarnpkg.com)
|
||||
- **Environment variables**: using [dotenv](https://github.com/motdotla/dotenv) and [cross-env](https://github.com/kentcdodds/cross-env#readme)
|
||||
- **Security**: set security HTTP headers using [helmet](https://helmetjs.github.io)
|
||||
- **Santizing**: sanitize request data against xss and query injection
|
||||
- **CORS**: Cross-Origin Resource-Sharing enabled using [cors](https://github.com/expressjs/cors)
|
||||
- **Compression**: gzip compression with [compression](https://github.com/expressjs/compression)
|
||||
- **Docker support**
|
||||
- **Code coverage**: using [coveralls](https://coveralls.io)
|
||||
- **Code quality**: with [Codacy](https://www.codacy.com)
|
||||
- **Git hooks**: with [Husky](https://github.com/typicode/husky) and [lint-staged](https://github.com/okonet/lint-staged)
|
||||
- **Linting**: with [ESLint](https://eslint.org) and [Prettier](https://prettier.io)
|
||||
- **Editor config**: consistent editor configuration using [EditorConfig](https://editorconfig.org)
|
||||
|
||||
## Commands
|
||||
|
||||
Running locally:
|
||||
|
||||
```bash
|
||||
yarn dev
|
||||
```
|
||||
|
||||
Running in production:
|
||||
|
||||
```bash
|
||||
yarn start
|
||||
```
|
||||
|
||||
Testing:
|
||||
|
||||
```bash
|
||||
# run all tests
|
||||
yarn test
|
||||
|
||||
# run all tests in watch mode
|
||||
yarn test:watch
|
||||
|
||||
# run test coverage
|
||||
yarn coverage
|
||||
```
|
||||
|
||||
Database:
|
||||
|
||||
```bash
|
||||
# push changes to db
|
||||
yarn db:push
|
||||
|
||||
# start prisma studio
|
||||
yarn db:studio
|
||||
```
|
||||
|
||||
Docker:
|
||||
|
||||
```bash
|
||||
# run docker container in development mode
|
||||
yarn docker:dev
|
||||
|
||||
# run docker container in production mode
|
||||
yarn docker:prod
|
||||
|
||||
# run all tests in a docker container
|
||||
yarn docker:test
|
||||
|
||||
# run docker container with PostgreSQL db
|
||||
yarn docker:dev-db:start
|
||||
|
||||
# stop docker container with PostgreSQL db
|
||||
yarn docker:dev-db:stop
|
||||
```
|
||||
|
||||
Linting:
|
||||
|
||||
```bash
|
||||
# run ESLint
|
||||
yarn lint
|
||||
|
||||
# fix ESLint errors
|
||||
yarn lint:fix
|
||||
|
||||
# run prettier
|
||||
yarn prettier
|
||||
|
||||
# fix prettier errors
|
||||
yarn prettier:fix
|
||||
```
|
||||
|
||||
## Environment Variables
|
||||
|
||||
The environment variables can be found and modified in the `.env` file. They come with these default values:
|
||||
|
||||
```bash
|
||||
# Port number
|
||||
PORT=3000
|
||||
|
||||
# URL of the PostgreSQL database
|
||||
DATABASE_URL=postgresql://postgres:secret@localhost:5432/mydb?schema=public
|
||||
|
||||
# JWT
|
||||
# JWT secret key
|
||||
JWT_SECRET=thisisasamplesecret
|
||||
# Number of minutes after which an access token expires
|
||||
JWT_ACCESS_EXPIRATION_MINUTES=30
|
||||
# Number of days after which a refresh token expires
|
||||
JWT_REFRESH_EXPIRATION_DAYS=30
|
||||
|
||||
# SMTP configuration options for the email service
|
||||
# For testing, you can use a fake SMTP service like Ethereal: https://ethereal.email/create
|
||||
SMTP_HOST=email-server
|
||||
SMTP_PORT=587
|
||||
SMTP_USERNAME=email-server-username
|
||||
SMTP_PASSWORD=email-server-password
|
||||
EMAIL_FROM=support@yourapp.com
|
||||
```
|
||||
|
||||
## Project Structure
|
||||
|
||||
```
|
||||
src\
|
||||
|--config\ # Environment variables and configuration related things
|
||||
|--controllers\ # Route controllers (controller layer)
|
||||
|--docs\ # Swagger files
|
||||
|--middlewares\ # Custom express middlewares
|
||||
|--routes\ # Routes
|
||||
|--services\ # Business logic (service layer)
|
||||
|--utils\ # Utility classes and functions
|
||||
|--validations\ # Request data validation schemas
|
||||
|--app.js # Express app
|
||||
|--index.js # App entry point
|
||||
```
|
||||
|
||||
## API Documentation
|
||||
|
||||
To view the list of available APIs and their specifications, run the server and go to `http://localhost:3000/v1/docs` in your browser. This documentation page is automatically generated using the [swagger](https://swagger.io/) definitions written as comments in the route files.
|
||||
|
||||
### API Endpoints
|
||||
|
||||
List of available routes:
|
||||
|
||||
**Auth routes**:\
|
||||
`POST /v1/auth/register` - register\
|
||||
`POST /v1/auth/login` - login\
|
||||
`POST /v1/auth/refresh-tokens` - refresh auth tokens\
|
||||
`POST /v1/auth/forgot-password` - send reset password email\
|
||||
`POST /v1/auth/reset-password` - reset password\
|
||||
`POST /v1/auth/send-verification-email` - send verification email\
|
||||
`POST /v1/auth/verify-email` - verify email
|
||||
|
||||
**User routes**:\
|
||||
`POST /v1/users` - create a user\
|
||||
`GET /v1/users` - get all users\
|
||||
`GET /v1/users/:userId` - get user\
|
||||
`PATCH /v1/users/:userId` - update user\
|
||||
`DELETE /v1/users/:userId` - delete user
|
||||
|
||||
## Error Handling
|
||||
|
||||
The app has a centralized error handling mechanism.
|
||||
|
||||
Controllers should try to catch the errors and forward them to the error handling middleware (by calling `next(error)`). For convenience, you can also wrap the controller inside the catchAsync utility wrapper, which forwards the error.
|
||||
|
||||
```javascript
|
||||
const catchAsync = require('../utils/catchAsync');
|
||||
|
||||
const controller = catchAsync(async (req, res) => {
|
||||
// this error will be forwarded to the error handling middleware
|
||||
throw new Error('Something wrong happened');
|
||||
});
|
||||
```
|
||||
|
||||
The error handling middleware sends an error response, which has the following format:
|
||||
|
||||
```json
|
||||
{
|
||||
"code": 404,
|
||||
"message": "Not found"
|
||||
}
|
||||
```
|
||||
|
||||
When running in development mode, the error response also contains the error stack.
|
||||
|
||||
The app has a utility ApiError class to which you can attach a response code and a message, and then throw it from anywhere (catchAsync will catch it).
|
||||
|
||||
For example, if you are trying to get a user from the DB who is not found, and you want to send a 404 error, the code should look something like:
|
||||
|
||||
```javascript
|
||||
const httpStatus = require('http-status');
|
||||
const ApiError = require('../utils/ApiError');
|
||||
const User = require('../models/User');
|
||||
|
||||
const getUser = async (userId) => {
|
||||
const user = await User.findById(userId);
|
||||
if (!user) {
|
||||
throw new ApiError(httpStatus.NOT_FOUND, 'User not found');
|
||||
}
|
||||
};
|
||||
```
|
||||
|
||||
## Validation
|
||||
|
||||
Request data is validated using [Joi](https://joi.dev/). Check the [documentation](https://joi.dev/api/) for more details on how to write Joi validation schemas.
|
||||
|
||||
The validation schemas are defined in the `src/validations` directory and are used in the routes by providing them as parameters to the `validate` middleware.
|
||||
|
||||
```javascript
|
||||
const express = require('express');
|
||||
const validate = require('../../middlewares/validate');
|
||||
const userValidation = require('../../validations/user.validation');
|
||||
const userController = require('../../controllers/user.controller');
|
||||
|
||||
const router = express.Router();
|
||||
|
||||
router.post('/users', validate(userValidation.createUser), userController.createUser);
|
||||
```
|
||||
|
||||
## Authentication
|
||||
|
||||
To require authentication for certain routes, you can use the `auth` middleware.
|
||||
|
||||
```javascript
|
||||
const express = require('express');
|
||||
const auth = require('../../middlewares/auth');
|
||||
const userController = require('../../controllers/user.controller');
|
||||
|
||||
const router = express.Router();
|
||||
|
||||
router.post('/users', auth(), userController.createUser);
|
||||
```
|
||||
|
||||
These routes require a valid JWT access token in the Authorization request header using the Bearer schema. If the request does not contain a valid access token, an Unauthorized (401) error is thrown.
|
||||
|
||||
**Generating Access Tokens**:
|
||||
|
||||
An access token can be generated by making a successful call to the register (`POST /v1/auth/register`) or login (`POST /v1/auth/login`) endpoints. The response of these endpoints also contains refresh tokens (explained below).
|
||||
|
||||
An access token is valid for 30 minutes. You can modify this expiration time by changing the `JWT_ACCESS_EXPIRATION_MINUTES` environment variable in the .env file.
|
||||
|
||||
**Refreshing Access Tokens**:
|
||||
|
||||
After the access token expires, a new access token can be generated, by making a call to the refresh token endpoint (`POST /v1/auth/refresh-tokens`) and sending along a valid refresh token in the request body. This call returns a new access token and a new refresh token.
|
||||
|
||||
A refresh token is valid for 30 days. You can modify this expiration time by changing the `JWT_REFRESH_EXPIRATION_DAYS` environment variable in the .env file.
|
||||
|
||||
## Authorization
|
||||
|
||||
The `auth` middleware can also be used to require certain rights/permissions to access a route.
|
||||
|
||||
```javascript
|
||||
const express = require('express');
|
||||
const auth = require('../../middlewares/auth');
|
||||
const userController = require('../../controllers/user.controller');
|
||||
|
||||
const router = express.Router();
|
||||
|
||||
router.post('/users', auth('manageUsers'), userController.createUser);
|
||||
```
|
||||
|
||||
In the example above, an authenticated user can access this route only if that user has the `manageUsers` permission.
|
||||
|
||||
The permissions are role-based. You can view the permissions/rights of each role in the `src/config/roles.js` file.
|
||||
|
||||
If the user making the request does not have the required permissions to access this route, a Forbidden (403) error is thrown.
|
||||
|
||||
## Logging
|
||||
|
||||
Import the logger from `src/config/logger.js`. It is using the [Winston](https://github.com/winstonjs/winston) logging library.
|
||||
|
||||
Logging should be done according to the following severity levels (ascending order from most important to least important):
|
||||
|
||||
```javascript
|
||||
const logger = require('<path to src>/config/logger');
|
||||
|
||||
logger.error('message'); // level 0
|
||||
logger.warn('message'); // level 1
|
||||
logger.info('message'); // level 2
|
||||
logger.http('message'); // level 3
|
||||
logger.verbose('message'); // level 4
|
||||
logger.debug('message'); // level 5
|
||||
```
|
||||
|
||||
In development mode, log messages of all severity levels will be printed to the console.
|
||||
|
||||
In production mode, only `info`, `warn`, and `error` logs will be printed to the console.\
|
||||
It is up to the server (or process manager) to actually read them from the console and store them in log files.\
|
||||
This app uses pm2 in production mode, which is already configured to store the logs in log files.
|
||||
|
||||
Note: API request information (request url, response code, timestamp, etc.) are also automatically logged (using [morgan](https://github.com/expressjs/morgan)).
|
||||
|
||||
## Linting
|
||||
|
||||
Linting is done using [ESLint](https://eslint.org/) and [Prettier](https://prettier.io).
|
||||
|
||||
In this app, ESLint is configured to follow the [Airbnb JavaScript style guide](https://github.com/airbnb/javascript/tree/master/packages/eslint-config-airbnb-base) with some modifications. It also extends [eslint-config-prettier](https://github.com/prettier/eslint-config-prettier) to turn off all rules that are unnecessary or might conflict with Prettier.
|
||||
|
||||
To modify the ESLint configuration, update the `.eslintrc.json` file. To modify the Prettier configuration, update the `.prettierrc.json` file.
|
||||
|
||||
To prevent a certain file or directory from being linted, add it to `.eslintignore` and `.prettierignore`.
|
||||
|
||||
To maintain a consistent coding style across different IDEs, the project contains `.editorconfig`
|
||||
|
||||
## Contributing
|
||||
|
||||
Contributions are more than welcome! Please check out the [contributing guide](CONTRIBUTING.md).
|
||||
|
||||
## Inspirations
|
||||
|
||||
- [RESTful API Node Server Boilerplate](https://github.com/hagopj13/node-express-boilerplate)
|
||||
|
||||
## License
|
||||
|
||||
[MIT](LICENSE)
|
@@ -1,8 +0,0 @@
|
||||
services:
|
||||
node-app:
|
||||
container_name: node-app-dev
|
||||
# command: sleep infinity
|
||||
command: yarn dev -L
|
||||
ports:
|
||||
- '3000:3000'
|
||||
- '5555:5555'
|
@@ -1,15 +0,0 @@
|
||||
services:
|
||||
db:
|
||||
image: postgres
|
||||
restart: always
|
||||
container_name: postgresdb-util-dev
|
||||
environment:
|
||||
- POSTGRES_USER=postgres
|
||||
- POSTGRES_PASSWORD=secret
|
||||
ports:
|
||||
- '5432:5432'
|
||||
volumes:
|
||||
- db:/var/lib/postgresql/data
|
||||
volumes:
|
||||
db:
|
||||
driver: local
|
@@ -1,15 +0,0 @@
|
||||
services:
|
||||
db:
|
||||
image: postgres
|
||||
restart: always
|
||||
container_name: postgresdb-util-test
|
||||
environment:
|
||||
- POSTGRES_USER=postgres
|
||||
- POSTGRES_PASSWORD=secret
|
||||
ports:
|
||||
- '5432:5432'
|
||||
volumes:
|
||||
- db:/var/lib/postgresql/data
|
||||
volumes:
|
||||
db:
|
||||
driver: local
|
@@ -1,5 +0,0 @@
|
||||
services:
|
||||
node-app:
|
||||
container_name: node-app-prod
|
||||
command: yarn start
|
||||
restart: always
|
@@ -1,4 +0,0 @@
|
||||
services:
|
||||
node-app:
|
||||
container_name: node-app-test
|
||||
command: yarn test
|
@@ -1,46 +0,0 @@
|
||||
volumes:
|
||||
dbdata:
|
||||
driver: local
|
||||
|
||||
networks:
|
||||
node-network:
|
||||
driver: bridge
|
||||
|
||||
services:
|
||||
postgresdb:
|
||||
image: postgres
|
||||
|
||||
environment:
|
||||
- POSTGRES_USER=postgres
|
||||
- POSTGRES_PASSWORD=secret
|
||||
ports:
|
||||
- '5432:5432'
|
||||
volumes:
|
||||
- dbdata:/var/lib/postgresql/data
|
||||
networks:
|
||||
- node-network
|
||||
|
||||
mailpit:
|
||||
image: axllent/mailpit
|
||||
ports:
|
||||
- '1025:1025' # SMTP
|
||||
- '8025:8025' # Web UI
|
||||
environment:
|
||||
MP_UI_AUTH: 'admin:password123' # Optional auth
|
||||
MP_SMTP_AUTH: 'admin:password123'
|
||||
MP_SMTP_AUTH_ALLOW_INSECURE: 'true'
|
||||
networks:
|
||||
- node-network
|
||||
|
||||
node-app:
|
||||
build: .
|
||||
image: node-app
|
||||
ports:
|
||||
- '3000:3000'
|
||||
depends_on:
|
||||
- postgresdb
|
||||
- mailpit
|
||||
volumes:
|
||||
- .:/usr/src/node-app
|
||||
networks:
|
||||
- node-network
|
@@ -1,15 +0,0 @@
|
||||
{
|
||||
"apps": [
|
||||
{
|
||||
"name": "app",
|
||||
"script": "build/src/index.js",
|
||||
"instances": 1,
|
||||
"autorestart": true,
|
||||
"watch": false,
|
||||
"time": true,
|
||||
"env": {
|
||||
"NODE_ENV": "production"
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
@@ -1,10 +0,0 @@
|
||||
module.exports = {
|
||||
preset: 'ts-jest',
|
||||
testEnvironment: 'node',
|
||||
testEnvironmentOptions: {
|
||||
NODE_ENV: 'test'
|
||||
},
|
||||
restoreMocks: true,
|
||||
coveragePathIgnorePatterns: ['node_modules', 'src/config', 'src/app.ts', 'tests'],
|
||||
coverageReporters: ['text', 'lcov', 'clover', 'html']
|
||||
};
|
@@ -1,115 +0,0 @@
|
||||
{
|
||||
"name": "prisma-express-typescript-boilerplate",
|
||||
"version": "1.0.0",
|
||||
"description": "REST API Boilerplate with Node JS, TypeScript, Express and Prisma",
|
||||
"main": "src/index.ts",
|
||||
"repository": "https://github.com/antonio-lazaro/prisma-express-typescript-boilerplate.git",
|
||||
"scripts": {
|
||||
"start": "yarn build && pm2 start ecosystem.config.json --no-daemon",
|
||||
"dev": "cross-env NODE_ENV=development nodemon src/index.ts",
|
||||
"test": "docker-compose -f docker-compose.only-db-test.yml up -d && yarn db:push && jest -i --colors --verbose --detectOpenHandles && docker-compose -f docker-compose.only-db-test.yml down",
|
||||
"test:watch": "docker-compose -f docker-compose.only-db-test.yml up -d && yarn db:push && jest -i --watchAll && docker-compose -f docker-compose.only-db-test.yml down",
|
||||
"lint": "eslint .",
|
||||
"lint:fix": "eslint . --fix",
|
||||
"prettier": "prettier --check **/*.ts",
|
||||
"prettier:fix": "prettier --write **/*.ts",
|
||||
"db:generate": "prisma generate",
|
||||
"db:push": "prisma db push --force-reset",
|
||||
"db:push:w": "npx nodemon --delay 5 --ext \"ts,tsx,prisma\" --exec \"yarn db:push && yarn seed && yarn db:studio\"",
|
||||
"db:studio": "prisma studio",
|
||||
"docker:prod": "docker-compose -f docker-compose.yml -f docker-compose.prod.yml up",
|
||||
"docker:build": "docker-compose -f docker-compose.yml -f docker-compose.dev.yml build",
|
||||
"docker:dev": "docker-compose -f docker-compose.yml -f docker-compose.dev.yml up -d",
|
||||
"docker:bash": "docker-compose -f docker-compose.yml -f docker-compose.dev.yml exec -it node-app sh",
|
||||
"docker:test": "docker-compose -f docker-compose.yml -f docker-compose.test.yml up",
|
||||
"docker:dev-db:start": "docker-compose -f docker-compose.only-db-dev.yml up -d",
|
||||
"docker:dev-db:stop": "docker-compose -f docker-compose.only-db-dev.yml down",
|
||||
"prepare": "husky install",
|
||||
"build": "rimraf build && tsc -p tsconfig.json",
|
||||
"seed": "ts-node prisma/seed.ts",
|
||||
"seed:w": "yarn nodemon --ext ts,tsx --exec \"yarn run seed\""
|
||||
},
|
||||
"keywords": [
|
||||
"node",
|
||||
"node.js",
|
||||
"typescript",
|
||||
"boilerplate",
|
||||
"express",
|
||||
"rest",
|
||||
"api",
|
||||
"prisma",
|
||||
"postgresql",
|
||||
"es6",
|
||||
"es7",
|
||||
"es8",
|
||||
"es9",
|
||||
"docker",
|
||||
"passport",
|
||||
"joi",
|
||||
"eslint",
|
||||
"prettier"
|
||||
],
|
||||
"author": "Antonio Lázaro",
|
||||
"license": "ISC",
|
||||
"devDependencies": {
|
||||
"@faker-js/faker": "^7.6.0",
|
||||
"@jest/globals": "^29.3.1",
|
||||
"@types/compression": "^1.7.2",
|
||||
"@types/cors": "^2.8.13",
|
||||
"@types/express": "^4.17.14",
|
||||
"@types/jest": "^29.2.5",
|
||||
"@types/morgan": "^1.9.3",
|
||||
"@types/node": "^18.11.13",
|
||||
"@types/passport": "^1.0.11",
|
||||
"@types/passport-jwt": "^3.0.7",
|
||||
"@types/supertest": "^2.0.12",
|
||||
"@types/swagger-jsdoc": "^6.0.1",
|
||||
"@types/swagger-ui-express": "^4.1.3",
|
||||
"@types/xss-filters": "^0.0.27",
|
||||
"@typescript-eslint/eslint-plugin": "^5.46.1",
|
||||
"@typescript-eslint/parser": "^5.46.1",
|
||||
"cross-env": "^7.0.3",
|
||||
"eslint": "^8.29.0",
|
||||
"eslint-config-prettier": "^8.5.0",
|
||||
"eslint-plugin-prettier": "^4.2.1",
|
||||
"husky": "^8.0.2",
|
||||
"jest": "^29.3.1",
|
||||
"lint-staged": "^13.1.0",
|
||||
"node-mocks-http": "^1.12.1",
|
||||
"nodemon": "^2.0.20",
|
||||
"prettier": "^2.8.1",
|
||||
"prisma": "^4.10.1",
|
||||
"supertest": "^6.3.3",
|
||||
"swagger-jsdoc": "^6.2.5",
|
||||
"swagger-ui-express": "^4.6.0",
|
||||
"ts-jest": "^29.0.3",
|
||||
"ts-node": "^10.9.1",
|
||||
"typescript": "^4.9.4"
|
||||
},
|
||||
"dependencies": {
|
||||
"@prisma/client": "^4.10.1",
|
||||
"@types/bcryptjs": "^2.4.2",
|
||||
"@types/nodemailer": "^6.4.7",
|
||||
"bcryptjs": "^2.4.3",
|
||||
"compression": "^1.7.4",
|
||||
"cors": "^2.8.5",
|
||||
"date-fns": "^4.1.0",
|
||||
"dotenv": "^16.0.3",
|
||||
"express": "^4.18.2",
|
||||
"express-rate-limit": "^6.7.0",
|
||||
"helmet": "^6.0.1",
|
||||
"http-status": "^1.5.3",
|
||||
"joi": "^17.7.0",
|
||||
"moment": "^2.29.4",
|
||||
"morgan": "^1.10.0",
|
||||
"nodemailer": "^6.8.0",
|
||||
"passport": "^0.6.0",
|
||||
"passport-jwt": "^4.0.0",
|
||||
"pm2": "^5.2.2",
|
||||
"winston": "^3.8.2",
|
||||
"xss-filters": "^1.2.7"
|
||||
},
|
||||
"prisma": {
|
||||
"seed": "ts-node prisma/seed.ts"
|
||||
}
|
||||
}
|
File diff suppressed because it is too large
Load Diff
@@ -1,25 +0,0 @@
|
||||
import { Event } from './seeds/Event';
|
||||
import { Member } from './seeds/Member';
|
||||
import { Order } from './seeds/Order';
|
||||
import { superuserSeed } from './seeds/superuser';
|
||||
import { userSeed } from './seeds/user';
|
||||
import { ProductReview } from './seeds/productReview';
|
||||
import { ProductItem } from './seeds/productItem';
|
||||
import { Blog } from './seeds/blog';
|
||||
import { Mail } from './seeds/mail';
|
||||
// import { File } from './seeds/_files';
|
||||
// import { Chat } from './seeds/chat';
|
||||
|
||||
(async () => {
|
||||
await userSeed;
|
||||
await superuserSeed;
|
||||
await Member;
|
||||
await Event;
|
||||
await Order;
|
||||
await ProductReview;
|
||||
await ProductItem;
|
||||
await Blog;
|
||||
await Mail;
|
||||
// await File;
|
||||
// await Chat;
|
||||
})();
|
@@ -1,39 +0,0 @@
|
||||
import { PrismaClient } from '@prisma/client';
|
||||
import { format, parseISO } from 'date-fns';
|
||||
|
||||
const prisma = new PrismaClient();
|
||||
|
||||
async function event() {
|
||||
for (let i = 0; i < 5; i++) {
|
||||
const helloworldEvent = await prisma.event.upsert({
|
||||
where: { id: i },
|
||||
update: {},
|
||||
create: {
|
||||
eventDate: new Date(),
|
||||
joinMembers: undefined,
|
||||
title: 'event ' + i,
|
||||
price: 123 + i,
|
||||
currency: 'HKD',
|
||||
duration_m: 480 - i,
|
||||
ageBottom: 12 + i,
|
||||
ageTop: 48 - i,
|
||||
location: 'Hong Kong Island',
|
||||
avatar: 'https://www.ionics.io/img/ionic-logo.png'
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
console.log('seed event done');
|
||||
}
|
||||
|
||||
const Event = event()
|
||||
.then(async () => {
|
||||
await prisma.$disconnect();
|
||||
})
|
||||
.catch(async (e) => {
|
||||
console.error(e);
|
||||
await prisma.$disconnect();
|
||||
process.exit(1);
|
||||
});
|
||||
|
||||
export { Event };
|
@@ -1,46 +0,0 @@
|
||||
import { PrismaClient } from '@prisma/client';
|
||||
const prisma = new PrismaClient();
|
||||
|
||||
async function member() {
|
||||
for (let i = 0; i < 100; i++) {
|
||||
const john = await prisma.member.upsert({
|
||||
where: { email: `member${i}@example.com` },
|
||||
update: {},
|
||||
create: {
|
||||
email: `member${i}@example.com`,
|
||||
name: `member_${i}`,
|
||||
age: 20 + i,
|
||||
rank: i % 2 ? 'VIP' : 'NON_VIP',
|
||||
verified: i % 3 ? 'NOT_VERIFIED' : 'VERIFIED',
|
||||
hobbies: ['fishing', 'basketball', 'piano'],
|
||||
distance: '40km',
|
||||
location_area: 'Sai Kung',
|
||||
greetings: 'Hi, I am ',
|
||||
gender: 'man',
|
||||
tall_cm: 172,
|
||||
weight_kg: 60,
|
||||
occupation: 'doctor',
|
||||
language: ['English', 'French', 'Chinese'],
|
||||
education: ['Degree of Computer'],
|
||||
self_introduction: 'Get me know me before you love me. Get me know me before you love me.',
|
||||
music: ['Classic', 'Classic', 'Classic', 'Classic', 'Classic', 'Classic'],
|
||||
pets: ['Classic', 'Classic', 'Classic', 'Classic', 'Classic', 'Classic'],
|
||||
character: ['Classic', 'Classic', 'Classic', 'Classic', 'Classic', 'Classic']
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
console.log('seed member done');
|
||||
}
|
||||
|
||||
const Member = member()
|
||||
.then(async () => {
|
||||
await prisma.$disconnect();
|
||||
})
|
||||
.catch(async (e) => {
|
||||
console.error(e);
|
||||
await prisma.$disconnect();
|
||||
process.exit(1);
|
||||
});
|
||||
|
||||
export { Member };
|
@@ -1,31 +0,0 @@
|
||||
import { PrismaClient } from '@prisma/client';
|
||||
const prisma = new PrismaClient();
|
||||
|
||||
async function order() {
|
||||
for (let i = 0; i < 3; i++) {
|
||||
const temp = await prisma.order.upsert({
|
||||
where: { id: i },
|
||||
update: {},
|
||||
create: {
|
||||
title: 'Single Party with Dating',
|
||||
order_time: new Date(),
|
||||
last_payment_date: new Date(),
|
||||
status: 'Pending'
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
console.log('seed order done');
|
||||
}
|
||||
|
||||
const Order = order()
|
||||
.then(async () => {
|
||||
await prisma.$disconnect();
|
||||
})
|
||||
.catch(async (e) => {
|
||||
console.error(e);
|
||||
await prisma.$disconnect();
|
||||
process.exit(1);
|
||||
});
|
||||
|
||||
export { Order };
|
@@ -1,49 +0,0 @@
|
||||
// src/_mock/_files.ts
|
||||
//
|
||||
import { _mock } from './_mock';
|
||||
import { _fileNames } from './assets';
|
||||
|
||||
// ----------------------------------------------------------------------
|
||||
|
||||
const GB = 1000000000 * 24;
|
||||
|
||||
const URLS = [
|
||||
_mock.image.cover(2),
|
||||
'https://www.cloud.com/s/c218bo6kjuqyv66/design_suriname_2015.mp3',
|
||||
'https://www.cloud.com/s/c218bo6kjuqyv66/expertise_2015_conakry_sao-tome-and-principe_gender.mp4',
|
||||
'https://www.cloud.com/s/c218bo6kjuqyv66/money-popup-crack.pdf',
|
||||
_mock.image.cover(3),
|
||||
_mock.image.cover(5),
|
||||
'https://www.cloud.com/s/c218bo6kjuqyv66/large_news.txt',
|
||||
'https://www.cloud.com/s/c218bo6kjuqyv66/nauru-6015-small-fighter-left-gender.psd',
|
||||
'https://www.cloud.com/s/c218bo6kjuqyv66/tv-xs.doc',
|
||||
'https://www.cloud.com/s/c218bo6kjuqyv66/gustavia-entertainment-productivity.docx',
|
||||
'https://www.cloud.com/s/c218bo6kjuqyv66/vintage_bahrain_saipan.xls',
|
||||
'https://www.cloud.com/s/c218bo6kjuqyv66/indonesia-quito-nancy-grace-left-glad.xlsx',
|
||||
'https://www.cloud.com/s/c218bo6kjuqyv66/legislation-grain.zip',
|
||||
'https://www.cloud.com/s/c218bo6kjuqyv66/large_energy_dry_philippines.rar',
|
||||
'https://www.cloud.com/s/c218bo6kjuqyv66/footer-243-ecuador.iso',
|
||||
'https://www.cloud.com/s/c218bo6kjuqyv66/kyrgyzstan-04795009-picabo-street-guide-style.ai',
|
||||
'https://www.cloud.com/s/c218bo6kjuqyv66/india-data-large-gk-chesterton-mother.esp',
|
||||
'https://www.cloud.com/s/c218bo6kjuqyv66/footer-barbados-celine-dion.ppt',
|
||||
'https://www.cloud.com/s/c218bo6kjuqyv66/socio_respectively_366996.pptx',
|
||||
'https://www.cloud.com/s/c218bo6kjuqyv66/socio_ahead_531437_sweden_popup.wav',
|
||||
'https://www.cloud.com/s/c218bo6kjuqyv66/trinidad_samuel-morse_bring.m4v',
|
||||
_mock.image.cover(11),
|
||||
_mock.image.cover(17),
|
||||
'https://www.cloud.com/s/c218bo6kjuqyv66/xl_david-blaine_component_tanzania_books.pdf'
|
||||
];
|
||||
|
||||
// ----------------------------------------------------------------------
|
||||
|
||||
export const _files = () =>
|
||||
_fileNames.map((name, index) => ({
|
||||
id: _mock.id(index),
|
||||
name,
|
||||
path: URLS[index],
|
||||
preview: URLS[index],
|
||||
size: GB / ((index + 1) * 500),
|
||||
createdAt: _mock.time(index),
|
||||
modifiedAt: _mock.time(index),
|
||||
type: `${name.split('.').pop()}`
|
||||
}));
|
@@ -1,88 +0,0 @@
|
||||
import { fSub } from './utils/set-date';
|
||||
|
||||
import { CONFIG } from './global-config';
|
||||
|
||||
import {
|
||||
_id,
|
||||
_ages,
|
||||
_roles,
|
||||
_prices,
|
||||
_emails,
|
||||
_ratings,
|
||||
_nativeS,
|
||||
_nativeM,
|
||||
_nativeL,
|
||||
_percents,
|
||||
_booleans,
|
||||
_sentences,
|
||||
_lastNames,
|
||||
_fullNames,
|
||||
_tourNames,
|
||||
_jobTitles,
|
||||
_taskNames,
|
||||
_fileNames,
|
||||
_postTitles,
|
||||
_firstNames,
|
||||
_eventNames,
|
||||
_courseNames,
|
||||
_fullAddress,
|
||||
_companyNames,
|
||||
_productNames,
|
||||
_descriptions,
|
||||
_phoneNumbers,
|
||||
_countryNames
|
||||
} from './assets';
|
||||
|
||||
// ----------------------------------------------------------------------
|
||||
|
||||
export const _mock = {
|
||||
id: (index: number) => _id[index],
|
||||
// time: (index: number) => `2024-06-${(index + 1).toString().padStart(2, '0')}T23:00:00.000Z`,
|
||||
time: (index: number) => fSub({ days: index, hours: index }),
|
||||
boolean: (index: number) => _booleans[index],
|
||||
role: (index: number) => _roles[index],
|
||||
// Text
|
||||
courseNames: (index: number) => _courseNames[index],
|
||||
fileNames: (index: number) => _fileNames[index],
|
||||
eventNames: (index: number) => _eventNames[index],
|
||||
taskNames: (index: number) => _taskNames[index],
|
||||
postTitle: (index: number) => _postTitles[index],
|
||||
jobTitle: (index: number) => _jobTitles[index],
|
||||
tourName: (index: number) => _tourNames[index],
|
||||
productName: (index: number) => _productNames[index],
|
||||
sentence: (index: number) => _sentences[index],
|
||||
description: (index: number) => _descriptions[index],
|
||||
// Contact
|
||||
email: (index: number) => _emails[index],
|
||||
phoneNumber: (index: number) => _phoneNumbers[index],
|
||||
fullAddress: (index: number) => _fullAddress[index],
|
||||
// Name
|
||||
firstName: (index: number) => _firstNames[index],
|
||||
lastName: (index: number) => _lastNames[index],
|
||||
fullName: (index: number) => _fullNames[index],
|
||||
companyNames: (index: number) => _companyNames[index],
|
||||
countryNames: (index: number) => _countryNames[index],
|
||||
// Number
|
||||
number: {
|
||||
percent: (index: number) => _percents[index],
|
||||
rating: (index: number) => _ratings[index],
|
||||
age: (index: number) => _ages[index],
|
||||
price: (index: number) => _prices[index],
|
||||
nativeS: (index: number) => _nativeS[index],
|
||||
nativeM: (index: number) => _nativeM[index],
|
||||
nativeL: (index: number) => _nativeL[index]
|
||||
},
|
||||
// Image
|
||||
image: {
|
||||
cover: (index: number) => `${CONFIG.basePath}/assets/images/cover/cover-${index + 1}.webp`,
|
||||
avatar: (index: number) => `${CONFIG.basePath}/assets/images/avatar/avatar-${index + 1}.webp`,
|
||||
travel: (index: number) => `${CONFIG.basePath}/assets/images/travel/travel-${index + 1}.webp`,
|
||||
course: (index: number) => `${CONFIG.basePath}/assets/images/course/course-${index + 1}.webp`,
|
||||
company: (index: number) =>
|
||||
`${CONFIG.basePath}/assets/images/company/company-${index + 1}.webp`,
|
||||
product: (index: number) =>
|
||||
`${CONFIG.basePath}/assets/images/m-product/product-${index + 1}.webp`,
|
||||
portrait: (index: number) =>
|
||||
`${CONFIG.basePath}/assets/images/portrait/portrait-${index + 1}.webp`
|
||||
}
|
||||
};
|
@@ -1,674 +0,0 @@
|
||||
// ----------------------------------------------------------------------
|
||||
|
||||
export const _id = Array.from(
|
||||
{ length: 40 },
|
||||
(_, index) => `e99f09a7-dd88-49d5-b1c8-1daf80c2d7b${index + 1}`
|
||||
);
|
||||
|
||||
// ----------------------------------------------------------------------
|
||||
|
||||
export const _booleans = [
|
||||
true,
|
||||
true,
|
||||
true,
|
||||
false,
|
||||
false,
|
||||
true,
|
||||
false,
|
||||
false,
|
||||
false,
|
||||
false,
|
||||
true,
|
||||
true,
|
||||
true,
|
||||
false,
|
||||
false,
|
||||
false,
|
||||
true,
|
||||
false,
|
||||
false,
|
||||
false,
|
||||
true,
|
||||
false,
|
||||
false,
|
||||
true,
|
||||
];
|
||||
|
||||
// ----------------------------------------------------------------------
|
||||
|
||||
export const _prices = [
|
||||
83.74, 97.14, 68.71, 85.21, 52.17, 25.18, 43.84, 60.98, 98.42, 53.37, 72.75, 56.61, 64.55, 77.32,
|
||||
60.62, 79.81, 93.68, 47.44, 76.24, 92.87, 72.91, 20.54, 94.25, 37.51,
|
||||
];
|
||||
|
||||
export const _ratings = [
|
||||
4.2, 3.7, 4.5, 3.5, 0.5, 3.0, 2.5, 2.8, 4.9, 3.6, 2.5, 1.7, 3.9, 2.8, 4.1, 4.5, 2.2, 3.2, 0.6,
|
||||
1.3, 3.8, 3.8, 3.8, 2.0,
|
||||
];
|
||||
|
||||
export const _ages = [
|
||||
30, 26, 59, 47, 29, 46, 18, 56, 39, 19, 45, 18, 46, 56, 38, 41, 44, 48, 32, 45, 42, 60, 33, 57,
|
||||
];
|
||||
|
||||
export const _percents = [
|
||||
10.1, 13.6, 28.2, 42.1, 37.2, 18.5, 40.1, 94.8, 91.4, 53.0, 25.4, 62.9, 86.6, 62.4, 35.4, 17.6,
|
||||
52.0, 6.8, 95.3, 26.6, 69.9, 92.1, 46.2, 85.6,
|
||||
];
|
||||
|
||||
export const _nativeS = [
|
||||
11, 10, 7, 10, 12, 5, 10, 1, 8, 8, 10, 11, 12, 8, 4, 11, 8, 9, 4, 9, 2, 6, 3, 7,
|
||||
];
|
||||
|
||||
export const _nativeM = [
|
||||
497, 763, 684, 451, 433, 463, 951, 194, 425, 435, 807, 521, 538, 839, 394, 269, 453, 821, 364,
|
||||
849, 804, 776, 263, 239,
|
||||
];
|
||||
|
||||
export const _nativeL = [
|
||||
9911, 1947, 9124, 6984, 8488, 2034, 3364, 8401, 8996, 5271, 8478, 1139, 8061, 3035, 6733, 3952,
|
||||
2405, 3127, 6843, 4672, 6995, 6053, 5192, 9686,
|
||||
];
|
||||
|
||||
export const _fullAddress = [
|
||||
`19034 Verna Unions Apt. 164 - Honolulu, RI / 87535`,
|
||||
`1147 Rohan Drive Suite 819 - Burlington, VT / 82021`,
|
||||
`18605 Thompson Circle Apt. 086 - Idaho Falls, WV / 50337`,
|
||||
`110 Lamar Station Apt. 730 - Hagerstown, OK / 49808`,
|
||||
`36901 Elmer Spurs Apt. 762 - Miramar, DE / 92836`,
|
||||
`2089 Runolfsson Harbors Suite 886 - Chapel Hill, TX / 32827`,
|
||||
`279 Karolann Ports Apt. 774 - Prescott Valley, WV / 53905`,
|
||||
`96607 Claire Square Suite 591 - St. Louis Park, HI / 40802`,
|
||||
`9388 Auer Station Suite 573 - Honolulu, AK / 98024`,
|
||||
`47665 Adaline Squares Suite 510 - Blacksburg, NE / 53515`,
|
||||
`989 Vernice Flats Apt. 183 - Billings, NV / 04147`,
|
||||
`91020 Wehner Locks Apt. 673 - Albany, WY / 68763`,
|
||||
`585 Candelario Pass Suite 090 - Columbus, LA / 25376`,
|
||||
`80988 Renner Crest Apt. 000 - Fargo, VA / 24266`,
|
||||
`28307 Shayne Pike Suite 523 - North Las Vegas, AZ / 28550`,
|
||||
`205 Farrell Highway Suite 333 - Rock Hill, OK / 63421`,
|
||||
`253 Kara Motorway Suite 821 - Manchester, SD / 09331`,
|
||||
`13663 Kiara Oval Suite 606 - Missoula, AR / 44478`,
|
||||
`8110 Claire Port Apt. 703 - Anchorage, TN / 01753`,
|
||||
`4642 Demetris Lane Suite 407 - Edmond, AZ / 60888`,
|
||||
`74794 Asha Flat Suite 890 - Lancaster, OR / 13466`,
|
||||
`8135 Keeling Pines Apt. 326 - Alexandria, MA / 89442`,
|
||||
`441 Gibson Shores Suite 247 - Pasco, NM / 60678`,
|
||||
`4373 Emelia Valley Suite 596 - Columbia, NM / 42586`,
|
||||
];
|
||||
|
||||
// ----------------------------------------------------------------------
|
||||
|
||||
export const _emails = [
|
||||
`nannie.abernathy70@yahoo.com`,
|
||||
`ashlynn.ohara62@gmail.com`,
|
||||
`milo.farrell@hotmail.com`,
|
||||
`violet.ratke86@yahoo.com`,
|
||||
`letha.lubowitz24@yahoo.com`,
|
||||
`aditya.greenfelder31@gmail.com`,
|
||||
`lenna.bergnaum27@hotmail.com`,
|
||||
`luella.ryan33@gmail.com`,
|
||||
`joana.simonis84@gmail.com`,
|
||||
`marjolaine.white94@gmail.com`,
|
||||
`vergie.block82@hotmail.com`,
|
||||
`vito.hudson@hotmail.com`,
|
||||
`tyrel.greenholt@gmail.com`,
|
||||
`dwight.block85@yahoo.com`,
|
||||
`mireya13@hotmail.com`,
|
||||
`dasia.jenkins@hotmail.com`,
|
||||
`benny89@yahoo.com`,
|
||||
`dawn.goyette@gmail.com`,
|
||||
`zella.hickle4@yahoo.com`,
|
||||
`avery43@hotmail.com`,
|
||||
`olen.legros@gmail.com`,
|
||||
`jimmie.gerhold73@hotmail.com`,
|
||||
`genevieve.powlowski@hotmail.com`,
|
||||
`louie.kuphal39@gmail.com`,
|
||||
];
|
||||
|
||||
// ----------------------------------------------------------------------
|
||||
|
||||
export const _fullNames = [
|
||||
`Jayvion Simon`,
|
||||
`Lucian Obrien`,
|
||||
`Deja Brady`,
|
||||
`Harrison Stein`,
|
||||
`Reece Chung`,
|
||||
`Lainey Davidson`,
|
||||
`Cristopher Cardenas`,
|
||||
`Melanie Noble`,
|
||||
`Chase Day`,
|
||||
`Shawn Manning`,
|
||||
`Soren Durham`,
|
||||
`Cortez Herring`,
|
||||
`Brycen Jimenez`,
|
||||
`Giana Brandt`,
|
||||
`Aspen Schmitt`,
|
||||
`Colten Aguilar`,
|
||||
`Angelique Morse`,
|
||||
`Selina Boyer`,
|
||||
`Lawson Bass`,
|
||||
`Ariana Lang`,
|
||||
`Amiah Pruitt`,
|
||||
`Harold Mcgrath`,
|
||||
`Esperanza Mcintyre`,
|
||||
`Mireya Conner`,
|
||||
];
|
||||
|
||||
export const _firstNames = [
|
||||
`Mossie`,
|
||||
`David`,
|
||||
`Ebba`,
|
||||
`Chester`,
|
||||
`Eula`,
|
||||
`Jaren`,
|
||||
`Boyd`,
|
||||
`Brady`,
|
||||
`Aida`,
|
||||
`Anastasia`,
|
||||
`Gregoria`,
|
||||
`Julianne`,
|
||||
`Ila`,
|
||||
`Elyssa`,
|
||||
`Lucio`,
|
||||
`Lewis`,
|
||||
`Jacinthe`,
|
||||
`Molly`,
|
||||
`Brown`,
|
||||
`Fritz`,
|
||||
`Keon`,
|
||||
`Ella`,
|
||||
`Ken`,
|
||||
`Whitney`,
|
||||
];
|
||||
|
||||
export const _lastNames = [
|
||||
`Carroll`,
|
||||
`Simonis`,
|
||||
`Yost`,
|
||||
`Hand`,
|
||||
`Emmerich`,
|
||||
`Wilderman`,
|
||||
`Howell`,
|
||||
`Sporer`,
|
||||
`Boehm`,
|
||||
`Morar`,
|
||||
`Koch`,
|
||||
`Reynolds`,
|
||||
`Padberg`,
|
||||
`Watsica`,
|
||||
`Upton`,
|
||||
`Yundt`,
|
||||
`Pfeffer`,
|
||||
`Parker`,
|
||||
`Zulauf`,
|
||||
`Treutel`,
|
||||
`McDermott`,
|
||||
`McDermott`,
|
||||
`Cruickshank`,
|
||||
`Parisian`,
|
||||
];
|
||||
|
||||
// ----------------------------------------------------------------------
|
||||
|
||||
export const _phoneNumbers = [
|
||||
'+1 202-555-0143',
|
||||
'+1 416-555-0198',
|
||||
'+44 20 7946 0958',
|
||||
'+61 2 9876 5432',
|
||||
'+91 22 1234 5678',
|
||||
'+49 30 123456',
|
||||
'+33 1 23456789',
|
||||
'+81 3 1234 5678',
|
||||
'+86 10 1234 5678',
|
||||
'+55 11 2345-6789',
|
||||
'+27 11 123 4567',
|
||||
'+7 495 123-4567',
|
||||
'+52 55 1234 5678',
|
||||
'+39 06 123 4567',
|
||||
'+34 91 123 4567',
|
||||
'+31 20 123 4567',
|
||||
'+46 8 123 456',
|
||||
'+41 22 123 45 67',
|
||||
'+82 2 123 4567',
|
||||
'+54 11 1234-5678',
|
||||
'+64 9 123 4567',
|
||||
'+65 1234 5678',
|
||||
'+60 3-1234 5678',
|
||||
'+66 2 123 4567',
|
||||
'+62 21 123 4567',
|
||||
'+63 2 123 4567',
|
||||
'+90 212 123 45 67',
|
||||
'+966 11 123 4567',
|
||||
'+971 2 123 4567',
|
||||
'+20 2 12345678',
|
||||
'+234 1 123 4567',
|
||||
'+254 20 123 4567',
|
||||
'+972 3-123-4567',
|
||||
'+30 21 1234 5678',
|
||||
'+353 1 123 4567',
|
||||
'+351 21 123 4567',
|
||||
'+47 21 23 45 67',
|
||||
'+45 32 12 34 56',
|
||||
'+358 9 123 4567',
|
||||
'+48 22 123 45 67',
|
||||
];
|
||||
|
||||
// ----------------------------------------------------------------------
|
||||
|
||||
export const _countryNames = [
|
||||
'United States',
|
||||
'Canada',
|
||||
'United Kingdom',
|
||||
'Australia',
|
||||
'India',
|
||||
'Germany',
|
||||
'France',
|
||||
'Japan',
|
||||
'China',
|
||||
'Brazil',
|
||||
'South Africa',
|
||||
'Russia',
|
||||
'Mexico',
|
||||
'Italy',
|
||||
'Spain',
|
||||
'Netherlands',
|
||||
'Sweden',
|
||||
'Switzerland',
|
||||
'South Korea',
|
||||
'Argentina',
|
||||
'New Zealand',
|
||||
'Singapore',
|
||||
'Malaysia',
|
||||
'Thailand',
|
||||
'Indonesia',
|
||||
'Philippines',
|
||||
'Turkey',
|
||||
'Saudi Arabia',
|
||||
'United Arab Emirates',
|
||||
'Egypt',
|
||||
'Nigeria',
|
||||
'Kenya',
|
||||
'Israel',
|
||||
'Greece',
|
||||
'Ireland',
|
||||
'Portugal',
|
||||
'Norway',
|
||||
'Denmark',
|
||||
'Finland',
|
||||
'Poland',
|
||||
];
|
||||
|
||||
// ----------------------------------------------------------------------
|
||||
|
||||
export const _roles = [
|
||||
`CEO`,
|
||||
`CTO`,
|
||||
`Project Coordinator`,
|
||||
`Team Leader`,
|
||||
`Software Developer`,
|
||||
`Marketing Strategist`,
|
||||
`Data Analyst`,
|
||||
`Product Owner`,
|
||||
`Graphic Designer`,
|
||||
`Operations Manager`,
|
||||
`Customer Support Specialist`,
|
||||
`Sales Manager`,
|
||||
`HR Recruiter`,
|
||||
`Business Consultant`,
|
||||
`Financial Planner`,
|
||||
`Network Engineer`,
|
||||
`Content Creator`,
|
||||
`Quality Assurance Tester`,
|
||||
`Public Relations Officer`,
|
||||
`IT Administrator`,
|
||||
`Compliance Officer`,
|
||||
`Event Planner`,
|
||||
`Legal Counsel`,
|
||||
`Training Coordinator`,
|
||||
];
|
||||
|
||||
// ----------------------------------------------------------------------
|
||||
|
||||
export const _postTitles = [
|
||||
`The Future of Renewable Energy: Innovations and Challenges Ahead`,
|
||||
`Exploring the Impact of Artificial Intelligence on Modern Healthcare`,
|
||||
`Climate Change and Its Effects on Global Food Security`,
|
||||
`The Rise of Remote Work: Benefits, Challenges, and Future Trends`,
|
||||
`Understanding Blockchain Technology: Beyond Cryptocurrency`,
|
||||
`Mental Health in the Digital Age: Navigating Social Media and Well-being`,
|
||||
`Sustainable Fashion: How the Industry is Going Green`,
|
||||
`Space Exploration: New Frontiers and the Quest for Extraterrestrial Life`,
|
||||
`The Evolution of E-Commerce: Trends Shaping the Online Retail Landscape`,
|
||||
`Cybersecurity in the 21st Century: Protecting Data in a Digital World`,
|
||||
`The Role of Big Data in Transforming Business Strategies`,
|
||||
`Genetic Engineering: Ethical Considerations and Future Prospects`,
|
||||
`Urban Farming: A Solution to Food Deserts and Urban Sustainability`,
|
||||
`The Psychology of Consumer Behavior: What Drives Our Purchasing Decisions?`,
|
||||
`Renewable Energy vs. Fossil Fuels: Which is the Future?`,
|
||||
`Artificial Intelligence in Education: Enhancing Learning Experiences`,
|
||||
`The Impact of Climate Change on Global Migration Patterns`,
|
||||
`5G Technology: Revolutionizing Connectivity and Communication`,
|
||||
`The Gig Economy: Opportunities, Risks, and the Future of Work`,
|
||||
`Smart Cities: Integrating Technology for Sustainable Urban Living`,
|
||||
`The Influence of Pop Culture on Modern Society`,
|
||||
`Innovations in Medicine: From Telehealth to Personalized Treatment`,
|
||||
`The Environmental Cost of Fast Fashion: What Can Consumers Do?`,
|
||||
`The Intersection of Art and Technology: Digital Art in the 21st Century`,
|
||||
];
|
||||
|
||||
// ----------------------------------------------------------------------
|
||||
|
||||
export const _productNames = [
|
||||
`Urban Explorer Sneakers`,
|
||||
`Classic Leather Loafers`,
|
||||
`Mountain Trekking Boots`,
|
||||
`Elegance Stiletto Heels`,
|
||||
`Comfy Running Shoes`,
|
||||
`Chic Ballet Flats`,
|
||||
`Vintage Oxford Shoes`,
|
||||
`Waterproof Hiking Boots`,
|
||||
`Casual Slip-On Sneakers`,
|
||||
`Premium Dress Shoes`,
|
||||
`Sporty Trail Runners`,
|
||||
`Sophisticated Brogues`,
|
||||
`Beach Sandals`,
|
||||
`Stylish Wedge Heels`,
|
||||
`Lightweight Training Shoes`,
|
||||
`Luxurious Moccasins`,
|
||||
`Durable Work Boots`,
|
||||
`Trendy Platform Sneakers`,
|
||||
`Cozy Winter Boots`,
|
||||
`Fashion Ankle Boots`,
|
||||
`Breathable Tennis Shoes`,
|
||||
`Elegant Evening Pumps`,
|
||||
`Modern Skate Shoes`,
|
||||
`Comfortable Walking Shoes`,
|
||||
];
|
||||
|
||||
// ----------------------------------------------------------------------
|
||||
|
||||
export const _tourNames = [
|
||||
`Majestic Mountain Adventures`,
|
||||
`Island Hopping Extravaganza`,
|
||||
`Cultural Wonders of Europe`,
|
||||
`Safari Expedition in Africa`,
|
||||
`Grand Canyon Explorer`,
|
||||
`Historic Cities of Asia`,
|
||||
`Tropical Paradise Getaway`,
|
||||
`Alaskan Wilderness Tour`,
|
||||
`Mediterranean Cruise Voyage`,
|
||||
`Enchanting Eastern Europe`,
|
||||
`Scenic Coastal Road Trip`,
|
||||
`Ancient Ruins Discovery`,
|
||||
`Australian Outback Adventure`,
|
||||
`Northern Lights Experience`,
|
||||
`Wildlife Wonders of South America`,
|
||||
`Royal Castles and Palaces`,
|
||||
`Ultimate Beach Retreat`,
|
||||
`National Parks Exploration`,
|
||||
`Gastronomic Tour of Italy`,
|
||||
`Hiking Trails of New Zealand`,
|
||||
`Art and History of France`,
|
||||
`Exotic Temples of India`,
|
||||
`Canadian Rockies Journey`,
|
||||
`Caribbean Sun and Fun`,
|
||||
];
|
||||
|
||||
// ----------------------------------------------------------------------
|
||||
|
||||
export const _jobTitles = [
|
||||
`Software Engineer`,
|
||||
`Marketing Manager`,
|
||||
`Data Scientist`,
|
||||
`Graphic Designer`,
|
||||
`Financial Analyst`,
|
||||
`Human Resources Specialist`,
|
||||
`Project Manager`,
|
||||
`Sales Executive`,
|
||||
`Content Writer`,
|
||||
`Network Administrator`,
|
||||
`Customer Service Representative`,
|
||||
`Product Manager`,
|
||||
`Business Analyst`,
|
||||
`Mechanical Engineer`,
|
||||
`Operations Manager`,
|
||||
`UX/UI Designer`,
|
||||
`Accountant`,
|
||||
`Social Media Manager`,
|
||||
`Research Scientist`,
|
||||
`Legal Advisor`,
|
||||
`Public Relations Specialist`,
|
||||
`Health and Safety Officer`,
|
||||
`IT Support Specialist`,
|
||||
`Environmental Consultant`,
|
||||
];
|
||||
|
||||
// ----------------------------------------------------------------------
|
||||
|
||||
export const _companyNames = [
|
||||
`Lueilwitz and Sons`,
|
||||
`Gleichner, Mueller and Tromp`,
|
||||
`Nikolaus - Leuschke`,
|
||||
`Hegmann, Kreiger and Bayer`,
|
||||
`Grimes Inc`,
|
||||
`Durgan - Murazik`,
|
||||
`Altenwerth, Medhurst and Roberts`,
|
||||
`Raynor Group`,
|
||||
`Mraz, Donnelly and Collins`,
|
||||
`Padberg - Bailey`,
|
||||
`Heidenreich, Stokes and Parker`,
|
||||
`Pagac and Sons`,
|
||||
`Rempel, Hand and Herzog`,
|
||||
`Dare - Treutel`,
|
||||
`Kihn, Marquardt and Crist`,
|
||||
`Nolan - Kunde`,
|
||||
`Wuckert Inc`,
|
||||
`Dibbert Inc`,
|
||||
`Goyette and Sons`,
|
||||
`Feest Group`,
|
||||
`Bosco and Sons`,
|
||||
`Bartell - Kovacek`,
|
||||
`Schimmel - Raynor`,
|
||||
`Tremblay LLC`,
|
||||
];
|
||||
|
||||
// ----------------------------------------------------------------------
|
||||
|
||||
export const _tags = [
|
||||
`Technology`,
|
||||
`Health and Wellness`,
|
||||
`Travel`,
|
||||
`Finance`,
|
||||
`Education`,
|
||||
`Food and Beverage`,
|
||||
`Fashion`,
|
||||
`Home and Garden`,
|
||||
`Sports`,
|
||||
`Entertainment`,
|
||||
`Business`,
|
||||
`Science`,
|
||||
`Automotive`,
|
||||
`Beauty`,
|
||||
`Fitness`,
|
||||
`Lifestyle`,
|
||||
`Real Estate`,
|
||||
`Parenting`,
|
||||
`Pet Care`,
|
||||
`Environmental`,
|
||||
`DIY and Crafts`,
|
||||
`Gaming`,
|
||||
`Photography`,
|
||||
`Music`,
|
||||
];
|
||||
|
||||
// ----------------------------------------------------------------------
|
||||
|
||||
export const _taskNames = [
|
||||
`Prepare Monthly Financial Report`,
|
||||
`Design New Marketing Campaign`,
|
||||
`Analyze Customer Feedback`,
|
||||
`Update Website Content`,
|
||||
`Conduct Market Research`,
|
||||
`Develop Software Application`,
|
||||
`Organize Team Meeting`,
|
||||
`Create Social Media Posts`,
|
||||
`Review Project Plan`,
|
||||
`Implement Security Protocols`,
|
||||
`Write Technical Documentation`,
|
||||
`Test New Product Features`,
|
||||
`Manage Client Inquiries`,
|
||||
`Train New Employees`,
|
||||
`Coordinate Logistics`,
|
||||
`Monitor Network Performance`,
|
||||
`Develop Training Materials`,
|
||||
`Draft Press Release`,
|
||||
`Prepare Budget Proposal`,
|
||||
`Evaluate Vendor Proposals`,
|
||||
`Perform Data Analysis`,
|
||||
`Conduct Quality Assurance`,
|
||||
`Plan Event Logistics`,
|
||||
`Optimize SEO Strategies`,
|
||||
];
|
||||
|
||||
// ----------------------------------------------------------------------
|
||||
|
||||
export const _courseNames = [
|
||||
`Introduction to Python Programming`,
|
||||
`Digital Marketing Fundamentals`,
|
||||
`Data Science with R`,
|
||||
`Graphic Design Essentials`,
|
||||
`Financial Planning for Beginners`,
|
||||
`Human Resource Management Basics`,
|
||||
`Project Management Fundamentals`,
|
||||
`Sales Techniques and Strategies`,
|
||||
`Content Writing Mastery`,
|
||||
`Network Security Fundamentals`,
|
||||
`Customer Service Excellence`,
|
||||
`Product Management Essentials`,
|
||||
`Business Analytics with Excel`,
|
||||
`Mechanical Engineering Principles`,
|
||||
`Leadership and Team Management`,
|
||||
`User Experience (UX) Design Basics`,
|
||||
`Accounting Fundamentals`,
|
||||
`Social Media Marketing Mastery`,
|
||||
`Biotechnology Essentials`,
|
||||
`Legal Studies for Non-Lawyers`,
|
||||
`Public Speaking Confidence`,
|
||||
`Health and Wellness Coaching`,
|
||||
`Web Development Bootcamp`,
|
||||
`Photography Masterclass`,
|
||||
];
|
||||
|
||||
// ----------------------------------------------------------------------
|
||||
|
||||
export const _fileNames = [
|
||||
'cover-2.jpg',
|
||||
'design-suriname-2015.mp3',
|
||||
'expertise-2015-conakry-sao-tome-and-principe-gender.mp4',
|
||||
'money-popup-crack.pdf',
|
||||
'cover-4.jpg',
|
||||
'cover-6.jpg',
|
||||
'large-news.txt',
|
||||
'nauru-6015-small-fighter-left-gender.psd',
|
||||
'tv-xs.doc',
|
||||
'gustavia-entertainment-productivity.docx',
|
||||
'vintage-bahrain-saipan.xls',
|
||||
'indonesia-quito-nancy-grace-left-glad.xlsx',
|
||||
'legislation-grain.zip',
|
||||
'large-energy-dry-philippines.rar',
|
||||
'footer-243-ecuador.iso',
|
||||
'kyrgyzstan-04795009-picabo-street-guide-style.ai',
|
||||
'india-data-large-gk-chesterton-mother.esp',
|
||||
'footer-barbados-celine-dion.ppt',
|
||||
'socio-respectively-366996.pptx',
|
||||
'socio-ahead-531437-sweden-popup.wav',
|
||||
'trinidad-samuel-morse-bring.m4v',
|
||||
'cover-12.jpg',
|
||||
'cover-18.jpg',
|
||||
'xl-david-blaine-component-tanzania-books.pdf',
|
||||
];
|
||||
|
||||
export const _eventNames = [
|
||||
`Annual General Meeting`,
|
||||
`Summer Music Festival`,
|
||||
`Tech Innovators Conference`,
|
||||
`Charity Gala Dinner`,
|
||||
`Spring Art Exhibition`,
|
||||
`Corporate Training Workshop`,
|
||||
`Community Health Fair`,
|
||||
`Startup Pitch Night`,
|
||||
`Regional Sports Tournament`,
|
||||
`Book Launch Event`,
|
||||
`Film Premiere Screening`,
|
||||
`Industry Networking Mixer`,
|
||||
`Holiday Craft Fair`,
|
||||
`Environmental Awareness Week`,
|
||||
`New Year's Eve Party`,
|
||||
`Product Release Showcase`,
|
||||
`Cultural Heritage Festival`,
|
||||
`Science and Technology Expo`,
|
||||
`Annual Awards Ceremony`,
|
||||
`Fashion Week Runway Show`,
|
||||
`Food and Wine Tasting`,
|
||||
`Outdoor Adventure Camp`,
|
||||
`Leadership Summit`,
|
||||
`Wedding Expo`,
|
||||
];
|
||||
|
||||
// ----------------------------------------------------------------------
|
||||
|
||||
export const _sentences = [
|
||||
`The sun slowly set over the horizon, painting the sky in vibrant hues of orange and pink.`,
|
||||
`She eagerly opened the gift, her eyes sparkling with excitement.`,
|
||||
`The old oak tree stood tall and majestic, its branches swaying gently in the breeze.`,
|
||||
`The aroma of freshly brewed coffee filled the air, awakening my senses.`,
|
||||
`The children giggled with joy as they ran through the sprinklers on a hot summer day.`,
|
||||
`He carefully crafted a beautiful sculpture out of clay, his hands skillfully shaping the intricate details.`,
|
||||
`The concert was a mesmerizing experience, with the music filling the venue and the crowd cheering in delight.`,
|
||||
`The waves crashed against the shore, creating a soothing symphony of sound.`,
|
||||
`The scent of blooming flowers wafted through the garden, creating a fragrant paradise.`,
|
||||
`She gazed up at the night sky, marveling at the twinkling stars that dotted the darkness.`,
|
||||
`The professor delivered a captivating lecture, engaging the students with thought-provoking ideas.`,
|
||||
`The hiker trekked through the dense forest, guided by the soft glow of sunlight filtering through the trees.`,
|
||||
`The delicate butterfly gracefully fluttered from flower to flower, sipping nectar with its slender proboscis.`,
|
||||
`The aroma of freshly baked cookies filled the kitchen, tempting everyone with its irresistible scent.`,
|
||||
'The majestic waterfall cascaded down the rocks, creating a breathtaking display of nature`s power.',
|
||||
`The actor delivered a powerful performance, moving the audience to tears with his emotional portrayal.`,
|
||||
`The book transported me to a magical world, where imagination knew no bounds.`,
|
||||
`The scent of rain filled the air as dark clouds gathered overhead, promising a refreshing downpour.`,
|
||||
`The chef skillfully plated the dish, turning simple ingredients into a work of culinary art.`,
|
||||
`The newborn baby let out a tiny cry, announcing its arrival to the world.`,
|
||||
`The athlete sprinted across the finish line, arms raised in victory as the crowd erupted in applause.`,
|
||||
`The ancient ruins stood as a testament to a civilization long gone, their grandeur still awe-inspiring.`,
|
||||
`The artist dipped the brush into vibrant paint, bringing the canvas to life with bold strokes and vivid colors.`,
|
||||
`The laughter of children echoed through the playground, filling the atmosphere with pure joy.`,
|
||||
];
|
||||
|
||||
// ----------------------------------------------------------------------
|
||||
|
||||
export const _descriptions = [
|
||||
`Occaecati est et illo quibusdam accusamus qui. Incidunt aut et molestiae ut facere aut. Est quidem iusto praesentium excepturi harum nihil tenetur facilis. Ut omnis voluptates nihil accusantium doloribus eaque debitis.`,
|
||||
`Atque eaque ducimus minima distinctio velit. Laborum et veniam officiis. Delectus ex saepe hic id laboriosam officia. Odit nostrum qui illum saepe debitis ullam. Laudantium beatae modi fugit ut. Dolores consequatur beatae nihil voluptates rem maiores.`,
|
||||
`Rerum eius velit dolores. Explicabo ad nemo quibusdam. Voluptatem eum suscipit et ipsum et consequatur aperiam quia. Rerum nulla sequi recusandae illum velit quia quas. Et error laborum maiores cupiditate occaecati.`,
|
||||
`Et non omnis qui. Qui sunt deserunt dolorem aut velit cumque adipisci aut enim. Nihil quis quisquam nesciunt dicta nobis ab aperiam dolorem repellat. Voluptates non blanditiis. Error et tenetur iste soluta cupiditate ratione perspiciatis et. Quibusdam aliquid nam sunt et quisquam non esse.`,
|
||||
`Nihil ea sunt facilis praesentium atque. Ab animi alias sequi molestias aut velit ea. Sed possimus eos. Et est aliquid est voluptatem.`,
|
||||
`Non rerum modi. Accusamus voluptatem odit nihil in. Quidem et iusto numquam veniam culpa aperiam odio aut enim. Quae vel dolores. Pariatur est culpa veritatis aut dolorem.`,
|
||||
`Est enim et sit non impedit aperiam cumque animi. Aut eius impedit saepe blanditiis. Totam molestias magnam minima fugiat.`,
|
||||
`Unde a inventore et. Sed esse ut. Atque ducimus quibusdam fuga quas id qui fuga.`,
|
||||
`Eaque natus adipisci soluta nostrum dolorem. Nesciunt ipsum molestias ut aliquid natus ut omnis qui fugiat. Dolor et rem. Ut neque voluptatem blanditiis quasi ullam deleniti.`,
|
||||
`Nam et error exercitationem qui voluptate optio. Officia omnis qui accusantium ipsam qui. Quia sequi nulla perspiciatis optio vero omnis maxime omnis ipsum. Perspiciatis consequuntur asperiores veniam dolores.`,
|
||||
`Perspiciatis nulla ut ut ut voluptates totam consectetur eligendi qui. Optio ut cum. Dolorum sapiente qui laborum. Impedit temporibus totam delectus nihil. Voluptatem corrupti rem.`,
|
||||
`Distinctio omnis similique omnis eos. Repellat cumque rerum nisi. Reiciendis soluta non ut veniam temporibus. Accusantium et dolorem voluptas harum. Nemo eius voluptate dicta et hic nemo. Dolorem assumenda et beatae molestias sit quo mollitia quis consequatur.`,
|
||||
`Sed ut mollitia tempore ipsam et illum doloribus ut. Occaecati ratione veritatis explicabo. Omnis nam omnis sunt placeat tempore accusantium placeat distinctio velit.`,
|
||||
`Eum illo dicta et perspiciatis ut blanditiis eos sequi. Ea veritatis aut et voluptas aut. Laborum eos quia tempore a culpa.`,
|
||||
`Aut quos quae dolores repudiandae similique perferendis perferendis earum laudantium. Facere placeat natus nobis. Eius vitae ullam dolorem.`,
|
||||
`Vero dolorem et voluptatem fugit tempore a quam iure. Fuga consequatur corrupti sunt asperiores vitae. Libero totam repellendus animi debitis illum et sunt officia.`,
|
||||
`Cupiditate illum officiis id molestiae. Numquam non molestiae aliquid et natus sed hic. Alias quia explicabo sed corrupti sint. Natus in et odio qui unde facilis quia. Est sit eius laboriosam aliquid non aperiam quia quo corporis.`,
|
||||
`Et a ab. Optio aspernatur minus tempora amet vitae consectetur inventore cumque. Sed et omnis. Aspernatur a magnam.`,
|
||||
`Ipsum omnis et. Quia ea et autem tempore consequuntur veniam dolorem officiis. Ipsa dicta et ut quidem quia doloremque. Sequi vitae doloremque temporibus. Deserunt incidunt id aperiam itaque natus. Earum sit eaque quas incidunt nihil.`,
|
||||
`Quae consequatur reiciendis. Consequatur non optio. Eaque id placeat. Commodi quo officia aut repudiandae reiciendis tempore voluptatem et. Ut accusamus qui itaque maxime aliquam. Fugit ut animi molestiae porro maiores.`,
|
||||
`Modi hic asperiores ab cumque quam est aut. Voluptas atque quos molestias. Ut excepturi distinctio ipsam aspernatur sit.`,
|
||||
`Sunt totam facilis. Quam commodi voluptatem veniam. Tempora deleniti itaque fugit nihil voluptas.`,
|
||||
`Ipsam aliquam velit nobis repellendus officiis aut deserunt id et. Nihil sunt aut dolores aut. Dolores est ipsa quia et laborum quidem laborum accusamus id. Facilis odit quod hic laudantium saepe omnis nisi in sint. Sed cupiditate possimus id.`,
|
||||
`Magnam non eveniet optio optio ut aliquid atque. Velit libero aspernatur quis laborum consequatur laudantium. Tempora facere optio fugit accusantium ut. Omnis aspernatur reprehenderit autem esse ut ut enim voluptatibus.`,
|
||||
];
|
@@ -1,222 +0,0 @@
|
||||
// src/_mock/_blog.ts
|
||||
import { PrismaClient } from '@prisma/client';
|
||||
const prisma = new PrismaClient();
|
||||
import { uuidv4 } from './utils/uuidv4';
|
||||
import { _mock } from './_mock';
|
||||
import { CONFIG } from './global-config';
|
||||
import { _tags } from './assets';
|
||||
|
||||
const codeBlock = `
|
||||
<pre class="nml__editor__content__code__block"><code class="language-javascript">for (var i=1; i <= 20; i++) {\n if (i % 15 == 0)\n return "FizzBuzz"\n else if (i % 3 == 0)\n return "Fizz"\n else if (i % 5 == 0)\n return "Buzz"\n else\n return i\n }</code></pre>
|
||||
`;
|
||||
|
||||
// Made with Tiptap editor
|
||||
|
||||
const CONTENT = `
|
||||
<h1 class="nml__editor__content__heading" style="text-align: start">Heading H1</h1>
|
||||
<h2 class="nml__editor__content__heading" style="text-align: start">Heading H2</h2>
|
||||
<h3 class="nml__editor__content__heading" style="text-align: start">Heading H3</h3>
|
||||
<h4 class="nml__editor__content__heading" style="text-align: start">Heading H4</h4>
|
||||
<h5 class="nml__editor__content__heading" style="text-align: start">Heading H5</h5>
|
||||
<h6 class="nml__editor__content__heading" style="text-align: start">Heading H6</h6>
|
||||
<hr class="nml__editor__content__hr">
|
||||
<h4 class="nml__editor__content__heading" style="text-align: start">Paragraph</h4>
|
||||
<p style="text-align: start">What is MTAweb Directory?</p>
|
||||
<p style="text-align: start">So you have heard about this site or you have been to it, but you cannot figure out what it is or what it can do. MTA web directory is the simplest way in which one can bid on a link, or a few links if they wish to do so. The link directory on MTA displays all of the links it currently has, and does so in alphabetical order, which makes it much easier for someone to find what they are looking for if it is something specific and they do not want to go through all the other sites and links as well. It allows you to start your bid at the bottom and slowly work your way to the top of the list.</p>
|
||||
<p style="text-align: start">With a very low costing starting bid of just $1, you are guaranteed to have a spot in MTA’s successful directory list. When you would like to increase your bid to one of the top positions, you have to know that this would be a wise decision to make as it will not only get your link to be at a higher point in the directory but it will also give you a chance to have your site advertised with the rest of the top ten on the home page of the website. This means that when visitors come to <a target="_blank" rel="noopener noreferrer nofollow" class="nml__editor__content__link" href="http://MTAweb.com">MTAweb.com</a>, your site will be one of the first things they see. In other words, you stand a great chance at getting a comeback to your site sooner than you thought.</p>
|
||||
<p style="text-align: start"><strong>This is strong text.</strong></p>
|
||||
<p style="text-align: start"><em>This is italic text</em></p>
|
||||
<p style="text-align: start">This is underline text</p>
|
||||
<h4 class="nml__editor__content__heading" style="text-align: start">Unordered list</h4>
|
||||
<ul class="nml__editor__content__bullet__list">
|
||||
<li class="nml__editor__content__listItem">
|
||||
<p>Implements <a target="_blank" rel="noopener noreferrer nofollow" class="nml__editor__content__link" href="https://docs-minimals.vercel.app/introduction">This is an external link</a></p>
|
||||
</li>
|
||||
<li class="nml__editor__content__listItem">
|
||||
<p>Implements <a target="_blank" rel="noopener noreferrer nofollow" class="nml__editor__content__link" href="https://codebeautify.org/dashboard/blog">This is an inside link</a></p>
|
||||
</li>
|
||||
<li class="nml__editor__content__listItem">
|
||||
<p>Renders actual, "native" React DOM elements</p>
|
||||
</li>
|
||||
<li class="nml__editor__content__listItem">
|
||||
<p>Allows you to escape or skip HTML (try toggling the checkboxes above)</p>
|
||||
</li>
|
||||
<li class="nml__editor__content__listItem">
|
||||
<p>If you escape or skip the HTML, no dangerouslySetInnerHTML is used! Yay!</p>
|
||||
</li>
|
||||
</ul>
|
||||
<h4 class="nml__editor__content__heading" style="text-align: start">Ordered list</h4>
|
||||
<ol class="nml__editor__content__ordered__list">
|
||||
<li class="nml__editor__content__listItem">
|
||||
<p>Analysis</p>
|
||||
</li>
|
||||
<li class="nml__editor__content__listItem">
|
||||
<p>Design</p>
|
||||
</li>
|
||||
<li class="nml__editor__content__listItem">
|
||||
<p>Implementation</p>
|
||||
</li>
|
||||
</ol>
|
||||
<h4 class="nml__editor__content__heading" style="text-align: start">Blockquote</h4>
|
||||
<blockquote class="nml__editor__content__blockquote">
|
||||
<p>Life is short, Smile while you still have teeth! </p>
|
||||
</blockquote>
|
||||
<h4 class="nml__editor__content__heading" style="text-align: start"><br>Block code</h4>
|
||||
${codeBlock}
|
||||
<p>Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book. It has survived not only five centuries, but also the leap into electronic typesetting, remaining essentially unchanged. It was popularised in the 1960s with the release of Letraset sheets containing Lorem Ipsum passages, and more recently with desktop publishing software like Aldus PageMaker including versions of Lorem Ipsum.</p>
|
||||
<h5 class="nml__editor__content__heading" style="text-align: start">Why do we use it?</h5>
|
||||
<p style="text-align: start">It is a long established fact that a reader will be distracted by the readable content of a page when looking at its layout. The point of using Lorem Ipsum is that it has a more-or-less normal distribution of letters, as opposed to using 'Content here, content here', making it look like readable English. Many desktop publishing packages and web page editors now use Lorem Ipsum as their default model text, and a search for 'lorem ipsum' will uncover many web sites still in their infancy. Various versions have evolved over the years, sometimes by accident, sometimes on purpose (injected humour and the like).</p>
|
||||
<img class="nml__editor__content__image" src="${CONFIG.basePath}/assets/images/cover/cover-5.webp">
|
||||
<p>It is important that you buy links because the links are what get you the results that you want. The popularity of the links that are listed in the MTA directory is in fact one of the most important factors in the performance of the search engine. Links are important and this is why you have to purchase a link in order to bid on something and the best part is that a link will only cost you $1, which is nothing compared to what you would pay if you decided to do it through any other company or website.</p>
|
||||
<img class="nml__editor__content__image" src="${CONFIG.basePath}/assets/images/cover/cover-14.webp">
|
||||
`;
|
||||
|
||||
const generateComments = () => {
|
||||
const userList = Array.from({ length: 12 }, (_, index) => ({
|
||||
id: _mock.id(index),
|
||||
name: _mock.fullName(index),
|
||||
avatarUrl: _mock.image.avatar(index)
|
||||
}));
|
||||
|
||||
return [
|
||||
{
|
||||
// id: uuidv4(),
|
||||
name: userList[0].name,
|
||||
avatarUrl: userList[0].avatarUrl,
|
||||
message: _mock.sentence(1),
|
||||
postedAt: _mock.time(1),
|
||||
users: [userList[0], userList[1], userList[2]],
|
||||
replyComment: [
|
||||
{
|
||||
id: uuidv4(),
|
||||
userId: userList[1].id,
|
||||
message: _mock.sentence(2),
|
||||
postedAt: _mock.time(2)
|
||||
},
|
||||
{
|
||||
id: uuidv4(),
|
||||
userId: userList[0].id,
|
||||
message: _mock.sentence(3),
|
||||
tagUser: userList[1].name,
|
||||
postedAt: _mock.time(3)
|
||||
},
|
||||
{
|
||||
id: uuidv4(),
|
||||
userId: userList[2].id,
|
||||
message: _mock.sentence(4),
|
||||
postedAt: _mock.time(4)
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
// id: uuidv4(),
|
||||
name: userList[4].name,
|
||||
avatarUrl: userList[4].avatarUrl,
|
||||
message: _mock.sentence(5),
|
||||
postedAt: _mock.time(5),
|
||||
users: [userList[5], userList[6], userList[7]],
|
||||
replyComment: [
|
||||
{
|
||||
id: uuidv4(),
|
||||
userId: userList[5].id,
|
||||
message: _mock.sentence(6),
|
||||
postedAt: _mock.time(6)
|
||||
},
|
||||
{
|
||||
id: uuidv4(),
|
||||
userId: userList[6].id,
|
||||
message: _mock.sentence(7),
|
||||
postedAt: _mock.time(7)
|
||||
},
|
||||
{
|
||||
id: uuidv4(),
|
||||
userId: userList[7].id,
|
||||
message: _mock.sentence(8),
|
||||
postedAt: _mock.time(8)
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
// id: uuidv4(),
|
||||
name: userList[8].name,
|
||||
avatarUrl: userList[8].avatarUrl,
|
||||
message: _mock.sentence(9),
|
||||
postedAt: _mock.time(9),
|
||||
users: [],
|
||||
replyComment: []
|
||||
},
|
||||
{
|
||||
// id: uuidv4(),
|
||||
name: userList[9].name,
|
||||
avatarUrl: userList[9].avatarUrl,
|
||||
message: _mock.sentence(10),
|
||||
postedAt: _mock.time(10),
|
||||
users: [],
|
||||
replyComment: []
|
||||
}
|
||||
];
|
||||
};
|
||||
|
||||
const _posts = () =>
|
||||
Array.from({ length: 19 }, (_, index) => {
|
||||
const comments = generateComments();
|
||||
|
||||
const publish = index % 3 ? 'published' : 'draft';
|
||||
|
||||
const metaKeywords = _tags.slice(8, 11);
|
||||
|
||||
return {
|
||||
// id: _mock.id(index),
|
||||
publish,
|
||||
metaKeywords,
|
||||
content: CONTENT,
|
||||
tags: _tags.slice(0, 5),
|
||||
metaTitle: 'Minimal UI Kit',
|
||||
createdAt: _mock.time(index),
|
||||
title: _mock.postTitle(index),
|
||||
coverUrl: _mock.image.cover(index),
|
||||
totalViews: _mock.number.nativeL(index),
|
||||
totalShares: _mock.number.nativeL(index + 2),
|
||||
totalComments: _mock.number.nativeL(index + 1),
|
||||
totalFavorites: _mock.number.nativeL(index + 3),
|
||||
metaDescription: 'The starting point for your next project with Minimal UI Kit',
|
||||
description: `Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book. `,
|
||||
author: {
|
||||
name: _mock.fullName(index),
|
||||
avatarUrl: _mock.image.avatar(index)
|
||||
},
|
||||
favoritePerson: Array.from({ length: 20 }, (__, personIndex) => ({
|
||||
name: _mock.fullName(personIndex),
|
||||
avatarUrl: _mock.image.avatar(personIndex)
|
||||
})),
|
||||
//
|
||||
comments: {
|
||||
create: comments
|
||||
}
|
||||
};
|
||||
});
|
||||
|
||||
const temp_posts = _posts();
|
||||
|
||||
async function blog() {
|
||||
for (let i = 0; i < temp_posts.length; i++) {
|
||||
await prisma.postItem.upsert({
|
||||
where: { id: i },
|
||||
update: {},
|
||||
create: temp_posts[i]
|
||||
});
|
||||
}
|
||||
console.log('generate blog-postitem done');
|
||||
}
|
||||
|
||||
const Blog = blog()
|
||||
.then(async () => {
|
||||
await prisma.$disconnect();
|
||||
})
|
||||
.catch(async (e) => {
|
||||
console.error(e);
|
||||
await prisma.$disconnect();
|
||||
process.exit(1);
|
||||
});
|
||||
|
||||
export { Blog };
|
@@ -1,592 +0,0 @@
|
||||
// src/_mock/_blog.ts
|
||||
import { PrismaClient } from '@prisma/client';
|
||||
const prisma = new PrismaClient();
|
||||
import { uuidv4 } from './utils/uuidv4';
|
||||
import { _mock } from './_mock';
|
||||
import { CONFIG } from './global-config';
|
||||
import { _tags } from './assets';
|
||||
import { fSub } from './utils/set-date';
|
||||
import { fileList } from './_files.ts';
|
||||
|
||||
export const _contacts = () =>
|
||||
Array.from({ length: 20 }, (_, index) => ({
|
||||
id: _mock.id(index),
|
||||
role: _mock.role(index),
|
||||
email: _mock.email(index),
|
||||
name: _mock.fullName(index),
|
||||
lastActivity: _mock.time(index),
|
||||
address: _mock.fullAddress(index),
|
||||
avatarUrl: _mock.image.avatar(index),
|
||||
phoneNumber: _mock.phoneNumber(index),
|
||||
status:
|
||||
([0, 1, 6, 12].includes(index) && 'online') ||
|
||||
([3, 8, 14].includes(index) && 'offline') ||
|
||||
([4, 10, 16].includes(index) && 'busy') ||
|
||||
'always'
|
||||
}));
|
||||
|
||||
export const _conversations = () => {
|
||||
const myContact = {
|
||||
id: '8864c717-587d-472a-929a-8e5f298024da-0',
|
||||
role: 'admin',
|
||||
status: 'online',
|
||||
name: 'Jaydon Frankie',
|
||||
email: 'demo@minimals.cc',
|
||||
phoneNumber: '+40 777666555',
|
||||
address: '90210 Broadway Blvd',
|
||||
avatarUrl: _mock.image.avatar(24),
|
||||
lastActivity: fSub({ minutes: 1 })
|
||||
};
|
||||
|
||||
const files = fileList();
|
||||
|
||||
const otherContacts = _contacts();
|
||||
|
||||
return [
|
||||
{
|
||||
id: otherContacts[1].id,
|
||||
participants: [myContact, otherContacts[1]],
|
||||
type: 'ONE_TO_ONE',
|
||||
unreadCount: 0,
|
||||
messages: [
|
||||
{
|
||||
id: uuidv4(),
|
||||
senderId: otherContacts[1].id,
|
||||
body: _mock.sentence(1),
|
||||
contentType: 'text',
|
||||
attachments: files.slice(0, 1),
|
||||
createdAt: fSub({ hours: 5 })
|
||||
},
|
||||
{
|
||||
id: uuidv4(),
|
||||
senderId: myContact.id,
|
||||
body: _mock.sentence(2),
|
||||
contentType: 'text',
|
||||
attachments: files.slice(1, 2),
|
||||
createdAt: fSub({ hours: 4 })
|
||||
},
|
||||
{
|
||||
id: uuidv4(),
|
||||
senderId: otherContacts[1].id,
|
||||
body: _mock.sentence(3),
|
||||
contentType: 'text',
|
||||
attachments: files.slice(2, 3),
|
||||
createdAt: fSub({ hours: 3 })
|
||||
},
|
||||
{
|
||||
id: uuidv4(),
|
||||
senderId: myContact.id,
|
||||
body: _mock.sentence(4),
|
||||
contentType: 'text',
|
||||
attachments: files.slice(3, 6),
|
||||
createdAt: fSub({ hours: 2 })
|
||||
},
|
||||
{
|
||||
id: uuidv4(),
|
||||
senderId: otherContacts[1].id,
|
||||
body: _mock.sentence(5),
|
||||
contentType: 'text',
|
||||
attachments: files.slice(6, 10),
|
||||
createdAt: fSub({ hours: 1 })
|
||||
},
|
||||
{
|
||||
id: uuidv4(),
|
||||
senderId: otherContacts[1].id,
|
||||
attachments: [],
|
||||
contentType: 'image',
|
||||
body: _mock.image.cover(4),
|
||||
createdAt: fSub({ minutes: 15 })
|
||||
},
|
||||
{
|
||||
id: uuidv4(),
|
||||
senderId: myContact.id,
|
||||
contentType: 'text',
|
||||
attachments: [],
|
||||
body: _mock.sentence(6),
|
||||
createdAt: fSub({ minutes: 1 })
|
||||
},
|
||||
{
|
||||
id: uuidv4(),
|
||||
senderId: myContact.id,
|
||||
body: _mock.sentence(7),
|
||||
contentType: 'text',
|
||||
attachments: [],
|
||||
createdAt: fSub({ minutes: 0 })
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
id: otherContacts[2].id,
|
||||
participants: [myContact, otherContacts[2]],
|
||||
type: 'ONE_TO_ONE',
|
||||
unreadCount: 0,
|
||||
messages: [
|
||||
{
|
||||
id: uuidv4(),
|
||||
senderId: otherContacts[2].id,
|
||||
body: _mock.sentence(2),
|
||||
contentType: 'text',
|
||||
attachments: [],
|
||||
createdAt: fSub({ hours: 6 })
|
||||
},
|
||||
{
|
||||
id: uuidv4(),
|
||||
senderId: myContact.id,
|
||||
body: _mock.sentence(3),
|
||||
contentType: 'text',
|
||||
attachments: [],
|
||||
createdAt: fSub({ hours: 5 })
|
||||
},
|
||||
{
|
||||
id: uuidv4(),
|
||||
senderId: otherContacts[2].id,
|
||||
body: _mock.sentence(4),
|
||||
contentType: 'text',
|
||||
attachments: [],
|
||||
createdAt: fSub({ hours: 4 })
|
||||
},
|
||||
{
|
||||
id: uuidv4(),
|
||||
senderId: myContact.id,
|
||||
body: _mock.sentence(5),
|
||||
contentType: 'text',
|
||||
attachments: [],
|
||||
createdAt: fSub({ hours: 7 })
|
||||
},
|
||||
{
|
||||
id: uuidv4(),
|
||||
senderId: otherContacts[2].id,
|
||||
body: _mock.sentence(6),
|
||||
contentType: 'text',
|
||||
attachments: [],
|
||||
createdAt: fSub({ hours: 3 })
|
||||
},
|
||||
{
|
||||
id: uuidv4(),
|
||||
senderId: otherContacts[2].id,
|
||||
body: _mock.image.cover(7),
|
||||
attachments: [],
|
||||
contentType: 'image',
|
||||
createdAt: fSub({ hours: 2 })
|
||||
},
|
||||
{
|
||||
id: uuidv4(),
|
||||
senderId: myContact.id,
|
||||
body: _mock.sentence(8),
|
||||
contentType: 'text',
|
||||
attachments: [],
|
||||
createdAt: fSub({ hours: 1 })
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
id: otherContacts[3].id,
|
||||
participants: [myContact, otherContacts[3]],
|
||||
type: 'ONE_TO_ONE',
|
||||
unreadCount: 0,
|
||||
messages: [
|
||||
{
|
||||
id: uuidv4(),
|
||||
senderId: otherContacts[3].id,
|
||||
body: _mock.sentence(3),
|
||||
contentType: 'text',
|
||||
attachments: files.slice(0, 1),
|
||||
createdAt: fSub({ hours: 8 })
|
||||
},
|
||||
{
|
||||
id: uuidv4(),
|
||||
senderId: myContact.id,
|
||||
body: _mock.sentence(4),
|
||||
contentType: 'text',
|
||||
attachments: files.slice(1, 2),
|
||||
createdAt: fSub({ hours: 7 })
|
||||
},
|
||||
{
|
||||
id: uuidv4(),
|
||||
senderId: otherContacts[3].id,
|
||||
body: _mock.sentence(5),
|
||||
contentType: 'text',
|
||||
attachments: [],
|
||||
createdAt: fSub({ hours: 6 })
|
||||
},
|
||||
{
|
||||
id: uuidv4(),
|
||||
senderId: myContact.id,
|
||||
body: _mock.sentence(6),
|
||||
contentType: 'text',
|
||||
attachments: files.slice(2, 4),
|
||||
createdAt: fSub({ hours: 5 })
|
||||
},
|
||||
{
|
||||
id: uuidv4(),
|
||||
senderId: otherContacts[3].id,
|
||||
body: _mock.sentence(7),
|
||||
contentType: 'text',
|
||||
attachments: [],
|
||||
createdAt: fSub({ hours: 4 })
|
||||
},
|
||||
{
|
||||
id: uuidv4(),
|
||||
senderId: otherContacts[3].id,
|
||||
body: _mock.image.cover(8),
|
||||
contentType: 'image',
|
||||
attachments: [],
|
||||
createdAt: fSub({ hours: 3 })
|
||||
},
|
||||
{
|
||||
id: uuidv4(),
|
||||
senderId: otherContacts[3].id,
|
||||
body: _mock.image.cover(9),
|
||||
contentType: 'image',
|
||||
attachments: [],
|
||||
createdAt: fSub({ hours: 2 })
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
id: otherContacts[4].id,
|
||||
participants: [myContact, otherContacts[4]],
|
||||
type: 'ONE_TO_ONE',
|
||||
unreadCount: 8,
|
||||
messages: [
|
||||
{
|
||||
id: uuidv4(),
|
||||
senderId: otherContacts[4].id,
|
||||
body: _mock.sentence(4),
|
||||
contentType: 'text',
|
||||
attachments: files.slice(2, 4),
|
||||
createdAt: fSub({ hours: 4 })
|
||||
},
|
||||
{
|
||||
id: uuidv4(),
|
||||
senderId: myContact.id,
|
||||
body: _mock.sentence(5),
|
||||
contentType: 'text',
|
||||
attachments: files.slice(4, 6),
|
||||
createdAt: fSub({ hours: 3 })
|
||||
},
|
||||
{
|
||||
id: uuidv4(),
|
||||
senderId: otherContacts[4].id,
|
||||
body: _mock.sentence(6),
|
||||
contentType: 'text',
|
||||
attachments: [],
|
||||
createdAt: fSub({ hours: 2 })
|
||||
},
|
||||
{
|
||||
id: uuidv4(),
|
||||
senderId: myContact.id,
|
||||
body: _mock.sentence(7),
|
||||
contentType: 'text',
|
||||
attachments: [],
|
||||
createdAt: fSub({ hours: 1 })
|
||||
},
|
||||
{
|
||||
id: uuidv4(),
|
||||
senderId: myContact.id,
|
||||
body: _mock.sentence(8),
|
||||
contentType: 'text',
|
||||
attachments: files.slice(6, 10),
|
||||
createdAt: fSub({ minutes: 45 })
|
||||
},
|
||||
{
|
||||
id: uuidv4(),
|
||||
senderId: otherContacts[4].id,
|
||||
body: _mock.sentence(9),
|
||||
contentType: 'text',
|
||||
attachments: [],
|
||||
createdAt: fSub({ minutes: 5 })
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
id: otherContacts[5].id,
|
||||
participants: [myContact, otherContacts[5]],
|
||||
type: 'ONE_TO_ONE',
|
||||
unreadCount: 0,
|
||||
messages: [
|
||||
{
|
||||
id: uuidv4(),
|
||||
senderId: myContact.id,
|
||||
body: _mock.sentence(5),
|
||||
contentType: 'text',
|
||||
attachments: [],
|
||||
createdAt: fSub({ minutes: 5 })
|
||||
},
|
||||
{
|
||||
id: uuidv4(),
|
||||
senderId: otherContacts[5].id,
|
||||
body: _mock.sentence(6),
|
||||
contentType: 'text',
|
||||
attachments: [],
|
||||
createdAt: fSub({ seconds: 30 })
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
id: otherContacts[6].id,
|
||||
participants: [myContact, otherContacts[6]],
|
||||
type: 'ONE_TO_ONE',
|
||||
unreadCount: 0,
|
||||
messages: [
|
||||
{
|
||||
id: uuidv4(),
|
||||
senderId: myContact.id,
|
||||
body: _mock.sentence(6),
|
||||
contentType: 'text',
|
||||
attachments: [],
|
||||
createdAt: fSub({ hours: 2 })
|
||||
},
|
||||
{
|
||||
id: uuidv4(),
|
||||
senderId: otherContacts[6].id,
|
||||
body: _mock.sentence(7),
|
||||
contentType: 'text',
|
||||
attachments: [],
|
||||
createdAt: fSub({ hours: 1 })
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
id: `${_mock.id(1)}gr`,
|
||||
participants: [myContact, ...otherContacts.slice(6, 11)],
|
||||
type: 'GROUP',
|
||||
unreadCount: 2,
|
||||
messages: [
|
||||
{
|
||||
id: uuidv4(),
|
||||
senderId: myContact.id,
|
||||
body: _mock.sentence(6),
|
||||
contentType: 'text',
|
||||
attachments: [],
|
||||
createdAt: fSub({ hours: 5 })
|
||||
},
|
||||
{
|
||||
id: uuidv4(),
|
||||
senderId: otherContacts[9].id,
|
||||
body: _mock.sentence(7),
|
||||
contentType: 'text',
|
||||
attachments: [],
|
||||
createdAt: fSub({ hours: 4 })
|
||||
},
|
||||
{
|
||||
id: uuidv4(),
|
||||
senderId: otherContacts[10].id,
|
||||
body: _mock.sentence(8),
|
||||
contentType: 'text',
|
||||
attachments: [],
|
||||
createdAt: fSub({ hours: 3 })
|
||||
},
|
||||
{
|
||||
id: uuidv4(),
|
||||
senderId: otherContacts[8].id,
|
||||
body: _mock.sentence(9),
|
||||
contentType: 'text',
|
||||
attachments: [],
|
||||
createdAt: fSub({ hours: 2 })
|
||||
},
|
||||
{
|
||||
id: uuidv4(),
|
||||
senderId: myContact.id,
|
||||
attachments: [],
|
||||
body: _mock.sentence(10),
|
||||
contentType: 'text',
|
||||
createdAt: fSub({ hours: 1 })
|
||||
},
|
||||
{
|
||||
id: uuidv4(),
|
||||
senderId: otherContacts[6].id,
|
||||
body: _mock.sentence(11),
|
||||
contentType: 'text',
|
||||
attachments: [],
|
||||
createdAt: fSub({ minutes: 5 })
|
||||
},
|
||||
{
|
||||
id: uuidv4(),
|
||||
senderId: otherContacts[7].id,
|
||||
body: _mock.sentence(12),
|
||||
contentType: 'text',
|
||||
attachments: [],
|
||||
createdAt: fSub({ seconds: 30 })
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
id: otherContacts[7].id,
|
||||
participants: [myContact, otherContacts[7]],
|
||||
type: 'ONE_TO_ONE',
|
||||
unreadCount: 0,
|
||||
messages: [
|
||||
{
|
||||
id: uuidv4(),
|
||||
senderId: myContact.id,
|
||||
body: _mock.sentence(7),
|
||||
contentType: 'text',
|
||||
attachments: [],
|
||||
createdAt: fSub({ days: 4 })
|
||||
},
|
||||
{
|
||||
id: uuidv4(),
|
||||
senderId: otherContacts[7].id,
|
||||
body: _mock.sentence(8),
|
||||
contentType: 'text',
|
||||
attachments: [],
|
||||
createdAt: fSub({ days: 3 })
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
id: otherContacts[8].id,
|
||||
participants: [myContact, otherContacts[8]],
|
||||
type: 'ONE_TO_ONE',
|
||||
unreadCount: 0,
|
||||
messages: [
|
||||
{
|
||||
id: uuidv4(),
|
||||
senderId: myContact.id,
|
||||
body: _mock.sentence(8),
|
||||
contentType: 'text',
|
||||
attachments: [],
|
||||
createdAt: fSub({ hours: 9 })
|
||||
},
|
||||
{
|
||||
id: uuidv4(),
|
||||
senderId: otherContacts[8].id,
|
||||
body: _mock.sentence(9),
|
||||
contentType: 'text',
|
||||
attachments: [],
|
||||
createdAt: fSub({ hours: 8 })
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
id: otherContacts[9].id,
|
||||
participants: [myContact, otherContacts[9]],
|
||||
type: 'ONE_TO_ONE',
|
||||
unreadCount: 0,
|
||||
messages: [
|
||||
{
|
||||
id: uuidv4(),
|
||||
senderId: myContact.id,
|
||||
body: _mock.sentence(9),
|
||||
contentType: 'text',
|
||||
attachments: [],
|
||||
createdAt: fSub({ hours: 5 })
|
||||
},
|
||||
{
|
||||
id: uuidv4(),
|
||||
senderId: otherContacts[9].id,
|
||||
body: _mock.sentence(10),
|
||||
contentType: 'text',
|
||||
attachments: [],
|
||||
createdAt: fSub({ hours: 3 })
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
id: `${_mock.id(2)}gr`,
|
||||
participants: [myContact, ...otherContacts.slice(1, 5)],
|
||||
type: 'GROUP',
|
||||
unreadCount: 0,
|
||||
messages: [
|
||||
{
|
||||
id: uuidv4(),
|
||||
senderId: myContact.id,
|
||||
body: _mock.sentence(1),
|
||||
contentType: 'text',
|
||||
attachments: files.slice(0, 5),
|
||||
createdAt: fSub({ hours: 4 })
|
||||
},
|
||||
{
|
||||
id: uuidv4(),
|
||||
senderId: otherContacts[1].id,
|
||||
body: _mock.sentence(2),
|
||||
contentType: 'text',
|
||||
attachments: files.slice(5, 6),
|
||||
createdAt: fSub({ hours: 3 })
|
||||
},
|
||||
{
|
||||
id: uuidv4(),
|
||||
senderId: otherContacts[2].id,
|
||||
body: _mock.sentence(3),
|
||||
contentType: 'text',
|
||||
attachments: files.slice(6, 7),
|
||||
createdAt: fSub({ hours: 2 })
|
||||
},
|
||||
{
|
||||
id: uuidv4(),
|
||||
senderId: otherContacts[4].id,
|
||||
body: _mock.sentence(4),
|
||||
contentType: 'text',
|
||||
attachments: files.slice(7, 8),
|
||||
createdAt: fSub({ hours: 1 })
|
||||
},
|
||||
{
|
||||
id: uuidv4(),
|
||||
senderId: myContact.id,
|
||||
body: _mock.sentence(5),
|
||||
contentType: 'text',
|
||||
attachments: files.slice(8, 9),
|
||||
createdAt: fSub({ minutes: 30 })
|
||||
},
|
||||
{
|
||||
id: uuidv4(),
|
||||
senderId: otherContacts[3].id,
|
||||
body: _mock.sentence(6),
|
||||
contentType: 'text',
|
||||
attachments: files.slice(9, 10),
|
||||
createdAt: fSub({ minutes: 10 })
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
id: otherContacts[10].id,
|
||||
participants: [myContact, otherContacts[10]],
|
||||
type: 'ONE_TO_ONE',
|
||||
unreadCount: 0,
|
||||
messages: [
|
||||
{
|
||||
id: uuidv4(),
|
||||
senderId: myContact.id,
|
||||
body: _mock.sentence(10),
|
||||
contentType: 'text',
|
||||
attachments: [],
|
||||
createdAt: fSub({ days: 11 })
|
||||
},
|
||||
{
|
||||
id: uuidv4(),
|
||||
senderId: otherContacts[10].id,
|
||||
body: _mock.sentence(11),
|
||||
contentType: 'text',
|
||||
attachments: [],
|
||||
createdAt: fSub({ days: 10 })
|
||||
}
|
||||
]
|
||||
}
|
||||
];
|
||||
};
|
||||
|
||||
const temp_conversations = _conversations();
|
||||
|
||||
async function chat() {
|
||||
for (let i = 0; i < temp_conversations.length; i++) {
|
||||
await prisma.chatMessage.upsert({
|
||||
where: { id: i },
|
||||
update: {},
|
||||
create: temp_conversations[i]
|
||||
});
|
||||
}
|
||||
console.log('generate blog-postitem done');
|
||||
}
|
||||
|
||||
const Chat = chat()
|
||||
.then(async () => {
|
||||
await prisma.$disconnect();
|
||||
})
|
||||
.catch(async (e) => {
|
||||
console.error(e);
|
||||
await prisma.$disconnect();
|
||||
process.exit(1);
|
||||
});
|
||||
|
||||
export { Chat };
|
@@ -1,66 +0,0 @@
|
||||
{
|
||||
"primary": {
|
||||
"lighter": "#C8FAD6",
|
||||
"light": "#5BE49B",
|
||||
"main": "#00A76F",
|
||||
"dark": "#007867",
|
||||
"darker": "#004B50",
|
||||
"contrastText": "#FFFFFF"
|
||||
},
|
||||
"secondary": {
|
||||
"lighter": "#EFD6FF",
|
||||
"light": "#C684FF",
|
||||
"main": "#8E33FF",
|
||||
"dark": "#5119B7",
|
||||
"darker": "#27097A",
|
||||
"contrastText": "#FFFFFF"
|
||||
},
|
||||
"info": {
|
||||
"lighter": "#CAFDF5",
|
||||
"light": "#61F3F3",
|
||||
"main": "#00B8D9",
|
||||
"dark": "#006C9C",
|
||||
"darker": "#003768",
|
||||
"contrastText": "#FFFFFF"
|
||||
},
|
||||
"success": {
|
||||
"lighter": "#D3FCD2",
|
||||
"light": "#77ED8B",
|
||||
"main": "#22C55E",
|
||||
"dark": "#118D57",
|
||||
"darker": "#065E49",
|
||||
"contrastText": "#ffffff"
|
||||
},
|
||||
"warning": {
|
||||
"lighter": "#FFF5CC",
|
||||
"light": "#FFD666",
|
||||
"main": "#FFAB00",
|
||||
"dark": "#B76E00",
|
||||
"darker": "#7A4100",
|
||||
"contrastText": "#1C252E"
|
||||
},
|
||||
"error": {
|
||||
"lighter": "#FFE9D5",
|
||||
"light": "#FFAC82",
|
||||
"main": "#FF5630",
|
||||
"dark": "#B71D18",
|
||||
"darker": "#7A0916",
|
||||
"contrastText": "#FFFFFF"
|
||||
},
|
||||
"grey": {
|
||||
"50": "#FCFDFD",
|
||||
"100": "#F9FAFB",
|
||||
"200": "#F4F6F8",
|
||||
"300": "#DFE3E8",
|
||||
"400": "#C4CDD5",
|
||||
"500": "#919EAB",
|
||||
"600": "#637381",
|
||||
"700": "#454F5B",
|
||||
"800": "#1C252E",
|
||||
"900": "#141A21"
|
||||
},
|
||||
"common": {
|
||||
"black": "#000000",
|
||||
"white": "#FFFFFF"
|
||||
}
|
||||
}
|
@@ -1,76 +0,0 @@
|
||||
// src/_mock/_files.ts
|
||||
//
|
||||
import { _mock } from './_mock';
|
||||
import { _fileNames } from './assets';
|
||||
//
|
||||
import { PrismaClient } from '@prisma/client';
|
||||
const prisma = new PrismaClient();
|
||||
//
|
||||
|
||||
const GB = 1000000000 * 24;
|
||||
|
||||
const URLS = [
|
||||
_mock.image.cover(2),
|
||||
'https://www.cloud.com/s/c218bo6kjuqyv66/design_suriname_2015.mp3',
|
||||
'https://www.cloud.com/s/c218bo6kjuqyv66/expertise_2015_conakry_sao-tome-and-principe_gender.mp4',
|
||||
'https://www.cloud.com/s/c218bo6kjuqyv66/money-popup-crack.pdf',
|
||||
_mock.image.cover(3),
|
||||
_mock.image.cover(5),
|
||||
'https://www.cloud.com/s/c218bo6kjuqyv66/large_news.txt',
|
||||
'https://www.cloud.com/s/c218bo6kjuqyv66/nauru-6015-small-fighter-left-gender.psd',
|
||||
'https://www.cloud.com/s/c218bo6kjuqyv66/tv-xs.doc',
|
||||
'https://www.cloud.com/s/c218bo6kjuqyv66/gustavia-entertainment-productivity.docx',
|
||||
'https://www.cloud.com/s/c218bo6kjuqyv66/vintage_bahrain_saipan.xls',
|
||||
'https://www.cloud.com/s/c218bo6kjuqyv66/indonesia-quito-nancy-grace-left-glad.xlsx',
|
||||
'https://www.cloud.com/s/c218bo6kjuqyv66/legislation-grain.zip',
|
||||
'https://www.cloud.com/s/c218bo6kjuqyv66/large_energy_dry_philippines.rar',
|
||||
'https://www.cloud.com/s/c218bo6kjuqyv66/footer-243-ecuador.iso',
|
||||
'https://www.cloud.com/s/c218bo6kjuqyv66/kyrgyzstan-04795009-picabo-street-guide-style.ai',
|
||||
'https://www.cloud.com/s/c218bo6kjuqyv66/india-data-large-gk-chesterton-mother.esp',
|
||||
'https://www.cloud.com/s/c218bo6kjuqyv66/footer-barbados-celine-dion.ppt',
|
||||
'https://www.cloud.com/s/c218bo6kjuqyv66/socio_respectively_366996.pptx',
|
||||
'https://www.cloud.com/s/c218bo6kjuqyv66/socio_ahead_531437_sweden_popup.wav',
|
||||
'https://www.cloud.com/s/c218bo6kjuqyv66/trinidad_samuel-morse_bring.m4v',
|
||||
_mock.image.cover(11),
|
||||
_mock.image.cover(17),
|
||||
'https://www.cloud.com/s/c218bo6kjuqyv66/xl_david-blaine_component_tanzania_books.pdf'
|
||||
];
|
||||
|
||||
// ----------------------------------------------------------------------
|
||||
|
||||
export const genFileList = () =>
|
||||
_fileNames.map((name, index) => ({
|
||||
// id: _mock.id(index),
|
||||
// createdAt: _mock.time(index),
|
||||
//
|
||||
name,
|
||||
path: URLS[index],
|
||||
preview: URLS[index],
|
||||
size: GB / ((index + 1) * 500),
|
||||
modifiedAt: _mock.time(index),
|
||||
type: `${name.split('.').pop()}`
|
||||
}));
|
||||
|
||||
const temp_file_list = genFileList();
|
||||
|
||||
async function fileList() {
|
||||
for (let i = 0; i < temp_file_list.length; i++) {
|
||||
await prisma.fileStore.upsert({
|
||||
where: { id: i },
|
||||
update: {},
|
||||
create: temp_file_list[i]
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
const File = fileList()
|
||||
.then(async () => {
|
||||
await prisma.$disconnect();
|
||||
})
|
||||
.catch(async (e) => {
|
||||
console.error(e);
|
||||
await prisma.$disconnect();
|
||||
process.exit(1);
|
||||
});
|
||||
|
||||
export { File };
|
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user