https://github.com/samuelmarks/ng-material-scaffold
@angular/material scaffold with REST API integration; see restify-orm-scaffold for backend example
https://github.com/samuelmarks/ng-material-scaffold
Last synced: 3 months ago
JSON representation
@angular/material scaffold with REST API integration; see restify-orm-scaffold for backend example
- Host: GitHub
- URL: https://github.com/samuelmarks/ng-material-scaffold
- Owner: SamuelMarks
- License: apache-2.0
- Created: 2017-09-27T14:13:26.000Z (almost 9 years ago)
- Default Branch: master
- Last Pushed: 2024-04-15T00:35:25.000Z (about 2 years ago)
- Last Synced: 2024-04-15T01:22:10.865Z (about 2 years ago)
- Language: TypeScript
- Homepage:
- Size: 2.53 MB
- Stars: 1
- Watchers: 3
- Forks: 2
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE-APACHE
Awesome Lists containing this project
README
ng-material-scaffold
====================
[](https://opensource.org/licenses/Apache-2.0)
[](https://github.com/SamuelMarks/ng-material-scaffold/actions/workflows/main.yml)
Simple scaffold generated with [`@angular/cli`](https://github.com/angular/angular-cli) then implemented manually. Uses standard OAuth2 (RFC6749) password grant flow.
For example server, see https://github.com/SamuelMarks/serve-actix-diesel-auth-scaffold
FWIW: Eventually, most of this repo will be codegenerated from https://github.com/SamuelMarks/serve-actix-diesel-auth-scaffold/blob/master/openapi.json
## Update version
sed -i "/this.serverStatus =/c\ this.serverStatus = { version: '@ $(jq -r .version package.json); '};" src/app/server-status/server-status.component.ts
## Deploy distribution
Clone [ng-material-scaffold-dist](https://github.com/SamuelMarks/ng-material-scaffold-dist) one directory above, then:
rm -rf dist; ng build --confguration production && d=../ng-material-scaffold-dist && rm -rf "${d}/dist" && mv "${PWD}/dist/${PWD##*/}/browser/" "${d}/dist" && cd "${d}" && (git add .; git status) || ( >&2 echo BUILD FAILED )
## Configure a reverse proxy for server
Use a long [nginxctl](https://github.com/offscale/nginxctl) CLI command to create an nginx config and server it:
python -m nginxctl serve --temp_dir '/tmp' -b 'server' --server_name 'localhost' --listen '8080' -b 'location' '/api' --proxy_pass 'http://localhost:3000' --proxy_redirect 'off' -} -b 'location' '/' --root '/tmp/wwwroot' --try_files '$uri$args $uri$args/ /index.html' -} -}
Or just write a config (below is what the command generates… with 2 newlines thrown in):
```nginx
server {
server_name localhost;
listen 8080;
location /api {
proxy_pass http://localhost:3000;
proxy_redirect off;
}
location / {
root /tmp/wwwroot;
try_files $uri$args $uri$args/ /index.html;
}
}
```
For development server, run with:
python -m nginxctl serve --temp_dir '/tmp' -b map '$http_upgrade $connection_upgrade' --default 'upgrade' --"''" close -} -b 'server' --server_name 'localhost' --listen '8080' -b 'location' '/api' --proxy_pass 'http://localhost:3000' --proxy_redirect 'off' -} -b 'location' '^~ /sockjs-node/' --proxy_pass 'http://127.0.0.1:4200' --proxy_set_header 'Upgrade $http_upgrade' --proxy_set_header 'Connection $connection_upgrade' --proxy_set_header 'Host $host' --proxy_http_version '1.1' --proxy_cache_bypass '$http_upgrade' -} -b 'location' '/' --proxy_pass 'http://127.0.0.1:4200/' --proxy_set_header 'Upgrade $http_upgrade' --proxy_set_header 'Connection $connection_upgrade' --proxy_set_header 'Host $host' --proxy_http_version '1.1' --proxy_cache_bypass '$http_upgrade' -} -}
Or just write a config (below is what the command generates… with some newlines thrown in):
```nginx
map $http_upgrade $connection_upgrade {
default upgrade;
"''" close;
}
server {
server_name localhost;
listen 8080;
location /api {
proxy_pass http://localhost:3000;
proxy_redirect off;
}
location ^~ /sockjs-node/ {
proxy_pass http://127.0.0.1:4200;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection $connection_upgrade;
proxy_set_header Host $host;
proxy_http_version 1.1;
proxy_cache_bypass $http_upgrade;
}
location / {
proxy_pass http://127.0.0.1:4200/;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection $connection_upgrade;
proxy_set_header Host $host;
proxy_http_version 1.1;
proxy_cache_bypass $http_upgrade;
}
}
```
---
This project was generated with [Angular CLI](https://github.com/angular/angular-cli) version 17.3.4.
## Development server
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.
## Code scaffolding
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`.
## Build
Run `ng build` to build the project. The build artifacts will be stored in the `dist/` directory.
## Running unit tests
Run `ng test` to execute the unit tests via [Karma](https://karma-runner.github.io).
## Running end-to-end tests
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.
## Further help
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.
---
## License
Licensed under either of
- Apache License, Version 2.0 ([LICENSE-APACHE](LICENSE-APACHE) or )
- MIT license ([LICENSE-MIT](LICENSE-MIT) or )
at your option.
### Contribution
Unless you explicitly state otherwise, any contribution intentionally submitted
for inclusion in the work by you, as defined in the Apache-2.0 license, shall be
dual licensed as above, without any additional terms or conditions.