Skip to content

Commit e1f9cad

Browse files
committed
fix:\updated changes in reaadme as well as code
1 parent b090d38 commit e1f9cad

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

54 files changed

+409
-368
lines changed

README.md

Lines changed: 86 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -1,72 +1,116 @@
1-
# Sourceloop Angular Multi Project Application
1+
# Angular Boilerplate
2+
[![Version](https://img.shields.io/badge/@angular/core-v14-brightgreen)](http://commitizen.github.io/cz-cli/)
23

34
<!-- DOCUMENTATION -->
45

56
# Description
67

7-
- We are using multiple projects in one Angular environment so that we can help users to improve
8-
code reusability, scalability, maintainability, and customization. It can also help in increase productivity, reduce risks, and improve the quality of application.
8+
- The boilerplate using multiple projects in one Angular environment so that the boilerplate help users
9+
to improve code reusability, scalability, maintainability, and customization. It can also help in increase productivity, reduce risks, and improve the quality of application.
910

10-
- Code Reusability: I have multiple applications or parts of applications that share common functionality,
11-
using multiple projects can help you avoid duplicating code. You can create a shared library project and use it across all the projects. This approach can help you maintain consistency and reduce code duplication.
11+
- The multiple applications or parts of applications that share common functionality, using multiple
12+
projects can help you avoid duplicating code. You can create a shared library project and use it across all the projects. This approach can help you maintain consistency and reduce code duplication.
1213

13-
- Isolation: Each project can be developed and tested independently, which allows you to isolate changes and
14-
minimize the risk of breaking other parts of the application. This approach can help you increase productivity and reduce the time spent on debugging and fixing issues.
14+
Following are the steps to get started with it:
1515

16-
- Scalability: As your application grows, it can become more complex and harder to maintain. Using multiple
17-
projects can help you manage complexity by breaking down the application into smaller, more manageable pieces. You can also use different teams to work on different projects, which can help you scale the development process.
16+
# Prerequisite
1817

19-
- Customization: Each project can have its own configuration and dependencies, which allows to
20-
customize the build process and optimize each project for its specific use case. This approach can help to improve the performance and reduce the size of the application.
18+
#### Step 1: Install NodeJS
19+
20+
Install the latest LTS version from here: https://nodejs.org/en/download/.
21+
22+
#### Step 2: Install Angular CLI
23+
24+
Angular provides a very useful command line utility that help in easily developing angular applications, models, services, etc. as a boilerplate, which saves a lot of time.
25+
26+
```sh
27+
npm install -g @angular/cli
28+
```
29+
30+
#### step 3 : Install Nebular
31+
32+
Similarly Angular also Provides Nebular which supports init configuration with Angular Schematics. This means you can simply add it to your project, and Angular Schematics will do the rest
33+
34+
```sh
35+
ng add @nebular/theme
36+
```
37+
38+
After this, it will take a few minutes to set everything up, once that is done, you will see a folder structure generated like below:
39+
40+
```
41+
BOILER-PLATE
42+
├── .github
43+
├── .husky
44+
├── projects
45+
├── .czferc.js
46+
├── .npmrc
47+
├── .cz-config.js
48+
├── .gitignore
49+
├── commitlint.config.js
50+
├── CODE_OF_CONDUCT.md
51+
├── lerna.json
52+
├── package-lock.json
53+
├── package.json
54+
├── README.md
55+
└── tsconfig.json
56+
```
57+
As can be seen above, scaffold has initialized and set up a lot, such as:
58+
59+
1. GitHub PR template inside `.github`
60+
2. Conventional commits enablement using commitizen (`.cz-config.js`), commitlint (`commitlint-config.js`) and husky for githooks.
61+
3. `.gitignore` for ignoring files from source code. Important for secure coding and keeping the repo clean on SCM (git)
62+
4. `lerna.json` which contains the setup for lerna commands. Lerna is going to be our monorepo manager and build tool going forward. It is one of the most popular monorepo managers in the industry, used by Jest, NestJS, LoopBack, and Nx.
63+
5. `package.json` and `package-lock.json` for npm to work.
64+
6. The folder named `projects`:
65+
- Projects will hold the multi application pattern and will always be completely independent
66+
67+
#### Step 4: The Structure is main project folder
68+
69+
```
70+
PROJECTS
71+
├── arc
72+
├── arc-lib
73+
│ └── src
74+
└──lib
75+
│ ├── assets
76+
│ ├── components
77+
│ ├── core
78+
│ └── theme
79+
├── (...other files)
80+
```
2181

2282
# Projects
23-
2483
1. Arc:
25-
- This boilerplate project is a project set up that can be easily altered to create new projects. The user
26-
is able to use in the original project, its foundation, and its structure to set up a new one without changing the original.
27-
28-
- This project is based on Angular CLI on version 14.0.0.
84+
- This boilerplate arc project is a project set up that can be easily altered to create new projects.
85+
The user is able to use in the original project, its foundation, and its structure to set up a new one without changing the original.
2986

3087
FOR further reference you can refer [here]()
3188

3289
2. Arc-Lib
33-
- A shared library can include components, services, pipes, directives, and other modules that can be used
34-
by other projects in the workspace. By using a shared library, you can avoid duplicating code and functionality across multiple projects, which can save time and effort.
90+
- A arc-lib shared library can include components, services, pipes, directives, and other modules that can be used by other projects in the workspace. By using a shared library, we avoid duplicating code and functionality across multiple projects, which can save time and effort.
3591

3692
For further reference you can refer [here](../arc-sf/projects/arc-lib/README.md)
3793

38-
# Prerequisite
39-
40-
Run `npm install -g @angular/cli` for Angular CLI & NPM installed
41-
Run `npm i @angular/material` for Angular material
42-
43-
# MainProject
44-
45-
This project was generated with [Angular CLI](https://github.com/angular/angular-cli) version 15.2.6.
46-
47-
# Code scaffolding
48-
49-
Run ng generate component component-name to generate a new component. You can also use ng generate directive|pipe|service|class|guard|interface|enum|module.
50-
51-
1. Create a workspace
52-
ng new <workspace-name> --no-create-application
5394

54-
2. Generate applications/projects
55-
ng generate application <application-name>
95+
### Step 5: Start the Server
5696

57-
3. Generate a library - which will act as a shared util/files/pages
58-
ng generate library <library-name>
97+
Go to the terminal and change the directory into your service folder:
5998

99+
```sh
100+
ng serve
101+
```
60102

61-
## Development server
103+
You'll see a message saying `Server is running at http://localhost:4200/` Navigate to this URL. The application will automatically reload if you change any of the source files.
62104

63-
Run `ng serve` for a dev server. Navigate to `http://localhost:4200/`. The application will automatically reload if you change any of the source files.
105+
### Step 6: Build the Application
64106

65-
## Build
107+
To build the project. The build artifacts will be stored in the `dist/` directory.
66108

67-
Run `ng build` to build the project. The build artifacts will be stored in the `dist/` directory.
109+
```sh
110+
ng build
111+
```
68112

69-
## Running unit tests
113+
### Running unit tests
70114

71115
Run `ng test` to execute the unit tests via [Karma](https://karma-runner.github.io).
72116

projects/arc-lib/README.md

Lines changed: 35 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -1,35 +1,31 @@
1-
# Sourceloop Shared Library
2-
3-
<!-- DOCUMENTATION -->
1+
# arc Shared-Library
42

53
# Description
64

75
- In an Angular multiproject workspace, a shared library is a package that contains reusable code and
86
functionality that can be used across multiple projects within the workspace.
97

10-
- A shared library can include components, services, pipes, directives, and other modules that can be used
11-
by other projects in the workspace. By using a shared library, you can avoid duplicating code and functionality across multiple projects, which can save time and effort.
8+
- A shared library can include components, services, pipes, directives, and other modules that can be
9+
used by other projects in the workspace. By using a shared library, you can avoid duplicating code and functionality across multiple projects, which can save time and effort.
1210

1311
- By separating your reusable code into a shared library, you can also maintain consistency and
1412
standardization across your projects. If you need to make changes to the shared code, you can update the library and all projects that use it will be automatically updated as well. a shared library is a powerful tool for managing code and functionality in an Angular multiproject workspace, and can help improve code quality, reduce duplication, and increase productivity.
1513

16-
This project is based on Angular CLI on version 14.0.0.
17-
18-
# Prerequisite
19-
20-
Run `npm install -g @angular/cli` for Angular CLI & NPM installed
21-
Run `npm i @angular/material` for Angular material
22-
23-
# Code scaffolding
14+
### Structure of the arc-lib is
2415

25-
Run ng generate component component-name to generate a new component. You can also use `ng generate directive|pipe|service|class|guard|interface|enum|module`.
16+
The Structure of the arc-lib is as follows
17+
```
18+
├── arc-lib
19+
│ └── src
20+
└──lib
21+
│ ├── assets
22+
│ ├── components
23+
│ ├── core
24+
│ └── theme
25+
```
2626

27-
Generate a library - which will act as a shared util/files/pages
28-
ng generate library <library-name>
29-
30-
## Project Features
31-
32-
Angular shared library provides various features and components to help developers get started with their projects quickly. Here are some of the features and components that provides:
27+
- Angular arc library provides various features and components to help developers get started with
28+
their projects quickly. Here are some of the features and components that provides:
3329

3430
# Core Module:
3531

@@ -42,7 +38,7 @@ Angular shared library provides various features and components to help develop
4238
`get-list-api.command`,`patch-api.command`,`post-api.command` and `put-api.command`.These are used for modifying the data through API.These serves as a base class for other classes that inherit from it and provide specific implementation details.
4339

4440
- Models: We are using 3 models named `count.model`,`named-id-required.model` and
45-
`named-id. model`. In these models we are using model based validations.
41+
`named-id. model`. In these models The boilerplate usingmodel based validations.
4642

4743
## Auth:
4844

@@ -72,46 +68,42 @@ We are using 2 decorators named `required.decorator` and `validate.decorator`.
7268

7369
## Interceptors:
7470

75-
We are using 3 Interceptors named `auth.interceptor`,`error.interceptor` and `session-recovery.interceptor`. These interceptors are responsible for adding an authorization header to requests that require authentication, checks for errors that occur during HTTP requests and
71+
The boilerplate using 3 Interceptors named `auth.interceptor`,`error.interceptor` and `session-recovery.interceptor`. These interceptors are responsible for adding an authorization header to requests that require authentication, checks for errors that occur during HTTP requests and
7672
displays error messages and also refreshes the user's authentication token when the session gets expired.
7773

7874
## Localization:
7975

80-
We are using i18n module as a language translator where we are using 3 files as follows :
76+
The boilerplate using i18n module as a language translator where The boilerplate using 3 files as follows :
8177

8278
- Enums: `language.enum` defines the set of named values for various languages.
8379

84-
- Module: We are using `localization.module` while using the module we are using data from enum
85-
too and according to enums value we translate the language and `translation service` is called
80+
- Module: The boilerplate using `localization.module` while using the module The boilerplate using data from enum too and according to enums value we translate the language and `translation service`
8681

8782
- Service: The translationService provides localization functionality to the application. It
8883
depends on `@ngx-translate/core` library to handle translations allowing users to select their preferred language for the application & to provide appropriate translations based on that preference.
8984

9085
## Env Resolver Service:
9186

92-
The purpose of this service (implements the Resolve interface and is responsible for resolving the environment configuration ) is to retrieve environment configuration data from a store (SystemStoreFacadeService) and make it available to components before they are displayed.
87+
The purpose of this service (implements the Resolve interface and is responsible for resolving the environment configuration ) is to retrieve environment configuration data from a store (`SystemStoreFacadeService`) and make it available to components before they are displayed.
9388

9489
## Store:
9590

96-
Store module provides `store-keys.enum`,`user-session-store.service` and
97-
`system-store-facade.service`. These are used to fetch and update environment configurations.
98-
It also updates the environment configurations in memory and logs the change in the logging system.Also, provides methods to save, retrieve, and remove user session data such as access token, refresh token, user information, and last accessed URL.
91+
Store module provides `store-keys.enum`,`user-session-store.service` and`system-store-facade.service`. These are used to fetch and update environment configurations.It also updates the environment configurations in memory and logs the change in the logging system.Also, provides methods to save, retrieve, and remove user session data such as access token, refresh token, user information, and last accessed URL.
9992

10093
## Toaster:
10194

102-
- In this we are using toaster named Itoaster this is a user interface component that displays
95+
- In this The boilerplate using toaster named `Itoaster` this is a user interface component that displays
10396
notifications or alerts to users in a non-intrusive way. Itoaster notifications typically appear as small pop-up messages that provide feedback or information.
10497

105-
- In order to use it ,one can incorporate `ToasterService` [here]()
106-
provided in theme module which provides methods to display toast messages using the NbToastrService from the `@nebular/theme package`. The service has methods to show different types of toast messages such as success, info, warning, error, and default, and allows customization of the toast messages through an optional config parameter. The `ToasterAdapterService` is used to adapt the config object to the format expected by the NbToastrService. The service implements the IToaster interface which defines the method signatures for displaying toast messages.
98+
- In order to use it ,one can incorporate `ToasterService` provided in theme module which provides methods to display toast messages using the NbToastrService from the `@nebular/theme package`. The service has methods to show different types of toast messages such as success, info, warning, error, and default, and allows customization of the toast messages through an optional config parameter. The `ToasterAdapterService` is used to adapt the config object to the format expected by the NbToastrService. The service implements the IToaster interface which defines the method signatures for displaying toast messages.
10799

108100
For more detail about Core Module, refer [here](./src/lib/core/readme.md)
109101

110102
## Theme:
111103

112-
Theme module in our microservice is usually used in conjunction with Nebular, Nebular is a customizable Angular UI Library and styles designed to create a consistent, modern user interface. Nebular includes a set of pre-defined themes, but you can also create your own custom themes also.
104+
Theme module in arc is usually used in conjunction with Nebular, Nebular is a customizable Angular UI Library and styles designed to create a consistent, modern user interface. Nebular includes a set of pre-defined themes, but you can also create your own custom themes also.
113105

114-
Also, provides methods to register icon packs with the NbIconLibraries service. The NbIconLibraries service is a part of the nebular UI library and is used to manage icon libraries and packs.
106+
Also, provides methods to register icon packs with the NbIconLibraries service. The `NbIconLibraries` service is a part of the nebular UI library and is used to manage icon libraries and packs.
115107

116108
For more details about Theme Module,refer [here](./src/lib/theme/readme.md)
117109

@@ -124,7 +116,7 @@ For more details about Theme Module,refer [here](./src/lib/theme/readme.md)
124116

125117
## Gantt Component:
126118

127-
In this microservice we are using bb.gantt,bb.gantt charts,bb.gantt bars a Gantt chart is a user interface component that displays project tasks or events over a timeline, allowing users to visualize the schedule and progress of a project.
119+
In this The boilerplate usingbb.gantt,bb.gantt charts,bb.gantt bars a Gantt chart is a user interface component that displays project tasks or events over a timeline, allowing users to visualize the schedule and progress of a project.
128120

129121
## Login Component:
130122

@@ -138,19 +130,22 @@ For more details about Theme Module,refer [here](./src/lib/theme/readme.md)
138130

139131
- Auth component is a module that handles the authentication and authorization of users. It is responsible
140132
for managing user sessions, verifying user credentials, and granting access to protected resources based on the user's role and permissions.
141-
- The auth component typically includes a login as well as a registration form for new users to create an
142-
account. The component may also handle password reset functionality and provide options for users to manage their accounts
133+
- The auth component typically includes a login as well as a registration form for new users to create
134+
an account. The component may also handle password reset functionality and provide options for users to manage their accounts
143135

144136
For more details about Components ,refer [here](./src/lib/components/readme.md)
145137

146138
# Usage
147139

148140
Clone the boilerplate project repository to your local machine:
149-
https://github.com/sourcefuse/angular-boilerplate
141+
`https://github.com/sourcefuse/angular-boilerplate`
150142

151143
Install the project dependencies by running the following command in your terminal:
152-
`npm install`
144+
145+
```sh
146+
npm install
147+
```
153148

154149
# Further help
155150

156-
To get more help on the Angular CLI use `ng help` or go check out the [Angular CLI Overview and Command Reference](https://angular.io/cli) page.
151+
To get more help on the Angular CLI use `ng help` or go check out the [Angular CLI Overview and Command Reference](`https://angular.io/cli`) page.

projects/arc-lib/src/lib/components/auth/auth.module.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ import {NbAuthModule, NbPasswordAuthStrategy} from '@nebular/auth';
77
import {NbLayoutModule, NbThemeModule} from '@nebular/theme';
88
import {TranslateModule} from '@ngx-translate/core';
99

10-
import {ThemeModule} from '@main-project/theme/theme.module';
10+
import {ThemeModule} from '@project-lib/theme/theme.module';
1111
import {AuthRoutingModule} from './auth-routing.module';
1212
import {AuthComponent} from './auth.component';
1313
import {LoginComponent} from './login/login.component';
@@ -19,7 +19,7 @@ import {LoginComponent} from './login/login.component';
1919
CommonModule,
2020
FormsModule,
2121
RouterModule,
22-
ThemeModule,
22+
// ThemeModule,
2323
AuthRoutingModule,
2424
HttpClientModule,
2525
NbLayoutModule,

projects/arc-lib/src/lib/components/auth/login/login.component.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
import {Location} from '@angular/common';
22
import {Component} from '@angular/core';
33
import {ActivatedRoute} from '@angular/router';
4-
import {AuthService} from '@main-project/core/auth';
5-
import {RouteComponentBaseDirective} from '@main-project/core/route-component-base';
4+
import {AuthService} from '@project-lib/core/auth';
5+
import {RouteComponentBaseDirective} from '@project-lib/core/route-component-base';
66

77
@Component({
88
selector: 'boiler-login',

projects/arc-lib/src/lib/components/gantt/components/bb-gantt.component.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,8 @@ import {
1313
ViewChild,
1414
ViewContainerRef,
1515
} from '@angular/core';
16-
import {AnyObject} from '@main-project/core/api';
17-
import {ComponentBaseDirective} from '@main-project/core/component-base';
16+
import {AnyObject} from '@project-lib/core/api';
17+
import {ComponentBaseDirective} from '@project-lib/core/component-base';
1818
import {NbMenuItem, NbMenuService} from '@nebular/theme';
1919
import {takeUntil} from 'rxjs';
2020
import {GANTT_COLUMN_WIDTH} from '../const';

0 commit comments

Comments
 (0)