Skip to content

Instantly share code, notes, and snippets.

@robertdean
Last active May 10, 2023 13:37
Show Gist options
  • Save robertdean/e47499333e3d17f09beb0612134ce875 to your computer and use it in GitHub Desktop.
Save robertdean/e47499333e3d17f09beb0612134ce875 to your computer and use it in GitHub Desktop.
setup v2
red=`tput setaf 1`
green=`tput setaf 2`
reset=`tput sgr0`
echo "${green}${green}creating project shell${reset}"
ng new ui --skip-install=true --routing=true --style=scss --skip-git=true --create-application=false --commit=false --verbose=true
cd ui
echo "${green}creating admin projectl${reset}"
ng g application admin --prefix=admin --skip-install=true --style=scss --routing=true
echo "${green}creating client projectl${reset}"
ng g application client --prefix=client --skip-install=true --style=scss --routing=true
echo "${green}creating shared libraryl${reset}"
ng g library shared --prefix=lib --skip-install=true
echo "${green}installing deps ${reset}"
npm i
echo "${green}adding angular material depsl${reset}"
ng add @angular/material --defaults=true --skip-confirmation=true --verbose
ng add @angular/cdk --defaults=true --skip-confirmation=true --verbose
npm install material-design-icons --save
npm install roboto-fontface --save
echo "${green} adding shared componentsl${reset}"
ng g c components/page-not-found --project=shared --export=true
ng g c components/access-denied --project=shared --export=true
ng g c components/nav --project=shared --export=true
ng g module users --module=app.module --project=admin --route=users --routing=true
ng g module roles --module=app.module --project=admin --route=roles --routing=true
ng g module logs --module=app.module --project=admin --route=logs --routing=true
ng g module dashboard --module=app.module --project=admin --route=dashboard --routing=true
ng generate @angular/material:dashboard dashboard --project=admin
ng generate @angular/material:table table --project=admin
ng generate @angular/material:nav nav --project=admin
ng generate @angular/material:nav src/lib/components/nav --project=shared --module=src/lib/shared.module
#echo "${green}adding stuff to angular.json "
# cat angular.json | jq '.projects.admin.architect.build.options.styles |= . + ["./node_modules/material-design-icons/iconfont/material-icons.css","./node_modules/roboto-fontface/css/roboto/roboto-fontface.css"]' > angular.json
# cat angular.json | jq '.projects.client.architect.build.options.styles |= . + ["./node_modules/material-design-icons/iconfont/material-icons.css","./node_modules/roboto-fontface/css/roboto/roboto-fontface.css"]' > angular.json
# echo "${green}done"
# ng add @ngx-formly/schematics --ui-theme=material
# npm install @ngrx/{store,effects,entity,store-devtools} --save
# ng generate @ngrx/schematics:store State --root --module app.module.ts
# ng generate @ngrx/schematics:effect App --root --module app.module.ts
# ng g module users --module=app.module --project=admin --route=users --routing=true
#
# const routes: Routes = [
# { path: '', component: DashboardComponent },
# { path: 'table', component: TableComponent },
# { path: '404', component: PageNotFoundComponent },
# { path: '401', component: AccessDeniedComponent },
# { path: 'users', loadChildren: () => import('./users/users.module').then(m => m.UsersModule) },
# { path: '**', redirectTo: '/404', pathMatch: 'full' },
#
# ];
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment