Skip to content

Commit 86110ac

Browse files
nour-karouiMuhammed Afil
authored andcommitted
Merge pull request #61 from webipie-dev/optimize-modules
Optimize modules
0 parents  commit 86110ac

File tree

697 files changed

+58094
-0
lines changed

Some content is hidden

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

697 files changed

+58094
-0
lines changed

.browserslistrc

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
# This file is used by the build system to adjust CSS and JS output to support the specified browsers below.
2+
# For additional information regarding the format and rule options, please see:
3+
# https://github.com/browserslist/browserslist#queries
4+
5+
# For the full list of supported browsers by the Angular framework, please see:
6+
# https://angular.io/guide/browser-support
7+
8+
# You can see what browsers were selected by your queries by running:
9+
# npx browserslist
10+
11+
last 1 Chrome version
12+
last 1 Firefox version
13+
last 2 Edge major versions
14+
last 2 Safari major version
15+
last 2 iOS major versions
16+
Firefox ESR
17+
not IE 9-11 # For IE 9-11 support, remove 'not'.

.editorconfig

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
# Editor configuration, see https://editorconfig.org
2+
root = true
3+
4+
[*]
5+
charset = utf-8
6+
indent_style = space
7+
indent_size = 2
8+
insert_final_newline = true
9+
trim_trailing_whitespace = true
10+
11+
[*.ts]
12+
quote_type = single
13+
14+
[*.md]
15+
max_line_length = off
16+
trim_trailing_whitespace = false

.github/workflows/aws.yml

Lines changed: 73 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,73 @@
1+
on:
2+
push:
3+
branches:
4+
- devops
5+
- master
6+
7+
name: Project Deployment
8+
9+
jobs:
10+
deploy:
11+
name: Deploy
12+
runs-on: ubuntu-latest
13+
14+
steps:
15+
- name: Checkout
16+
uses: actions/checkout@v2
17+
18+
- name: Configure AWS credentials
19+
uses: aws-actions/configure-aws-credentials@v1
20+
with:
21+
aws-access-key-id: AKIAZNH4SLOQBOKX3VEB
22+
aws-secret-access-key: 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
23+
aws-region: eu-central-1
24+
25+
- name: Login to Amazon ECR
26+
id: login-ecr
27+
uses: aws-actions/amazon-ecr-login@v1
28+
29+
- name: Build, tag, and push image to Amazon ECR
30+
id: build-image
31+
env:
32+
ECR_REGISTRY: ${{ steps.login-ecr.outputs.registry }}
33+
ECR_REPOSITORY: webipieecr_dev
34+
APP_PORT: ${{ secrets.APP_PORT }}
35+
AWS_ACCESS_KEY_ID: AKIAZNH4SLOQBOKX3VEB
36+
AWS_SECRET_ACCESS_KEY: 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
37+
REGION: eu-central-1
38+
run: |
39+
# Build a docker container and
40+
# push it to ECR so that it can
41+
# be deployed to ECS.
42+
cd backend
43+
docker build -t $ECR_REGISTRY/$ECR_REPOSITORY:latest .
44+
docker push $ECR_REGISTRY/$ECR_REPOSITORY:latest
45+
echo "::set-output name=image::$ECR_REGISTRY/$ECR_REPOSITORY:latest"
46+
47+
- name: Fill in the new image ID in the Amazon ECS task definition
48+
id: task-def
49+
uses: aws-actions/amazon-ecs-render-task-definition@v1
50+
with:
51+
task-definition: backend/task-definition.json
52+
container-name: webipie
53+
image: ${{ steps.build-image.outputs.image }}
54+
55+
- name: Deploy Amazon ECS task definition
56+
uses: aws-actions/amazon-ecs-deploy-task-definition@v1
57+
with:
58+
task-definition: ${{ steps.task-def.outputs.task-definition }}
59+
service: webipie
60+
cluster: webipie
61+
wait-for-service-stability: true
62+
63+
- name: Build and deploy front-end
64+
run: |
65+
echo "installing angular"
66+
npm install @angular/cli
67+
echo "installing dependencies"
68+
npm install
69+
echo "building project"
70+
npm run build
71+
aws s3 cp dist/savvy "s3://webipie.com" --recursive --grants read=uri=http://acs.amazonaws.com/groups/global/AllUsers
72+
aws cloudfront create-invalidation --distribution-id E1MLM3K0KNSF88 --paths "/*"
73+

.gitignore

Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
# See http://help.github.com/ignore-files/ for more about ignoring files.
2+
3+
# compiled output
4+
/dist
5+
/tmp
6+
/out-tsc
7+
# Only exists if Bazel was run
8+
/bazel-out
9+
10+
# dependencies
11+
*.rdb
12+
/backend/*.rdb
13+
/backend/configuration/index.js
14+
/backend/configuration
15+
/node_modules
16+
/backend/node_modules
17+
18+
# profiling files
19+
chrome-profiler-events*.json
20+
speed-measure-plugin*.json
21+
22+
# IDEs and editors
23+
/.idea
24+
.project
25+
.classpath
26+
.c9/
27+
*.launch
28+
.settings/
29+
*.sublime-workspace
30+
31+
# IDE - VSCode
32+
.vscode/*
33+
!.vscode/settings.json
34+
!.vscode/tasks.json
35+
!.vscode/launch.json
36+
!.vscode/extensions.json
37+
.history/*
38+
39+
# misc
40+
/.sass-cache
41+
/connect.lock
42+
/coverage
43+
/libpeerconnection.log
44+
npm-debug.log
45+
yarn-error.log
46+
testem.log
47+
/typings
48+
49+
# System Files
50+
.DS_Store
51+
Thumbs.db
52+
53+
# redis
54+
dump.rdb
55+
backend/dump.rdb
56+
backend/*.rdb

.npmrc

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
@mobiscroll:registry=https://npm.mobiscroll.com
2+
//npm.mobiscroll.com/:_authToken=zvrsZtTuGWpyfUjUFwK63Rb/qxO7lSjHCEc+JERTj1Pbs7xmv2+avvcxBP/pZzl3

README.md

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
# Savvy
2+
3+
This project was generated with [Angular CLI](https://github.com/angular/angular-cli) version 10.0.0.
4+
5+
## Development server
6+
7+
Run `ng serve` for a dev server. Navigate to `http://localhost:4200/`. The app will automatically reload if you change any of the source files.
8+
9+
## Code scaffolding
10+
11+
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`.
12+
13+
## Build
14+
15+
Run `ng build` to build the project. The build artifacts will be stored in the `dist/` directory. Use the `--prod` flag for a production build.
16+
17+
## Running unit tests
18+
19+
Run `ng test` to execute the unit tests via [Karma](https://karma-runner.github.io).
20+
21+
## Running end-to-end tests
22+
23+
Run `ng e2e` to execute the end-to-end tests via [Protractor](http://www.protractortest.org/).
24+
25+
## Further help
26+
27+
To get more help on the Angular CLI use `ng help` or go check out the [Angular CLI README](https://github.com/angular/angular-cli/blob/master/README.md).

angular.json

Lines changed: 174 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,174 @@
1+
{
2+
"$schema": "./node_modules/@angular/cli/lib/config/schema.json",
3+
"version": 1,
4+
"newProjectRoot": "projects",
5+
"projects": {
6+
"savvy": {
7+
"projectType": "application",
8+
"schematics": {},
9+
"root": "",
10+
"sourceRoot": "src",
11+
"prefix": "app",
12+
"architect": {
13+
"build": {
14+
"builder": "@angular-devkit/build-angular:browser",
15+
"options": {
16+
"outputPath": "dist/savvy",
17+
"index": "src/index.html",
18+
"main": "src/main.ts",
19+
"polyfills": "src/polyfills.ts",
20+
"tsConfig": "tsconfig.app.json",
21+
"aot": true,
22+
"assets": [
23+
"src/favicon.ico",
24+
"src/assets"
25+
],
26+
"styles": [
27+
"node_modules/bootstrap/dist/css/bootstrap.min.css",
28+
"src/styles.css",
29+
"node_modules/bootstrap/dist/css/bootstrap.css",
30+
"node_modules/@fortawesome/fontawesome-free/css/all.css",
31+
"src/assets/vivify.min.css",
32+
"node_modules/quill/dist/quill.core.css",
33+
"node_modules/quill/dist/quill.snow.css",
34+
"./node_modules/@mobiscroll/angular/dist/css/mobiscroll.min.css"
35+
],
36+
"scripts": [
37+
"node_modules/bootstrap/dist/js/bootstrap.js",
38+
"node_modules/@fortawesome/fontawesome-free/js/all.js",
39+
"node_modules/quill/dist/quill.min.js"
40+
]
41+
},
42+
"configurations": {
43+
"production": {
44+
"fileReplacements": [
45+
{
46+
"replace": "src/environments/environment.ts",
47+
"with": "src/environments/environment.prod.ts"
48+
}
49+
],
50+
"aot": true,
51+
"optimization": true,
52+
"outputHashing": "all",
53+
"sourceMap": false,
54+
"extractCss": true,
55+
"namedChunks": false,
56+
"extractLicenses": true,
57+
"vendorChunk": false,
58+
"buildOptimizer": true,
59+
"budgets": [
60+
{
61+
"type": "initial",
62+
"maximumWarning": "2mb",
63+
"maximumError": "5mb"
64+
},
65+
{
66+
"type": "anyComponentStyle",
67+
"maximumWarning": "6kb",
68+
"maximumError": "500kb"
69+
}
70+
]
71+
},
72+
"production-fr": {
73+
"fileReplacements": [
74+
{
75+
"replace": "src/environments/environment.ts",
76+
"with": "src/environments/environment.prod.ts"
77+
}
78+
],
79+
"optimization": true,
80+
"outputHashing": "all",
81+
"sourceMap": false,
82+
"extractCss": true,
83+
"namedChunks": false,
84+
"aot": true,
85+
"extractLicenses": true,
86+
"vendorChunk": false,
87+
"buildOptimizer": true,
88+
"outputPath": "dist/",
89+
"i18nFile": "src/locale/messages.fr.xlf",
90+
"i18nFormat": "xlf",
91+
"i18nLocale": "fr",
92+
"i18nMissingTranslation": "error"
93+
},
94+
"fr": {
95+
"aot": true,
96+
"outputPath": "dist/",
97+
"i18nFile": "src/locale/messages.fr.xlf",
98+
"i18nFormat": "xlf",
99+
"i18nLocale": "fr",
100+
"i18nMissingTranslation": "error"
101+
}
102+
}
103+
},
104+
"serve": {
105+
"builder": "@angular-devkit/build-angular:dev-server",
106+
"options": {
107+
"browserTarget": "savvy:build",
108+
"disableHostCheck": true
109+
},
110+
"configurations": {
111+
"production": {
112+
"browserTarget": "savvy:build:production"
113+
},
114+
"fr": {
115+
"browserTarget": "savvy:build:fr"
116+
}
117+
}
118+
},
119+
"extract-i18n": {
120+
"builder": "@angular-devkit/build-angular:extract-i18n",
121+
"options": {
122+
"browserTarget": "savvy:build"
123+
}
124+
},
125+
"test": {
126+
"builder": "@angular-devkit/build-angular:karma",
127+
"options": {
128+
"main": "src/test.ts",
129+
"polyfills": "src/polyfills.ts",
130+
"tsConfig": "tsconfig.spec.json",
131+
"karmaConfig": "karma.conf.js",
132+
"assets": [
133+
"src/favicon.ico",
134+
"src/assets"
135+
],
136+
"styles": [
137+
"src/styles.css"
138+
],
139+
"scripts": []
140+
}
141+
},
142+
"lint": {
143+
"builder": "@angular-devkit/build-angular:tslint",
144+
"options": {
145+
"tsConfig": [
146+
"tsconfig.app.json",
147+
"tsconfig.spec.json",
148+
"e2e/tsconfig.json"
149+
],
150+
"exclude": [
151+
"**/node_modules/**"
152+
]
153+
}
154+
},
155+
"e2e": {
156+
"builder": "@angular-devkit/build-angular:protractor",
157+
"options": {
158+
"protractorConfig": "e2e/protractor.conf.js",
159+
"devServerTarget": "savvy:serve"
160+
},
161+
"configurations": {
162+
"production": {
163+
"devServerTarget": "savvy:serve:production"
164+
}
165+
}
166+
}
167+
}
168+
}
169+
},
170+
"defaultProject": "savvy",
171+
"cli": {
172+
"analytics": "ef5e3a71-44cc-479f-9302-064b00c66f06"
173+
}
174+
}

backend/Dockerfile

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
FROM node:latest
2+
3+
WORKDIR /backend
4+
5+
COPY . /backend
6+
7+
RUN npm install
8+
9+
EXPOSE 3000
10+
11+
CMD ["npm", "start"]

0 commit comments

Comments
 (0)