Skip to content

Commit 7cdbfb3

Browse files
authored
Merge pull request #54 from sourcefuse/GH-20-C
feat(arc-doc):Backend integration documentation
2 parents 331e5d7 + 31dfb3b commit 7cdbfb3

File tree

16 files changed

+137
-64
lines changed

16 files changed

+137
-64
lines changed

angular.json

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -202,6 +202,14 @@
202202
"glob": "**/*",
203203
"input": "projects/arc-lib/src/lib/assets/",
204204
"output": "/assets/"
205+
206+
},
207+
{
208+
"glob": "**/*",
209+
"input": "projects/arc-docs/src/assets/",
210+
"output": "/assets/"
211+
212+
205213
}
206214
],
207215

projects/arc-docs/src/app/constants/docs-menu.contant.ts renamed to projects/arc-docs/src/app/constants/docs-menu.constant.ts

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,22 @@ export const DOCUMENTATION_MENU_ITEMS = [
1919
},
2020
{
2121
title: 'Backend Integration',
22+
link: '/docs/guide/backend-integration',
23+
},
24+
],
25+
},
26+
27+
{
28+
title: 'Auth',
29+
icon: 'book-outline',
30+
children: [
31+
{
32+
title: 'Introduction',
33+
link: '/docs/auth-doc/authDocIntro',
34+
},
35+
{
36+
title: 'Installation',
37+
link: '/docs/auth-doc/installation',
2238
},
2339
],
2440
},

projects/arc-docs/src/app/docs/docs.component.scss

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,6 @@
6565
}
6666
}
6767

68-
6968
.header-wrapper {
7069
width: 100%;
7170
}

projects/arc-docs/src/app/docs/docs.component.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,8 @@ import {RouteComponentBaseDirective} from '@project-lib/core/route-component-bas
66
import {IconPacksManagerService} from '@project-lib/theme/services';
77
import {takeUntil} from 'rxjs';
88
import {Location} from '@angular/common';
9-
import {DOCUMENTATION_MENU_ITEMS} from '../constants/docs-menu.contant';
9+
10+
import {DOCUMENTATION_MENU_ITEMS} from '../constants/docs-menu.constant';
1011

1112
@Component({
1213
selector: 'app-docs',
Original file line numberDiff line numberDiff line change
@@ -1 +1,66 @@
1-
<p>backend-integration-doc works!</p>
1+
<div class="intro-wrapper">
2+
<div class="1st-phase">
3+
<nb-card>
4+
<nb-card-header fixed>
5+
<h2 class="nb-card-header-title">Overview</h2>
6+
</nb-card-header>
7+
<nb-card-body>
8+
<p>
9+
This guide provides the necessary steps to integrate a frontend
10+
application with a backend authentication service. It includes
11+
boilerplate code to ensure a smooth setup and usage of the
12+
authentication service without needing a backend developer.
13+
</p>
14+
</nb-card-body>
15+
</nb-card>
16+
17+
<nb-card>
18+
<nb-card-header fixed>
19+
<h2 class="nb-card-header-title">Prerequisites</h2>
20+
</nb-card-header>
21+
<nb-card-body>
22+
<ul>
23+
<li>Node.js and npm installed</li>
24+
<li>Angular CLI installed</li>
25+
<li>A data source installed (e.g., PostgreSQL, MySQL.)</li>
26+
<li>Redis installed</li>
27+
<li>Basic knowledge of Angular and REST APIs</li>
28+
</ul>
29+
</nb-card-body>
30+
</nb-card>
31+
32+
<nb-card>
33+
<nb-card-header fixed>
34+
<h2 class="nb-card-header-title">Backend-setup</h2>
35+
</nb-card-header>
36+
<nb-card-body>
37+
<ol>
38+
<li>
39+
Before proceeding, ensure you have completed the initial backend
40+
setup. If you haven't done so, please follow the
41+
<a
42+
href="https://github.com/sourcefuse/loopback4-microservice-catalog/tree/master/services/authentication-service"
43+
>Backend Setup Documentation </a
44+
>.
45+
</li>
46+
<li>Environment Variables</li>
47+
<p>
48+
Create a .env file in the root of your project to store your
49+
environment variables. This file contains configuration settings for
50+
your database, Redis, and other necessary environment variables.
51+
</p>
52+
Example .env File Create a file named .env and add the following
53+
content:
54+
<div *ngFor="let env of envVariables">
55+
<lib-cli-wrapper [command]="env.command"> </lib-cli-wrapper>
56+
</div>
57+
58+
<li>Run the application:</li>
59+
<div *ngFor="let server of runServer">
60+
<lib-cli-wrapper [command]="server.command"> </lib-cli-wrapper>
61+
</div>
62+
</ol>
63+
</nb-card-body>
64+
</nb-card>
65+
</div>
66+
</div>

projects/arc-docs/src/app/docs/guide/components/backend-integration-doc/backend-integration-doc.component.ts

Lines changed: 34 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,4 +5,37 @@ import {Component} from '@angular/core';
55
templateUrl: './backend-integration-doc.component.html',
66
styleUrls: ['./backend-integration-doc.component.scss'],
77
})
8-
export class BackendIntegrationDocComponent {}
8+
export class BackendIntegrationDocComponent {
9+
DataList: object[] = [
10+
{
11+
lable: 'Install LoopBack CLI if you haven’t already:',
12+
listData: 'npm install -g @loopback/cli',
13+
},
14+
{
15+
lable: 'Create a new LoopBack application:',
16+
listData: 'lb4 app testapp',
17+
},
18+
];
19+
20+
runServer: object[] = [
21+
{
22+
command: 'ng serve',
23+
},
24+
];
25+
26+
envVariables: object[] = [
27+
{
28+
command: `export const environment = {
29+
production: false,
30+
clientId: '',
31+
publicKey: '',
32+
homePath: '/main/home',
33+
baseApiUrl: '',
34+
authServiceUrl: '',
35+
userServiceUrl: '',
36+
logLevel: 5,
37+
};
38+
`,
39+
},
40+
];
41+
}

projects/arc-docs/src/app/docs/guide/guide-routing.module.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,10 @@ const routes: Routes = [
1313
path: 'clone',
1414
component: CloneBoilerplateDocComponent,
1515
},
16+
{
17+
path: 'backend-integration',
18+
component: BackendIntegrationDocComponent,
19+
},
1620
];
1721

1822
@NgModule({

projects/arc-docs/src/styles.scss

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,6 @@ router-outlet.main-router + * {
6060
}
6161
}
6262

63-
6463
.footer {
6564
color: #525252;
6665
a {

projects/arc-docs/src/themes.scss

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@
44
@use '@nebular/theme/styles/themes/default';
55
@import 'index';
66

7-
87
@font-face {
98
font-family: 'Montserrat';
109
src: url('../../arc-lib/src/lib/assets/fonts/montserrat/Montserrat-Regular.otf')

projects/arc-lib/src/lib/components/cli-wrapper/cli-wrapper.component.html

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
21
<div class="cli-wrapper">
32
<div class="cli">
43
<div class="cli-header">

0 commit comments

Comments
 (0)