A Full-Stack Contact Management Application
This is a learning project built to understand and practice full-stack web development using ASP.NET Core Web API and Angular. The application demonstrates fundamental CRUD operations, API integration, and modern web development practices.
This project was created to learn and practice:
- Backend Development: Building REST APIs with ASP.NET Core
- Frontend Development: Creating responsive UIs with Angular
- Database Operations: Working with Entity Framework Core
- HTTP Communication: Connecting frontend to backend APIs
- Form Validation: Implementing client-side validation
- Modern CSS: Using Tailwind CSS for styling
- Full-Stack Integration: Connecting all pieces together
- ASP.NET Core 8.0 - Web API development
- Entity Framework Core - Database operations
- In-Memory Database - Simple data storage for learning
- Swagger - API documentation and testing
- CORS - Cross-origin resource sharing
- Angular 20 - Component-based frontend framework
- TypeScript - Type-safe JavaScript
- Reactive Forms - Form handling and validation
- RxJS - Reactive programming with Observables
- Tailwind CSS - Utility-first CSS framework
- HTTP Client - API communication
- Creating RESTful API endpoints
- Setting up Entity Framework with DbContext
- Implementing CRUD operations (Create, Read, Delete)
- Configuring CORS for cross-origin requests
- Using DTOs (Data Transfer Objects) for API requests
- Dependency injection in ASP.NET Core
- Angular component architecture
- Reactive forms with validation
- HTTP client for API calls
- TypeScript interfaces and models
- RxJS Observables for data handling
- Responsive design with CSS Grid and Flexbox
- Connecting Angular frontend to .NET backend
- Handling asynchronous operations
- Error handling and user feedback
- Real-time UI updates after API operations
- .NET 8.0 SDK
- Node.js (v18+)
- Angular CLI
cd API/Contactly/Contactly
dotnet restore
dotnet runAPI will run on https://localhost:7267
cd UI/contactly.web
npm install
ng serveApp will run on http://localhost:4200
Contactly/
βββ API/
β βββ Contactly/
β βββ Controllers/ # API endpoints
β βββ Data/ # Database context
β βββ Models/ # Data models and DTOs
β βββ Program.cs # App configuration
βββ UI/
βββ contactly.web/
βββ src/
βββ app/
βββ models/ # TypeScript interfaces
βββ app.ts # Main component logic
βββ app.html # Component template
[HttpPost]
public IActionResult AddContact(AddContactRequestDTO request)
{
var contact = new Contact
{
Id = Guid.NewGuid(),
Name = request.Name,
Email = request.Email,
Phone = request.Phone,
Favourite = request.Favourite
};
dbContext.Contacts.Add(contact);
dbContext.SaveChanges();
return Ok(contact);
}contactsForm = new FormGroup({
name: new FormControl('', [Validators.required, Validators.minLength(2)]),
email: new FormControl(null, [Validators.email]),
phone: new FormControl('', [Validators.required, Validators.pattern(/^\+?[\d\s\-\(\)]+$/)]),
favorite: new FormControl(false)
});this.http.post('https://localhost:7267/api/Contacts', addContactRequest)
.subscribe({
next: (value) => {
this.contacts$ = this.getContacts();
this.contactsForm.reset();
},
error: (error) => console.error('Error:', error)
});- Add Contact: Form with validation to create new contacts
- View Contacts: Display all contacts in a responsive layout
- Delete Contact: Remove contacts with confirmation
- Favorite Marking: Toggle favorite status for contacts
- Responsive Design: Works on desktop and mobile devices
- Real-time Updates: UI updates immediately after operations
- In-Memory Database: Perfect for learning without complex setup
- Simple CRUD: Focus on fundamental operations
- Modern UI: Tailwind CSS for quick, beautiful styling
- Component-based: Angular's component architecture
- Reactive Patterns: RxJS for handling asynchronous data
- Add Edit/Update functionality
- Implement a real database (SQL Server, PostgreSQL)
- Add authentication and authorization
- Write unit and integration tests
- Deploy to cloud platforms
- Add more advanced features (search, filtering, etc.)
- Understanding CORS configuration
- Managing state between components
- Form validation patterns
- Async data handling with Observables
- CSS Grid and Flexbox layouts
This project uses:
- In-Memory Database: Data resets when API restarts
- Development CORS: Allows all origins (not for production)
- Basic Error Handling: Console logging for debugging
- No Authentication: Focus on core functionality
Created as a learning project to understand full-stack web development with .NET and Angular.
This is a learning project by @sithummadhuranga - July 2025