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
- Docker
- Docker Hub
Local Development Setup
This method is ideal for active development work with hot reload and debugging tools.1
Clone the repository
2
Install dependencies
package.json:Core Dependencies:3
Configure environment
Set up your environment configuration in For production builds, configure
src/environments/environment.ts:src/environments/environment.ts
src/environments/environment.prod.ts:src/environments/environment.prod.ts
4
Start development server
http://localhost:4200Build Configurations
The project includes multiple build configurations defined inangular.json:
Development Build
- Source maps enabled
- No optimization
- No license extraction
- Fast rebuild times
Production Build
- Full optimization
- Output hashing for cache busting
- Bundle budgets:
- Initial bundle: 500kB warning, 1MB error
- Component styles: 4kB warning, 8kB error
dist/biblioteca-front/browser/
Netlify Build
- Uses
environment.netlify.tsconfiguration - 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 usernameDOCKERHUB_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:- Docker image build
- Push to Docker Hub
- Image tagged as
latest
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
Docker build fails
Docker build fails
Common causes:
- Insufficient memory: Increase Docker’s memory allocation
- Network issues: Check your internet connection
- Disk space: Ensure you have at least 2GB free
npm install fails with permission errors
npm install fails with permission errors
Solution:Don’t use
sudo with npm. Instead, configure npm to use a different directory:Build exceeds bundle size budgets
Build exceeds bundle size budgets
If production builds fail due to bundle size:Solutions:
- Lazy load modules - Split large features into lazy-loaded routes
- Optimize imports - Import only what you need from libraries
- Increase budgets - Update limits in
angular.json(not recommended)
angular.json
CORS errors when connecting to API
CORS errors when connecting to API
Symptoms:Solutions:Update
- Configure CORS in your backend to allow
http://localhost:4200 - Use a proxy configuration in
angular.json - Deploy frontend and backend on the same domain
proxy.conf.json:package.json: