Skip to content

Commit 630e688

Browse files
authored
Merge pull request #4 from sourcefuse/GH-3
feat:angular multi-app structure project
2 parents c19e6eb + f3a7e69 commit 630e688

File tree

381 files changed

+11263
-48007
lines changed

Some content is hidden

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

381 files changed

+11263
-48007
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,3 +7,4 @@ lerna-debug.log
77
**/.DS_Store
88
.nyc_output
99
dist
10+
/.angular/cache

README.md

Lines changed: 123 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,130 @@
1-
# Sourceloop Angular Boiler Plate
1+
# ARC ANGULAR BOILERPLATE
2+
[![Version](https://img.shields.io/badge/@angular/core-v14-brightgreen)](https://www.npmjs.com/package/@angular/cli/v/14.0.0)
23

3-
### Feedback
44

5-
If you've noticed a bug or have a question or have a feature request, [search the issue tracker]([Issues · sourcefuse/angular-boilerplate · GitHub](https://github.com/sourcefuse/angular-boilerplate/issues)) to see if someone else in the community has already created a ticket. If not, go ahead and [make one](https://github.com/sourcefuse/angular-boilerplate/issues/new/choose)! All feature requests are welcome. Implementation time may vary. Feel free to contribute the same, if you can. If you think this extension is useful, please [star](https://help.github.com/en/articles/about-stars) it. Appreciation really helps in keeping this project alive.
65

7-
### Code of Conduct
6+
<!-- DOCUMENTATION -->
87

9-
Code of conduct guidelines [here.](CODE_OF_CONDUCT.md)
8+
## Description
109

11-
### License
10+
The boilerplate using multiple projects in one Angular environment so that the boilerplate help users
11+
to improve code reusability,maintainability and customization. boilerplate can also help in increase productivity, reduce risks, and improve the quality of application.
12+
The multiple applications or parts of applications that share common functionality, using multiple
13+
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.
1214

13-
[MIT](LICENSE)
1415

15-
<!-- docs-index-end -->
16+
## Usage
17+
18+
#### Step 1: Clone the boilerplate project repository to your local machine
19+
20+
```sh
21+
git clone https://github.com/sourcefuse/angular-boilerplate
22+
```
23+
24+
#### Step 2: Install the project dependencies by running the following command
25+
26+
```sh
27+
npm install
28+
```
29+
30+
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:
31+
32+
```
33+
BOILER-PLATE
34+
├── .github
35+
├── .husky
36+
├── projects
37+
├── .czferc.js
38+
├── .npmrc
39+
├── .cz-config.js
40+
├── .gitignore
41+
├── commitlint.config.js
42+
├── CODE_OF_CONDUCT.md
43+
├── package-lock.json
44+
├── package.json
45+
├── README.md
46+
└── tsconfig.json
47+
```
48+
As can be seen above, scaffold has initialized and set up a lot, such as:
49+
50+
1. GitHub PR template inside `.github`
51+
2. Conventional commits enablement using commitizen (`.cz-config.js`), commitlint (`commitlint-config.js`)
52+
and husky for githooks.
53+
3. `.gitignore` for ignoring files from source code. Important for secure coding and keeping the repo clean
54+
on SCM (git)
55+
4. `package.json` and `package-lock.json` for npm to work.
56+
5. The folder named `projects`: Projects will hold the multi application pattern and will always be
57+
completely independent
58+
59+
#### The Structure is main project folder
60+
61+
```
62+
PROJECTS
63+
├── arc
64+
├── arc-lib
65+
│ └── src
66+
│ └──lib
67+
│ ├── assets
68+
│ ├── components
69+
│ ├── core
70+
│ └── theme
71+
├── (...other files)
72+
```
73+
74+
## Projects
75+
76+
### Purpose of the Projects folder boilerplate have
77+
- Boilerplate use Multi project to avoid duplicate code and easy maintainance this can be used where
78+
we have to maintain multiple projects that have something in common like a user portal and admin portal
79+
Here Boilerplate use "Projects" folder typically serves as a centralized location to organize and store project-related files and resources.
80+
- Boilerplate allows users to Generate new applications at same workspace with following command:
81+
82+
```sh
83+
ng generate application <application-name>
84+
```
85+
86+
1. Arc:
87+
- This boilerplate arc project is a project set up that can be easily altered to create new projects.
88+
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.
89+
90+
2. Arc-Lib
91+
- 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.
92+
93+
For further reference you can refer [Here](projects/arc-lib/README.md)
94+
95+
96+
#### Step 3: Setup of Starting the Server
97+
98+
- By Default boilerplate giving `defaultProject` as `arc` in the `angular.json` you can do further changes as per your Project requirment so that if you directly do `ng serve` your project run by default.
99+
100+
```typescript
101+
"defaultProject": "arc",
102+
```
103+
104+
#### Step 4: Running Server
105+
106+
```sh
107+
ng serve
108+
```
109+
110+
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.
111+
112+
## Build the Application
113+
114+
To build the project. The build artifacts will be stored in the `dist/` directory.
115+
116+
```sh
117+
ng build
118+
```
119+
120+
## Running unit tests
121+
122+
Run `ng test` to execute the unit tests via [Karma](https://karma-runner.github.io).
123+
124+
## Running end-to-end tests
125+
126+
Run `ng e2e` to execute the end-to-end tests via a platform of your choice. To use this command, you need to first add a package that implements end-to-end testing capabilities.
127+
128+
## Further help
129+
130+
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.

angular.json

Lines changed: 171 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,171 @@
1+
{
2+
"$schema": "./node_modules/@angular/cli/lib/config/schema.json",
3+
"version": 1,
4+
"newProjectRoot": "projects",
5+
"projects": {
6+
"arc": {
7+
"projectType": "application",
8+
"schematics": {
9+
"@schematics/angular:component": {
10+
"style": "scss"
11+
}
12+
},
13+
"root": "projects/arc",
14+
"sourceRoot": "projects/arc/src",
15+
"prefix": "arc",
16+
"architect": {
17+
"build": {
18+
"builder": "@angular-devkit/build-angular:browser",
19+
"options": {
20+
"outputPath": "dist/arc",
21+
"index": "projects/arc/src/index.html",
22+
"main": "projects/arc/src/main.ts",
23+
"polyfills": ["zone.js"],
24+
"tsConfig": "projects/arc/tsconfig.app.json",
25+
"inlineStyleLanguage": "scss",
26+
"assets": [
27+
"projects/arc/src/favicon.ico",
28+
{
29+
"glob": "**/*",
30+
"input": "projects/arc-lib/src/lib/assets/",
31+
"output": "/assets/"
32+
}
33+
],
34+
"styles": [
35+
"./node_modules/@angular/material/prebuilt-themes/indigo-pink.css",
36+
"node_modules/eva-icons/style/scss/eva-icons.scss",
37+
"node_modules/@nebular/theme/styles/prebuilt/dark.css",
38+
"projects/arc/src/styles.scss"
39+
],
40+
"scripts": []
41+
},
42+
"configurations": {
43+
"production": {
44+
"budgets": [
45+
{
46+
"type": "initial",
47+
"maximumWarning": "1mb",
48+
"maximumError": "2mb"
49+
},
50+
{
51+
"type": "anyComponentStyle",
52+
"maximumWarning": "2kb",
53+
"maximumError": "4kb"
54+
}
55+
],
56+
"outputHashing": "all"
57+
},
58+
"development": {
59+
"fileReplacements": [
60+
{
61+
"replace": "projects/arc/src/environments/environment.ts",
62+
"with": "projects/arc/src/environments/environment.ts"
63+
}
64+
],
65+
"index": {
66+
"input": "projects/arc/src/index.html",
67+
"output": "index.html"
68+
},
69+
"optimization": false,
70+
"outputHashing": "all",
71+
"sourceMap": false,
72+
"namedChunks": false,
73+
"extractLicenses": true,
74+
"vendorChunk": false,
75+
"buildOptimizer": false,
76+
"budgets": [
77+
{
78+
"type": "initial",
79+
"maximumWarning": "8mb",
80+
"maximumError": "8mb"
81+
},
82+
{
83+
"type": "anyComponentStyle",
84+
"maximumWarning": "100kb",
85+
"maximumError": "500kb"
86+
}
87+
]
88+
}
89+
},
90+
"defaultConfiguration": "development"
91+
},
92+
"serve": {
93+
"builder": "@angular-devkit/build-angular:dev-server",
94+
"options": {
95+
"browserTarget": "arc:build"
96+
},
97+
"configurations": {
98+
"production": {
99+
"browserTarget": "arc:build:production"
100+
},
101+
"development": {
102+
"browserTarget": "arc:build:development"
103+
}
104+
},
105+
"defaultConfiguration": "development"
106+
},
107+
"extract-i18n": {
108+
"builder": "@angular-devkit/build-angular:extract-i18n",
109+
"options": {
110+
"browserTarget": "arc:build"
111+
}
112+
},
113+
"test": {
114+
"builder": "@angular-devkit/build-angular:karma",
115+
"options": {
116+
"polyfills": ["zone.js", "zone.js/testing"],
117+
"tsConfig": "projects/arc/tsconfig.spec.json",
118+
"inlineStyleLanguage": "scss",
119+
"assets": [
120+
"projects/arc/src/favicon.ico",
121+
{
122+
"glob": "**/*",
123+
"input": "projects/arc-lib/src/lib/assets/",
124+
"output": "projects/arc-lib/src/lib/assets/"
125+
}
126+
],
127+
"styles": [
128+
"projects/arc/src/styles.scss",
129+
"projects/arc-lib/src/lib/theme/styles/index.scss"
130+
],
131+
"scripts": []
132+
}
133+
}
134+
}
135+
},
136+
"arc-lib": {
137+
"projectType": "library",
138+
"root": "projects/arc-lib",
139+
"sourceRoot": "projects/arc-lib/src",
140+
"prefix": "lib",
141+
"architect": {
142+
"build": {
143+
"builder": "@angular-devkit/build-angular:ng-packagr",
144+
"options": {
145+
"project": "projects/arc-lib/ng-package.json"
146+
},
147+
"configurations": {
148+
"production": {
149+
"tsConfig": "projects/arc-lib/tsconfig.lib.prod.json"
150+
},
151+
"development": {
152+
"tsConfig": "projects/arc-lib/tsconfig.lib.json"
153+
}
154+
},
155+
"defaultConfiguration": "production"
156+
},
157+
"test": {
158+
"builder": "@angular-devkit/build-angular:karma",
159+
"options": {
160+
"tsConfig": "projects/arc-lib/tsconfig.spec.json",
161+
"polyfills": ["zone.js", "zone.js/testing"]
162+
}
163+
}
164+
}
165+
}
166+
},
167+
"defaultProject": "arc",
168+
"cli": {
169+
"analytics": "dcf534a6-f2c3-4c9c-99f0-3de66c9162da"
170+
}
171+
}

apps/boiler-plate/.dockerignore

Lines changed: 0 additions & 7 deletions
This file was deleted.

apps/boiler-plate/.env.example

Lines changed: 0 additions & 7 deletions
This file was deleted.

apps/boiler-plate/.eslintrc.json

Lines changed: 0 additions & 50 deletions
This file was deleted.

0 commit comments

Comments
 (0)