Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 0 additions & 16 deletions .browserslistrc

This file was deleted.

1 change: 1 addition & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ trim_trailing_whitespace = true

[*.ts]
quote_type = single
ij_typescript_use_double_quotes = false

[*.md]
max_line_length = off
Expand Down
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# See http://help.github.com/ignore-files/ for more about ignoring files.
# See https://docs.github.com/get-started/getting-started-with-git/ignoring-files for more about ignoring files.

# Compiled output
/dist
Expand Down
2 changes: 1 addition & 1 deletion .vscode/launch.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"configurations": [
{
"name": "ng serve",
"type": "pwa-chrome",
"type": "chrome",
"request": "launch",
"preLaunchTask": "npm: start",
"url": "http://localhost:4200/"
Expand Down
117 changes: 103 additions & 14 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,27 +1,116 @@
# EcommProject

This project was generated with [Angular CLI](https://github.com/angular/angular-cli) version 14.1.3.
## Update Angular version
- 14.2.13 -> 18.2.21
## THE IDEA IS TO IMPROVE THIS PROJECT IS DEPRECATED(old)
| FIRST VERSION | PRIMERA VERSION |
|--------------------------|---------------------------|
|![image](images/image.png)|![image](images/image1.png)|
|![image](images/image2.png)|![image](images/image3.png)|

## Development server
- you can use docker if it doesn't work
```
docker build -t angular14 .
docker run -p 4200:4200 angular14
```
## 📖 Descripción
JSON Server permite crear una API REST falsa completa con cero configuración de código. Es ideal para prototipado rápido y desarrollo frontend sin necesidad de un backend real.

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.
## SI YA HAS INSTALADO LA API DE FORMA LOCAL SOLO EJECUTA
```bash
npm run api
```
```bash
npm run reset-db
npm run api #si has borrado la info
```
## 🚀 Instalación

## Code scaffolding
### Opción 1: Instalación Global (Recomendada)
```bash
npm install -g json-server
```

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`.
### Opción 2: Instalación Local en el Proyecto
```bash
npm install json-server --save-dev --legacy-peer-deps
```
## 📁 Ubicación y Estructura

## Build
### Con Instalación Global
```
Cualquier ubicación del sistema
├── db.json ← Base de datos mock
└── json-server ← Comando disponible globalmente
```
## Correr fakeapi en la ruta donde crees el archivo db.json con la Informacion
```bash
json-server --watch db.json
```
### Con Instalación Local
```
mi-proyecto/
├── node_modules/
│ └── json-server/ ← Instalado aquí
├── db.json ← Base de datos mock
├── package.json
└── scripts: "json-server --watch db.json"
```

Run `ng build` to build the project. The build artifacts will be stored in the `dist/` directory.
## 📄 Crear archivo db.json

## Running unit tests
```json
{
"users": [
{ "id": 1, "name": "Juan", "email": "juan@email.com" },
{ "id": 2, "name": "María", "email": "maria@email.com" }
],
"products": [
{ "id": 1, "name": "Laptop", "price": 999 },
{ "id": 2, "name": "Mouse", "price": 25 }
]
}
```

Run `ng test` to execute the unit tests via [Karma](https://karma-runner.github.io).
## ⚡ Uso Rápido

## Running end-to-end tests
### Con Instalación Global
```bash
json-server --watch db.json --port 3000
```

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.
### Con Instalación Local
```json
// package.json
{
"scripts": {
"api": "json-server --watch db.json"
}
}
```

## Further help
```bash
npm run json-server
```

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.
## 🌐 Endpoints Generados

```
GET /users # Obtener todos los usuarios
GET /users/1 # Obtener usuario por ID
POST /users # Crear usuario
PUT /users/1 # Actualizar usuario
DELETE /users/1 # Eliminar usuario
```

## 🔗 URL de Acceso
- **API Base**: `http://localhost:3000`
- **Ejemplo**: `http://localhost:3000/users`


### DEPENDENCIAS ADICIONALES
```
npm install @fortawesome/fontawesome-free
npm install @ng-bootstrap/ng-bootstrap @popperjs/core --force
npm install @angular/platform-browser@18.2.14
Remove-Item -Recurse -Force node_modules
Remove-Item -Force package-lock.json
70 changes: 36 additions & 34 deletions angular.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,60 +3,58 @@
"version": 1,
"newProjectRoot": "projects",
"projects": {
"ecomm-project": {
"taller-angular": {
"projectType": "application",
"schematics": {},
"root": "",
"sourceRoot": "src",
"prefix": "app",
"architect": {
"build": {
"builder": "@angular-devkit/build-angular:browser",
"builder": "@angular-devkit/build-angular:application",
"options": {
"outputPath": "dist/ecomm-project",
"outputPath": "dist/taller-angular",
"index": "src/index.html",
"main": "src/main.ts",
"polyfills": "src/polyfills.ts",
"browser": "src/main.ts",
"polyfills": [
"zone.js"
],
"tsConfig": "tsconfig.app.json",
"assets": [
"src/favicon.ico",
"src/assets"
{
"glob": "**/*",
"input": "public"
}
],
"styles": [
"node_modules/bootstrap/dist/css/bootstrap.min.css",
"src/styles.css"
],
"scripts": []
"scripts": [
"node_modules/@popperjs/core/dist/umd/popper.min.js",
"node_modules/bootstrap/dist/js/bootstrap.min.js"
]
},
"configurations": {
"production": {
"budgets": [
{
"type": "initial",
"maximumWarning": "500kb",
"maximumError": "1mb"
"maximumWarning": "500kB",
"maximumError": "1MB"
},
{
"type": "anyComponentStyle",
"maximumWarning": "2kb",
"maximumError": "4kb"
}
],
"fileReplacements": [
{
"replace": "src/environments/environment.ts",
"with": "src/environments/environment.prod.ts"
"maximumWarning": "2kB",
"maximumError": "4kB"
}
],
"outputHashing": "all"
},
"development": {
"buildOptimizer": false,
"optimization": false,
"vendorChunk": true,
"extractLicenses": false,
"sourceMap": true,
"namedChunks": true
"sourceMap": true
}
},
"defaultConfiguration": "production"
Expand All @@ -65,38 +63,42 @@
"builder": "@angular-devkit/build-angular:dev-server",
"configurations": {
"production": {
"browserTarget": "ecomm-project:build:production"
"buildTarget": "taller-angular:build:production"
},
"development": {
"browserTarget": "ecomm-project:build:development"
"buildTarget": "taller-angular:build:development"
}
},
"defaultConfiguration": "development"
},
"extract-i18n": {
"builder": "@angular-devkit/build-angular:extract-i18n",
"options": {
"browserTarget": "ecomm-project:build"
}
"builder": "@angular-devkit/build-angular:extract-i18n"
},
"test": {
"builder": "@angular-devkit/build-angular:karma",
"options": {
"main": "src/test.ts",
"polyfills": "src/polyfills.ts",
"polyfills": [
"zone.js",
"zone.js/testing"
],
"tsConfig": "tsconfig.spec.json",
"karmaConfig": "karma.conf.js",
"assets": [
"src/favicon.ico",
"src/assets"
{
"glob": "**/*",
"input": "public"
}
],
"styles": [
"src/styles.css"
"src/styles.css",
"node_modules/@fortawesome/fontawesome-free/css/all.min.css"
],
"scripts": []
}
}
}
}
},
"cli": {
"analytics": false
}
}
Loading