Este README
proporciona instrucciones básicas para la instalación de herramientas necesarias y la configuración de una máquina virtual con Vagrant con las herramientas necesarias para el desafio (docker, minikube, kubectl)
En el directorio de tu proyecto, encontrarás una carpeta llamada "Vagrant". Esta carpeta contiene la configuración necesaria para levantar una máquina virtual.
- Iniciar la Máquina Virtual: Ejecuta el siguiente comando dentro del directorio "Vagrant":
vagrant up
- Conexión SSH: Para conectarte a la máquina virtual por SSH, utiliza el siguiente comando:
vagrant ssh
- Túnel a la Máquina Host: Puedes crear un túnel desde la máquina virtual a tu máquina host para acceder a servicios que se ejecuten en la VM desde el host. Utiliza el siguiente comando para configurar el túnel:
vagrant ssh -- -L 8080:localhost:80
Para construir la imagen de docker podremos hacerlo de forma manual descargando el codigo y haciendo un docker build o utilizar la github action ya configurada para que en cada cambio que hagamos en algun archivo del directorio Docker, se ejecute y haga el proceso de construir la imagen y subirla a dockerhub, es importante haber activado Github Actions y configurado los secretos para subir la imagen a dockerhub.
-
Primero debemos descargar la imagen manualmente: Para descargar la imagen alojada en un repositorio de dockerhub, debemos ejecutar el siguiente comando:
docker pull fcongedo/app-angular:2
-
Crear la Imagen de Docker Manualmente:Para crear una imagen de Docker de manera manual, ejecuta el siguiente comando, que mapea el puerto 80 de la máquina virtual al puerto del contenedor. Asegúrate de cambiar los nombres y versiones según tu configuración:
docker run -d -p 80:80 fcongedo/app-angular:2
-
Crear la Imagen de Docker con Docker Compose: Dirígete al directorio /angular-realworld-example-app/Docker-compose en la máquina virtual y ejecuta el siguiente comando para crear la imagen utilizando Docker Compose
docker compose up -d
-
Verificar su funcionamiento: utilizando un tunel de vagrant o desde curl localhost:8080
vagrant ssh -- -L 8080:localhost:80
-
Iniciar Minikube: Ejecuta el siguiente comando para iniciar minikube:
minikube start
Para este paso es tan simple como verificar estar conectados a nuestro cluster de kubernetes (poder ejecutar un kubectl get pods -A sin errores) y asi crear nuestros recursos dentro del directorio Kubernetes con el siguiente comando (asegurarse de estar dentro del directorio angular-realworld-example-app):
-
Crear Recursos en Kubernetes: Asegúrate de estar dentro del directorio
angular-realworld-example-app
y ejecuta:kubectl apply -f Kubernetes/ns.yaml kubectl apply -f Kubernetes/deployment.yaml
-
Exponer la Aplicación: Utiliza port-forward para exponer la aplicación:
kubectl port-forward deployment/app-angular 8080:80 -n prueba-angular
-
Verificar su funcionamiento: utilizando un tunel de vagrant o desde curl localhost:80 (el tunel recordar hacerlo desde otra terminal de vagrant)
vagrant ssh -- -L 80:localhost:8080
Angular codebase containing real world examples (CRUD, auth, advanced patterns, etc) that adheres to the RealWorld spec and API.
This codebase was created to demonstrate a fully fledged application built with Angular that interacts with an actual backend server including CRUD operations, authentication, routing, pagination, and more. We've gone to great lengths to adhere to the Angular Styleguide & best practices.
Additionally, there is an Angular 1.5 version of this codebase that you can fork and/or learn how to recreate.
We're currently working on some docs for the codebase (explaining where functionality is located, how it works, etc) but the codebase should be straightforward to follow as is. We've also released a step-by-step tutorial w/ screencasts that teaches you how to recreate the codebase from scratch.
For convenience, we have a live API server running at https://conduit.productionready.io/api for the application to make requests against. You can view the API spec here which contains all routes & responses for the server.
The source code for the backend server (available for Node, Rails and Django) can be found in the main RealWorld repo.
If you want to change the API URL to a local server, simply edit src/environments/environment.ts
and change api_url
to the local server's URL (i.e. localhost:3000/api
). Please note you will probably need to use a proxy in order to avoid Cross-Origin Resource (CORS) issues. (more info: Proxying to a backend server )
Make sure you have the Angular CLI installed globally. We use Yarn to manage the dependencies, so we strongly recommend you to use it. you can install it from Here, then run yarn install
to resolve all dependencies (might take a minute).
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.
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.
The example application is a social blogging site (i.e. a Medium.com clone) called "Conduit". It uses a custom API for all requests, including authentication. You can view a live demo over at https://angular.realworld.io
General functionality:
- Authenticate users via JWT (login/signup pages + logout button on settings page)
- CRU* users (sign up & settings page - no deleting required)
- CRUD Articles
- CR*D Comments on articles (no updating required)
- GET and display paginated lists of articles
- Favorite articles
- Follow other users
The general page breakdown looks like this:
- Home page (URL: /#/ )
- List of tags
- List of articles pulled from either Feed, Global, or by Tag
- Pagination for list of articles
- Sign in/Sign up pages (URL: /#/login, /#/register )
- Uses JWT (store the token in localStorage)
- Authentication can be easily switched to session/cookie based
- Settings page (URL: /#/settings )
- Editor page to create/edit articles (URL: /#/editor, /#/editor/article-slug-here )
- Article page (URL: /#/article/article-slug-here )
- Delete article button (only shown to article's author)
- Render markdown from server client side
- Comments section at bottom of page
- Delete comment button (only shown to comment's author)
- Profile page (URL: /#/profile/:username, /#/profile/:username/favorites )
- Show basic user info
- List of articles populated from author's created articles or author's favorited articles
prueba [](https://thinkster.io)