Skip to content

Commit a778715

Browse files
committed
initial commit
0 parents  commit a778715

Some content is hidden

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

58 files changed

+14156
-0
lines changed

.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/buildfeatures.yml

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
# This workflow will do a clean installation of node dependencies, cache/restore them, build the source code and run tests across different versions of node
2+
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-nodejs
3+
4+
name: Build features
5+
6+
on:
7+
pull_request:
8+
branches: feature/
9+
10+
jobs:
11+
build:
12+
13+
runs-on: windows-lates
14+
15+
steps:
16+
17+
- uses: actions/checkout@v3
18+
19+
- name: Use Node.js 18
20+
uses: actions/setup-node@v3
21+
with:
22+
node-version: 18
23+
cache: 'npm'
24+
25+
- run: npm ci
26+
27+
- run: npm run build --if-present
28+
29+
- run: npm test

.gitignore

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
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+
/bazel-out
8+
9+
# Node
10+
/node_modules
11+
npm-debug.log
12+
yarn-error.log
13+
14+
# IDEs and editors
15+
.idea/
16+
.project
17+
.classpath
18+
.c9/
19+
*.launch
20+
.settings/
21+
*.sublime-workspace
22+
23+
# Visual Studio Code
24+
.vscode/*
25+
.history/*
26+
27+
# Miscellaneous
28+
/.angular/cache
29+
.sass-cache/
30+
/connect.lock
31+
/coverage
32+
/libpeerconnection.log
33+
testem.log
34+
/typings
35+
36+
# System files
37+
.DS_Store
38+
Thumbs.db

DOCUMENTATION.md

Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
# CustomerPwa
2+
3+
This project was generated with [Angular CLI](https://github.com/angular/angular-cli) version 15.2.5.
4+
5+
## Tutorial references used to build this project
6+
7+
* [Create a modular Angulara pplication wiht Angular materials](https://dev.to/codingcatdev/angular-material-router-outlet-3292)
8+
* [CRUDs with angular materials 14 ](https://www.learmoreseekmore.com/2022/10/angular-v14-angularmaterial-v14-crud-example.html)
9+
10+
## Further help
11+
12+
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.
13+
14+
## Development server
15+
16+
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.
17+
18+
## Code scaffolding
19+
20+
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`.
21+
22+
## Build
23+
24+
Run `ng build` to build the project. The build artifacts will be stored in the `dist/` directory.
25+
26+
## Running unit tests
27+
28+
Run `ng test` to execute the unit tests via [Karma](https://karma-runner.github.io).
29+
30+
## Running end-to-end tests
31+
32+
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.
33+
34+
## Staerting the application
35+
```sh
36+
npm start
37+
```
38+
## Test run ng serve for production
39+
```sh
40+
ng serve --configuration=production
41+
```
42+
## Build docker image
43+
```sh
44+
npm run docker-build
45+
```
46+
## Run docker container
47+
```sh
48+
npm run docker-run
49+
```

Dockerfile

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
# Primero, construimos la aplicación Angular
2+
FROM node:lts-alpine AS build
3+
WORKDIR /app
4+
COPY package*.json ./
5+
RUN npm ci --omit=dev
6+
COPY . .
7+
RUN npm run build
8+
9+
# Luego, desplegamos la aplicación en un servidor web
10+
FROM nginx:1.23.4-alpine
11+
COPY --from=build /app/dist/customer-pwa /usr/share/nginx/html
12+
COPY nginx.conf /etc/nginx/nginx.conf
13+
14+
# Establecemos la variable de entorno NODE_ENV
15+
ENV NODE_ENV production
16+
17+
# Configuramos el puerto para desarrollo (puerto 4200) y producción (puerto 80)
18+
ARG PORT=80
19+
ENV PORT=${PORT}
20+
EXPOSE ${PORT}
21+
22+
CMD ["nginx", "-g", "daemon off;"]

README.md

Lines changed: 72 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,72 @@
1+
# Angular CRUD By [Sotobotero](https://sotobotero.com)
2+
3+
**Content**
4+
1. [Como contribuir con este proyecto](#como-contribuir-con-este-proyecto)
5+
2. [Como empezar a usar la aplicación](#como-empezar)
6+
3. [How contribute to this project](#how-contribute-to-this-project)
7+
4. [Getting Started](#getting-started)
8+
9+
## Como contribuir con este proyecto.
10+
1. Primero, necesitas hacer un fork del repositorio al que deseas contribuir. Esto creará una copia del repositorio en tu cuenta de GitHub. Puedes hacer un fork de un repositorio haciendo clic en el botón "Fork" en la esquina superior derecha de la página del repositorio.
11+
12+
2. A continuación, necesitas clonar tu repositorio bifurcado en tu máquina local. Esto te permitirá trabajar en los archivos del proyecto sin conexión. Puedes clonar tu repositorio bifurcado utilizando el comando git clone con la URL de tu bifurcación.
13+
14+
3. Después de clonar tu repositorio bifurcado, necesitas crear una rama para trabajar en tus cambios. Una rama es una versión separada del código que puedes modificar sin afectar la rama principal. Puedes crear una rama utilizando el comando git branch con el nombre de tu rama.
15+
16+
4. Una vez que hayas creado una rama, necesitas cambiar a ella utilizando el comando git checkout con el nombre de tu rama. Esto hará que tu rama sea la activa y cualquier cambio que hagas se aplicará a ella.
17+
18+
5. Ahora puedes empezar a trabajar en tus cambios. Puedes editar, agregar o eliminar cualquier archivo en tu rama como desees. Puedes utilizar cualquier editor de código o IDE que prefieras.
19+
20+
6. Después de hacer tus cambios, necesitas hacer commit de ellos en tu rama.
21+
22+
7. A continuación, necesitas enviar tus cambios a tu repositorio bifurcado en GitHub. Esto subirá tu rama y sus commits a tu repositorio en línea. Puedes enviar tus cambios utilizando el comando git push con el nombre de tu remoto (normalmente origin) y el nombre de tu rama.
23+
24+
8. Por último, necesitas crear una solicitud de extracción (pull request) desde tu rama al repositorio original del que hiciste la bifurcación. Una solicitud de extracción es una solicitud para que los mantenedores del repositorio original revisen y fusionen tus cambios en su rama principal. Puedes crear una solicitud de extracción haciendo clic en el botón "Pull Request" en la página de tu repositorio bifurcado en GitHub.
25+
## Como empezar
26+
### Requisitos
27+
1. Instalar [Node.js LTS](https://nodejs.org/es/) (v18.16.0) o superior y [Angular CLI](https://cli.angular.io/) (v13) o superior.
28+
2. Opcional: Clonar e iniciarlizar el backend de la aplicación [customer-back](https://github.com/sotobotero/customer-back), si no se tiene el backend, la aplicación solo cargrá el front pero no tendra conexión a un back.
29+
### Instalación
30+
1. Clonar el repositorio
31+
2. Entrar a la carpeta del proyecto
32+
3. Instalar los paquetes de npm con el comando `npm install`.
33+
4. Ejecutar el comando `ng serve --configuration=production` para un servidor de desarrollo. Navegar a `http://localhost:4200/customers`.
34+
La aplicación se recargará automáticamente si se cambia alguno de los archivos de origen.
35+
36+
37+
## How contribute to this project.
38+
1. First, you need to fork the repository that you want to contribute to. This will create a copy of the repository under your own GitHub account. You can fork a repository by clicking the Fork button on the top right corner of the repository page.
39+
40+
2. Next, you need to clone your forked repository to your local machine. This will allow you to work on the project files offline. You can clone your forked repository by using the git clone command with the URL of your fork.
41+
42+
3. After cloning your forked repository, you need to create a branch to work on your changes. A branch is a separate version of the code that you can modify without affecting the main branch. You can create a branch by using the git branch command with the name of your branch.
43+
44+
4. Once you have created a branch, you need to switch to it by using the git checkout command with the name of your branch. This will make your branch the active one and any changes you make will be applied to it.
45+
46+
5. Now you can start working on your changes. You can edit, add, or delete any files in your branch as you wish. You can use any code editor or IDE that you prefer.
47+
48+
6. After making your changes, you need to commit them to your branch. A commit is a snapshot of your changes that records what you have done and why. You can commit your changes by using the git commit command with a message that describes your changes.
49+
50+
7. Next, you need to push your changes to your forked repository on GitHub. This will upload your branch and its commits to your online repository. You can push your changes by using the git push command with the name of your remote (usually origin) and the name of your branch.
51+
52+
8. Finally, you need to create a pull request from your branch to the original repository that you forked from. A pull request is a request for the maintainers of the original repository to review and merge your changes into their main branch. You can create a pull request by clicking the Pull Request button on your forked repository page on GitHub.
53+
54+
## Getting Started
55+
56+
## Requirements
57+
1. Install Node.js LTS (v18.16.0) or later and Angular CLI (v13) or later.
58+
2. Optional: Clone and start the backend of the [customer-back](https://github.com / sotobotero / customer-back) application, if you don't have the backend, the application will only load the front but will have no connection to a backend.
59+
60+
61+
## Installation
62+
1. Clone the repository
63+
2. Enter the project folder
64+
3. Install npm packages with the command npm install.
65+
4. Run the command ng serve --configuration=production for a development server. Navigate to http://localhost:4200/customers.
66+
The application will reload automatically if any of the source files are changed.
67+
68+
69+
## Angular 2+ - Environment Variables
70+
Due to this app are execute on web browser, you can't use environment variables on environments/environment.ts, becuase this file are execute on server side, and enviroment variables are not available on server side.
71+
72+
If you want to use environment variables on environments/environment.prod.ts, you need to change the aporach for use dotenv lib and dotenv-webpack plugin for webpack.

angular.json

Lines changed: 106 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,106 @@
1+
{
2+
"$schema": "./node_modules/@angular/cli/lib/config/schema.json",
3+
"version": 1,
4+
"newProjectRoot": "projects",
5+
"projects": {
6+
"customer-pwa": {
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/customer-pwa",
17+
"index": "src/index.html",
18+
"main": "src/main.ts",
19+
"polyfills": [
20+
"zone.js"
21+
],
22+
"tsConfig": "tsconfig.app.json",
23+
"assets": [
24+
"src/favicon.ico",
25+
"src/assets"
26+
],
27+
"styles": [
28+
"@angular/material/prebuilt-themes/indigo-pink.css",
29+
"src/styles.css"
30+
],
31+
"scripts": []
32+
},
33+
"configurations": {
34+
"production": {
35+
"fileReplacements": [
36+
{
37+
"replace": "src/environments/environment.ts",
38+
"with": "src/environments/environment.prod.ts"
39+
}
40+
],
41+
"budgets": [
42+
{
43+
"type": "initial",
44+
"maximumWarning": "500kb",
45+
"maximumError": "1mb"
46+
},
47+
{
48+
"type": "anyComponentStyle",
49+
"maximumWarning": "2kb",
50+
"maximumError": "4kb"
51+
}
52+
],
53+
"outputHashing": "all"
54+
},
55+
"development": {
56+
"buildOptimizer": false,
57+
"optimization": false,
58+
"vendorChunk": true,
59+
"extractLicenses": false,
60+
"sourceMap": true,
61+
"namedChunks": true
62+
}
63+
},
64+
"defaultConfiguration": "production"
65+
},
66+
"serve": {
67+
"builder": "@angular-devkit/build-angular:dev-server",
68+
"configurations": {
69+
"production": {
70+
"browserTarget": "customer-pwa:build:production"
71+
},
72+
"development": {
73+
"browserTarget": "customer-pwa:build:development"
74+
}
75+
},
76+
"defaultConfiguration": "development"
77+
},
78+
"extract-i18n": {
79+
"builder": "@angular-devkit/build-angular:extract-i18n",
80+
"options": {
81+
"browserTarget": "customer-pwa:build"
82+
}
83+
},
84+
"test": {
85+
"builder": "@angular-devkit/build-angular:karma",
86+
"options": {
87+
"polyfills": [
88+
"zone.js",
89+
"zone.js/testing"
90+
],
91+
"tsConfig": "tsconfig.spec.json",
92+
"assets": [
93+
"src/favicon.ico",
94+
"src/assets"
95+
],
96+
"styles": [
97+
"@angular/material/prebuilt-themes/indigo-pink.css",
98+
"src/styles.css"
99+
],
100+
"scripts": []
101+
}
102+
}
103+
}
104+
}
105+
}
106+
}

0 commit comments

Comments
 (0)