A modern full-stack web application combining a responsive Angular frontend with a robust ASP.NET Core backend. This project showcases a professional architecture for building scalable web applications with real-time communication capabilities.
CodeProjects is designed as a collaborative platform with:
- Modern Frontend: Built with Angular 17 for a responsive, dynamic user experience
- Robust Backend: Built with ASP.NET Core 10 for secure, scalable API services
- RESTful API: Contact management and data services via REST endpoints
- CORS-Enabled: Secure cross-origin communication between frontend and backend
- Framework: Angular 17.3
- Language: TypeScript 5.4
- Build Tool: Angular CLI 17.3.17
- Package Manager: npm
- Testing: Jasmine & Karma
- Styling: CSS3
- Framework: ASP.NET Core 10
- Language: C# 13
- Platform: .NET 10.0
- Build Tool: MSBuild (via
dotnetCLI) - API Documentation: OpenAPI/Swagger
Before you begin, ensure you have the following installed:
- Node.js v18.0 or higher - Download
- npm (comes with Node.js)
- .NET SDK 10.0 or higher - Download
# Check Node.js and npm
node --version
npm --version
# Check .NET SDK
dotnet --versionTerminal 1 - Frontend:
cd Frontend
npm install
npm startFrontend available at: http://localhost:4200
Terminal 2 - Backend:
cd Backend
dotnet build
dotnet runBackend available at: https://localhost:7001 or http://localhost:5000
cd Frontend
npm install
npm startcd Backend
dotnet build
dotnet runCodeProjects/
βββ Frontend/ # Angular application
β βββ src/
β β βββ app/ # Application components & services
β β βββ assets/ # Static resources
β β βββ index.html # Main HTML file
β β βββ main.ts # Entry point
β β βββ styles.css # Global styles
β βββ angular.json # Angular CLI configuration
β βββ package.json # Dependencies
β βββ tsconfig.json # TypeScript configuration
β βββ README.md # Frontend-specific documentation
β
βββ Backend/ # ASP.NET Core API
β βββ Program.cs # Application startup & configuration
β βββ CodeProjectsBackend.csproj
β βββ CodeProjectsBackend.http # HTTP requests for testing
β βββ appsettings.json # App configuration
β βββ appsettings.Development.json
β βββ bin/ # Compiled binaries
β βββ obj/ # Build artifacts
β βββ Properties/
β βββ launchSettings.json # Launch profiles
β
βββ README.md # This file
- Endpoint:
POST /api/contact - Description: Submit a contact request
- Request Body:
{
"name": "string",
"email": "string",
"message": "string"
}- Response:
{
"message": "Message received successfully. We will get back to you soon!"
}When running the backend in development mode, access API documentation at:
- http://localhost:5000/openapi/v1.json (OpenAPI spec)
The frontend communicates with the backend through HTTP requests:
- Frontend runs on port 4200
- Backend runs on port 5000 (HTTP) or port 7001 (HTTPS)
- CORS is configured to allow requests from the frontend to the backend
- Base API URL:
https://localhost:7001/apiorhttp://localhost:5000/api
Navigate to the Frontend directory and start development:
cd Frontend
npm install # Install dependencies (first time only)
npm start # Start dev server with hot-reload
npm run build # Build for production
npm test # Run testsAvailable Commands:
npm start- Start development servernpm run build- Create production buildnpm run watch- Build in watch modenpm test- Run unit testsng generate component <name>- Generate new component
Create a New Component:
ng generate component components/my-componentNavigate to the Backend directory and start development:
cd Backend
dotnet build # Build the project
dotnet run # Run the application
dotnet watch run # Run with file watching
dotnet test # Run tests (if test project exists)Available Commands:
dotnet build- Compile the projectdotnet run- Run the applicationdotnet watch run- Run with automatic restart on file changesdotnet clean- Remove build artifactsdotnet test- Run unit tests
Port 4200 Already in Use
ng serve --port 4300Dependencies Not Installing
npm cache clean --force
rm -rf node_modules package-lock.json
npm installModule Not Found Errors Ensure all dependencies are installed:
npm installBuild Fails with AppHost Error
If you encounter Access to the path 'apphost.exe' is denied:
- The file may be locked by antivirus software
- Solution: Add
<UseAppHost>false</UseAppHost>toCodeProjectsBackend.csproj(temporary fix) - Permanent fix: Exclude
obj/andbin/directories from antivirus scanning
Port Already in Use
Check which process is using the port and terminate it, or modify launchSettings.json
HTTPS Certificate Issues For development, you can ignore HTTPS certificate warnings or generate a development certificate:
dotnet dev-certs https --trustcd Frontend
npm run build
# Output will be in dist/ directory
# Deploy dist/ directory to a web servercd Backend
dotnet publish -c Release -o ./publish
# Output will be in Backend/publish/ directory
# Deploy the publish directory to your server-
Create a Feature Branch
git checkout -b feature/your-feature-name
-
Make Your Changes
- Follow the existing code style and conventions
- Write meaningful commit messages
- Keep commits focused and atomic
-
Test Your Changes
- Frontend:
npm test - Backend:
dotnet testordotnet build
- Frontend:
-
Create a Pull Request
- Provide a clear description of changes
- Reference any related issues
- Ensure all tests pass
- Frontend: Follow Angular style guide and TypeScript best practices
- Backend: Follow C# naming conventions and .NET guidelines
- Use meaningful variable and function names
- Add comments for complex logic
- Keep functions focused and single-responsibility
type: subject
body (optional)
footer (optional)
Example:
feat: add contact form validation
body: Implements email and name validation on contact form submission
fix: resolve CORS header issue with backend
For detailed information about each part of the project:
- Frontend Details: See Frontend/README.md
- Backend Details: See Backend/README.md (if available)
- Angular Documentation
- Angular CLI Documentation
- ASP.NET Core Documentation
- C# Documentation
- TypeScript Documentation
This project is licensed under the MIT License - see LICENSE file for details.
For questions or issues, please:
- Check existing issues on the repository
- Create a new issue with detailed description
- Include error messages, logs, and steps to reproduce
Last Updated: April 2026 Version: 1.0.0
Happy coding! π