Prerequisites
Before you begin, ensure you have the following installed:- Node.js 20.x or higher
- npm (comes with Node.js)
- Git
This project uses Angular 20, which requires Node.js version 20.0.0 or higher.
Quick Start Steps
Clone the repository
Clone the Biblioteca Virtual Frontend repository to your local machine:Expected output:
Install dependencies
Install all required npm packages:This will install Angular 20 and all dependencies defined in
package.json:@angular/core: ^20.0.0@angular/router: ^20.0.0@angular/common: ^20.0.0@angular/forms: ^20.0.0rxjs: ~7.8.0
Configure the API endpoint
The application connects to a backend API. By default, it points to
http://localhost:8080.If your backend is running on a different URL, update src/environments/environment.ts:src/environments/environment.ts
Start the development server
Launch the Angular development server:This runs
ng serve under the hood. Expected output:Verify Your Setup
To verify everything is working correctly:- Check the login page loads - Navigate to
http://localhost:4200/auth/login - Open browser DevTools - Press F12 and check the Console tab for any errors
- Verify API connectivity - The app should attempt to connect to your backend at
http://localhost:8080
What’s Next?
Installation Guide
Learn about all available installation methods including Docker
Architecture Overview
Understand the project structure and architecture
Common Issues
Port 4200 is already in use
Port 4200 is already in use
If you see an error that port 4200 is already in use, you can specify a different port:Or kill the process using port 4200:
npm install fails
npm install fails
If
npm install fails, try:- Clear npm cache:
npm cache clean --force - Delete
node_modulesandpackage-lock.json - Run
npm installagain
Cannot connect to backend API
Cannot connect to backend API
If you see CORS errors or connection refused errors:
- Verify your backend is running on
http://localhost:8080 - Check that CORS is properly configured in your backend
- Update the
apiUrlinsrc/environments/environment.tsif needed
Available Scripts
Once installed, you have access to these npm scripts:| Command | Description |
|---|---|
npm start | Start development server on http://localhost:4200 |
npm run build | Build for production (output in dist/) |
npm run watch | Build in watch mode with source maps |
npm test | Run unit tests with Karma |
npm run build:netlify | Build with Netlify configuration |