This repository contains a simplified Request for Quote (RFQ) submission and viewing application built with Angular TypeScript frontend and .NET Core Web API backend. The solution includes user authentication, RFQ form submission, and a vendor view for managing submitted quotes.
The solution is organized as follows:
-
rfq-api: Contains the .NET Core Web API application with microservices architecture.
- src: Contains the source code for various services.
- Api: Main API service with controllers and endpoints.
- Application: Contains application-specific logic and services.
- Domain: Contains domain models and business logic.
- DTO: Data Transfer Objects used across the solution.
- EmailService: Service responsible for sending emails.
- Infrastructure: Contains infrastructure-specific code, such as repositories.
- NotificationService: Service responsible for managing notifications.
- Worker: Background worker service for handling asynchronous tasks.
- tests: Contains unit and integration tests for the solution.
- docker-compose.yml: Docker Compose configuration for API services.
- docker-compose.override.yml: Override configuration for development.
- RFQSubmission.sln: Solution file for Visual Studio.
- src: Contains the source code for various services.
-
rfq-app: Contains the Angular TypeScript application.
- src/app/components: Angular components for forms and views.
- src/app/services: Services for API communication and authentication.
- src/app/models: TypeScript models and interfaces.
- src/app/guards: Route guards for authentication protection.
- docker-compose.yml: Docker Compose configuration for frontend application.
Before deploying the solution, ensure the following prerequisites are met:
- Docker: Ensure Docker is installed on your machine.
- Docker Compose: Ensure Docker Compose is installed.
- .NET SDK 8.0: Required for building the backend (if not building via Docker).
- Node.js: Required for Angular development (version 18+ recommended).
- Angular CLI: Install globally with
npm install -g @angular/cli.
The environment variables required by the services are configured in the Docker Compose file. You can customize them according to your requirements:
-
PostgreSQL:
POSTGRES_DB: Database name (default:rfqsubmission).POSTGRES_USER: Username for accessing the database (default:admin).POSTGRES_PASSWORD: Password for the specified user.POSTGRES_HOST: Database host (default:localhost).POSTGRES_PORT: Database port (default:5432).
-
ASP.NET Core:
ASPNETCORE_ENVIRONMENT: Environment setting for the ASP.NET Core API.Development- For development purposesStaging- For testingProduction
-
Angular:
apiUrl: Base URL for the backend API (default:[http://localhost:5000](http://localhost:8090/api/v1/)).
If you wish to build and run the solution locally for development:
Navigate to the rfq-api directory and build the solution:
cd rfq-api
dotnet build RFQSubmission.slnTo run the API service:
dotnet run --project src/ApiThe API will be available at http://localhost:5000.
Navigate to the rfq-app directory and run:
cd rfq-app
npm install
ng serveThe Angular application will be available at http://localhost:4200.
Ensure PostgreSQL is running and create the database:
# Using Docker
docker run --name rfq-postgres -e POSTGRES_DB=rfqsubmission -e POSTGRES_USER=admin -e POSTGRES_PASSWORD=passw123 -p 5432:5432 -d postgres:15
# Run database migrations from the rfq-api directory
cd rfq-api
dotnet ef database update --project src/Infrastructure --startup-project src/ApiUse Docker Compose to build and deploy the solution. The application is split into two separate services:
Open the .env file in the rfq-api directory and ensure it contains:
ASPNETCORE_ENVIRONMENT=Production
POSTGRES_PASSWORD=passw123
Build and start the API service:
docker-compose -p rfq_api -f rfq-api/docker-compose.yml up -d --buildOpen the environment.ts and environment.prod.ts file in the rfq-app directory and ensure it contains:
apiUrl:[http://localhost:8090/api/v1/](http://localhost:8090/api/v1/)
Build and start the frontend application:
docker-compose -p rfq_app -f rfq-app/docker-compose.yml up -d --buildTo deploy both services together:
# Build and start API service
docker-compose -p rfq_api -f rfq-api/docker-compose.yml up -d --build
# Build and start frontend application
docker-compose -p rfq_app -f rfq-app/docker-compose.yml up -d --buildAfter successful deployment:
- Frontend Application: Accessible at http://localhost:7090.
- Backend API: Accessible at http://localhost:8090/api/v1.
- API Documentation (Swagger): Accessible at http://localhost:8090/swagger.
- PostgreSQL Database: Accessible at
localhost:5432.
- Sign Up: Create new user accounts with email and password.
- Login: Authenticate existing users with JWT tokens.
- Protected Routes: Both frontend routes and API endpoints are protected by authentication.
- Request Quote Form: Submit RFQs with the following fields:
- Description (text input, required)
- Quantity (number input, required)
- Unit (dropdown: LF, SF, EA, required)
- Job Location (text input, required)
- Client-side Validation: All fields are validated before submission.
- API Integration: Form data is sent to the backend API for processing.
- RFQ List: View all submitted RFQs in a organized table format.
- Authentication Required: Only logged-in users can access the vendor view.
- Real-time Updates: Newly submitted RFQs appear automatically.
POST /api/User- Register new userPOST /api/Authenticate/login- User login
POST /api/Submission- Submit new RFQ (authenticated)GET /api/Submission- Get all RFQs (authenticated)POST /api/Submission/search- Get filtered RFQ with pagination(authenticated)
To stop all running services:
# Stop API service
docker-compose -p rfq_api -f rfq-api/docker-compose.yml down
# Stop frontend application
docker-compose -p rfq_app -f rfq-app/docker-compose.yml downTo remove all containers, networks, and volumes:
# Remove API service containers and volumes
docker-compose -p rfq_api -f rfq-api/docker-compose.yml down -v --remove-orphans
# Remove frontend application containers and volumes
docker-compose -p rfq_app -f rfq-app/docker-compose.yml down -v --remove-orphans- Port Conflicts: Ensure that ports 4200, 5000, and 5432 are not in use by other applications.
- Database Connection: Verify PostgreSQL is running and connection string is correct.
- CORS Issues: Ensure the backend API has proper CORS configuration for the frontend origin.
Check logs for each service:
# API service logs
docker-compose -p rfq_api -f rfq-api/docker-compose.yml logs -f
# Frontend application logs
docker-compose -p rfq_app -f rfq-app/docker-compose.yml logs -f
# Specific service logs
docker-compose -p rfq_api -f rfq-api/docker-compose.yml logs -f <service_name>If you encounter database connection issues:
- Verify PostgreSQL container is running:
docker ps - Check database logs:
docker-compose -p rfq_api -f rfq-api/docker-compose.yml logs -f postgres - Ensure database migrations are applied:
cd rfq-api && dotnet ef database update --project src/Infrastructure --startup-project src/Api
- The solution follows clean architecture principles.
- Frontend uses Angular reactive forms with proper validation.
- Backend implements repository pattern and dependency injection.
- JWT authentication is implemented for secure API access.
- JWT tokens have configurable expiration times.
- API endpoints are protected with authentication middleware.
- Input validation is implemented on both client and server sides.
This repository is private. Collaborator access has been granted to:
- ezrosenblum (for review)
For any issues or questions, please create an issue in the GitHub repository or contact me Blagojche j_baze@live.com .