Q: How are GitHub Actions used in this flow?
A: The blog shows using GitHub Actions CI/CD pipelines so that when code is pushed to main (or PRs), Docker image is built, then deployed to the EC2 instance via SSH (or similar). This automates shipping new versions.
Q: Why containerize with Docker before deploying to EC2?
A: Docker helps package the application with all its dependencies so that it runs the same way across environments. It simplifies deployment to servers like EC2 and avoids “it works on my machine” problems.
Q: What is Rocket in Rust, and why use it for REST APIs?
A: Rocket is a web framework for Rust that makes creating REST endpoints more ergonomic. The tutorial uses it to build a REST API and then deploys that API reliably. Using Rust + Rocket ensures performance, type safety, and minimal overhead.
Q: Why use Nginx as a reverse proxy rather than letting the front/backend handle routing directly?
A: Because Nginx centralizes concerns like SSL handling, domain routing, load distribution, caching, compression. This simplifies configuration per-service, improves performance, and adds security. Also, it abstracts away individual service ports from the public.
Q: What kind of folder structure is recommended for this kind of deployment?
A: The article shows separate repos for frontend and backend, an nginx folder containing the reverse proxy configuration, and workflows (like .github/workflows/main.yml) that orchestrate building, pushing, and deploying the containers.
Q: What is SSL termination in Nginx and how is it handled in this setup?
A: SSL termination means the reverse proxy (Nginx) handles HTTPS requests from the client (decrypting SSL) and forwards plain HTTP to the backend services. In this blog, Nginx is set up to handle SSL certificates and perform SSL termination for the incoming requests.
Q: How does Docker Compose help in managing multiple services (frontend, backend, database)?
A: Docker Compose lets you define each service (frontend, backend, database) in a single docker-compose.yml file, define how they connect via networks, set up environment variables, expose ports, define order (via depends_on), and configure volumes. This standardizes deployment across dev/staging/production.
Q: What is the purpose of using a reverse proxy in a multi-container setup?
A: A reverse proxy like Nginx serves as a gateway that receives client requests and routes them to the appropriate backend service (frontend, backend API) in your Docker Compose network. It also helps with SSL termination, load balancing, and hiding internal network structure.
Q: What are newer features or changes I should watch out for with Angular guards?
A: Recent Angular versions have introduced functional guards (as opposed to the class-based ones) and some older guard interfaces might be deprecated in favor of simpler or more flexible patterns. So it’s good to check the version of Angular you’re using and see what guard types are recommended.
Q: Can Guards also protect child routes/components and nested routes?
A: Yes. Angular has CanActivateChild which guards nested routes. If a parent route is protected with child routes, you can use this guard to manage access for all descendants.