Skip to main content
This guide covers all installation methods for the Biblioteca Virtual Frontend, from local development to Docker deployment and CI/CD setup.

Prerequisites

For Local Development

Node.js 20+

Required for running Angular CLI and building the application

npm

Package manager (included with Node.js)

Git

Version control to clone the repository

Angular CLI

Optional but recommended for development

For Docker Deployment

  • Docker 20.10+ or higher
  • Docker Compose (optional, for orchestration)
With Docker, you don’t need Node.js or Angular CLI installed locally. Everything runs in containers.

Installation Methods

Local Development Setup

This method is ideal for active development work with hot reload and debugging tools.
1

Clone the repository

2

Install dependencies

This installs all packages from package.json:Core Dependencies:
3

Configure environment

Set up your environment configuration in src/environments/environment.ts:
src/environments/environment.ts
For production builds, configure src/environments/environment.prod.ts:
src/environments/environment.prod.ts
4

Start development server

The application will be available at http://localhost:4200

Build Configurations

The project includes multiple build configurations defined in angular.json:

Development Build

Features:
  • Source maps enabled
  • No optimization
  • No license extraction
  • Fast rebuild times

Production Build

Features:
  • Full optimization
  • Output hashing for cache busting
  • Bundle budgets:
    • Initial bundle: 500kB warning, 1MB error
    • Component styles: 4kB warning, 8kB error
Output location: dist/biblioteca-front/browser/

Netlify Build

Features:
  • Uses environment.netlify.ts configuration
  • Output hashing enabled
  • Optimized for Netlify deployment
The Netlify build uses environment file replacement to inject production API URLs.

TypeScript Configuration

The project uses strict TypeScript configuration for type safety:
tsconfig.json

CI/CD Setup

The project includes GitHub Actions workflow for automated Docker builds and deployment.

GitHub Actions Workflow

.github/workflows/docker-frontend.yml

Setting up CI/CD

1

Add Docker Hub credentials

In your GitHub repository settings, add these secrets:
  • DOCKERHUB_USERNAME: Your Docker Hub username
  • DOCKERHUB_TOKEN: Your Docker Hub access token
2

Enable GitHub Actions

Ensure GitHub Actions is enabled in your repository settings
3

Push to main branch

Every push to the main branch will trigger:
  1. Docker image build
  2. Push to Docker Hub
  3. Image tagged as latest
You can monitor the build status in the “Actions” tab of your GitHub repository.

Project Structure

After installation, your project structure will look like this:

Next Steps

Quickstart Guide

Get up and running in 5 minutes

Configuration

Learn about environment variables and configuration options

Architecture

Understand the project architecture

Authentication

Connect to the backend API

Troubleshooting

Common causes:
  1. Insufficient memory: Increase Docker’s memory allocation
  2. Network issues: Check your internet connection
  3. Disk space: Ensure you have at least 2GB free
Solution:
Solution:Don’t use sudo with npm. Instead, configure npm to use a different directory:
If production builds fail due to bundle size:
Solutions:
  1. Lazy load modules - Split large features into lazy-loaded routes
  2. Optimize imports - Import only what you need from libraries
  3. Increase budgets - Update limits in angular.json (not recommended)
angular.json
Symptoms:
Solutions:
  1. Configure CORS in your backend to allow http://localhost:4200
  2. Use a proxy configuration in angular.json
  3. Deploy frontend and backend on the same domain
Create proxy.conf.json:
Update package.json:

Additional Resources