A comprehensive full-stack web application for managing marketing campaigns and field tasks. Built with Angular (Frontend) and .NET 8 (Backend), this system enables admins to create and assign tasks to employees, track progress in real-time, and manage marketing campaigns with a hierarchical location-based structure.
GitHub Repository: https://github.com/aman7506/marketing-task-management
- Framework: Angular 17
- Language: TypeScript
- Styling: CSS (Custom styles)
- Maps: Leaflet.js
- Real-time: SignalR Client
- Framework: ASP.NET Core 8.0 (Web API)
- Language: C# 12
- Database: SQL Server
- ORM: Entity Framework Core 8
- Authentication: JWT Bearer Tokens
- Real-time: SignalR
- Password: BCrypt.Net
- DBMS: Microsoft SQL Server
- Database Name:
marketing_db - Approach: Code-First with Stored Procedures
Marketing Form/
│
├── 📂 backend/ # .NET 8 Web API
│ ├── Controllers/ # API Controllers
│ │ ├── AreasController.cs # Location management
│ │ ├── AuthController.cs # Authentication
│ │ ├── TasksController.cs # Task management
│ │ └── UsersController.cs # User management
│ │
│ ├── Models/ # Entity models
│ │ ├── User.cs # User entity
│ │ ├── MarketingTask.cs # Task entity
│ │ ├── MarketingCampaign.cs # Campaign entity
│ │ ├── State.cs, City.cs, etc. # Location entities
│ │ └── DTOs/ # Data Transfer Objects
│ │
│ ├── Services/ # Business logic
│ │ ├── ITaskService.cs # Task service interface
│ │ ├── TaskService.cs # Task service implementation
│ │ └── NotificationHub.cs # SignalR hub
│ │
│ ├── Data/ # Database context
│ │ └── MarketingTaskDbContext.cs
│ │
│ ├── appsettings.json # Configuration
│ ├── Program.cs # Application entry point
│ └── web.config # IIS configuration
│
├── 📂 frontend/ # Angular 17 Application
│ ├── src/
│ │ ├── app/
│ │ │ ├── components/ # UI Components
│ │ │ │ ├── admin-dashboard/
│ │ │ │ ├── employee-dashboard/
│ │ │ │ ├── login/
│ │ │ │ ├── marketing-form/
│ │ │ │ └── admin-task-modal/
│ │ │ │
│ │ │ ├── services/ # Angular Services
│ │ │ │ ├── auth.service.ts
│ │ │ │ ├── task.service.ts
│ │ │ │ ├── notification.service.ts
│ │ │ │ └── location.service.ts
│ │ │ │
│ │ │ ├── guards/ # Route Guards
│ │ │ │ └── auth.guard.ts
│ │ │ │
│ │ │ ├── interceptors/ # HTTP Interceptors
│ │ │ │ └── auth.interceptor.ts
│ │ │ │
│ │ │ ├── models/ # TypeScript Interfaces
│ │ │ │ ├── user.model.ts
│ │ │ │ ├── task.model.ts
│ │ │ │ └── location.model.ts
│ │ │ │
│ │ │ └── app.routes.ts # Route configuration
│ │ │
│ │ ├── assets/ # Static assets
│ │ │ └── images/
│ │ │
│ │ └── environments/ # Environment configs
│ │ ├── environment.ts
│ │ └── environment.prod.ts
│ │
│ ├── angular.json # Angular CLI config
│ ├── package.json # NPM dependencies
│ └── tsconfig.json # TypeScript config
│
├── 📂 database/ # SQL Scripts
│ ├── 01_Create_Database.sql # Database creation
│ ├── 02_Create_Tables.sql # Table schemas
│ ├── 03_Insert_Sample_Data.sql # Initial data
│ ├── 04_Stored_Procedures.sql # Stored procedures
│ └── 05_Location_Hierarchy.sql # Location data
│
├── 📂 Batch Files/ # Quick start scripts
│ ├── AUTO_START.bat # Start both (recommended)
│ ├── START_BACKEND.bat # Backend only
│ ├── START_FRONTEND.bat # Frontend only
│ └── start-clean-publish.ps1 # IIS deployment
│
└── 📄 Documentation/
├── README.md # This file
├── DEVELOPER_GUIDE.md # Development guide
├── API_DOCUMENTATION.md # API endpoints
├── DATABASE_SCHEMA.md # Database structure
└── DEPLOYMENT_GUIDE.md # Deployment instructions
- ✅ Node.js 18+ and npm
- ✅ .NET 8 SDK
- ✅ SQL Server (Local or Remote)
- ✅ Visual Studio Code (recommended)
# 1. Clone/Copy project
cd "c:\Marketing Form"
# 2. Backend setup
cd backend
dotnet restore
dotnet build
# 3. Frontend setup
cd ../frontend
npm install
npm run build
# 4. Database setup
# Run SQL scripts in order (01, 02, 03, 04, 05)
# Update connection string in backend/appsettings.jsonOption 1: Quick Start (Recommended)
Double-click: AUTO_START.batOption 2: Manual Start
# Terminal 1 - Backend
cd backend
dotnet run
# Terminal 2 - Frontend
cd frontend
ng serveAccess:
- Frontend: http://localhost:4200
- Backend API: http://localhost:5005
- Swagger: http://localhost:5005/swagger
Admin:
- Email:
admin@actionmedical.com - Password:
Admin123!
Employee (Test):
- Email: (from database)
- Password:
Employee123!
- ✅ Task Creation & Assignment
- ✅ Employee Management
- ✅ Marketing Campaign Management
- ✅ Task Status Tracking
- ✅ Real-time Notifications
- ✅ Location-based Task Assignment
- ✅ Task Rescheduling
- ✅ Dashboard Analytics
- ✅ View Assigned Tasks
- ✅ Update Task Status
- ✅ Submit Task Feedback
- ✅ View Task History
- ✅ Real-time Task Updates
- ✅ Print Task Details
- State → City → Locality → Pincode
- Complete India location data
- Cascading dropdowns
- Location-based filtering
Core Tables:
Users- User accounts (Admins & Employees)MarketingTasks- Task informationMarketingCampaigns- Campaign dataStates- State masterCities- City masterLocalities- Locality masterPincodes- Pincode masterTaskStatusHistory- Task status audit trail
See: DATABASE_SCHEMA.md for detailed schema
Authentication:
POST /api/auth/login- User loginPOST /api/auth/register- User registration
Tasks:
GET /api/tasks- Get all tasksGET /api/tasks/{id}- Get task by IDPOST /api/tasks- Create taskPUT /api/tasks/{id}- Update taskPUT /api/tasks/{id}/status- Update task statusPOST /api/tasks/{id}/reschedule- Reschedule task
Users:
GET /api/users- Get all usersGET /api/users/employees- Get employees only
Locations:
GET /api/areas/states- Get statesGET /api/areas/cities/{stateId}- Get cities by stateGET /api/areas/localities/{cityId}- Get localitiesGET /api/areas/pincodes/{localityId}- Get pincodes
See: API_DOCUMENTATION.md for complete API reference
- ✅ Use meaningful variable names
- ✅ Follow C# naming conventions (PascalCase for classes/methods)
- ✅ Follow TypeScript conventions (camelCase for variables)
- ✅ Add explanatory comments for complex logic
- ✅ Keep functions small and focused
- ✅ Use async/await for async operations
- Components:
component-name.component.ts - Services:
service-name.service.ts - Models:
model-name.model.ts - Controllers:
EntityController.cs
// Import section
import { Component } from '@angular/core';
// Component decorator
@Component({
selector: 'app-component-name',
templateUrl: './component-name.component.html',
styleUrls: ['./component-name.component.css']
})
// Component class
export class ComponentNameComponent {
// Properties
// Constructor
// Lifecycle hooks (ngOnInit, etc.)
// Public methods
// Private methods
}1. Update Database:
ALTER TABLE MarketingTasks ADD NewField VARCHAR(100);2. Update Backend Model:
// Models/MarketingTask.cs
public string? NewField { get; set; }3. Update Frontend Model:
// models/task.model.ts
export interface Task {
// ... existing fields
newField?: string;
}4. Update UI:
<!-- Add to form -->
<input [(ngModel)]="task.newField" />Backend:
// Controllers/TasksController.cs
[HttpGet("custom-endpoint")]
public async Task<IActionResult> CustomEndpoint()
{
// Your logic
return Ok(result);
}Frontend Service:
// services/task.service.ts
customEndpoint(): Observable<any> {
return this.http.get(`${this.apiUrl}/custom-endpoint`);
}# Check if port 5005 is in use
netstat -ano | findstr :5005
# Kill process if needed
taskkill /F /PID <PID># Clear cache and reinstall
rm -rf node_modules package-lock.json
npm install- Check SQL Server is running
- Verify connection string in
appsettings.json - Test connection with SQL Server Management Studio
Ready to Deploy? Complete guides available:
- GITHUB_DEPLOYMENT_GUIDE.md - Complete guide: Git setup → GitHub → Production deployment
- DEPLOYMENT_CHECKLIST.md - Step-by-step deployment checklist
- QUICK_UPDATE_GUIDE.md - How to update your deployed app
- PRODUCTION_READINESS_GUIDE.md - Security, performance, monitoring
Quick Start Deployment:
- Follow
GITHUB_DEPLOYMENT_GUIDE.md(30-60 minutes) - Use
DEPLOYMENT_CHECKLIST.mdto track progress - Deploy to:
- Frontend: Netlify (Free)
- Backend: Render (Free tier available)
- Database: Azure SQL ($5-15/month)
- DEVELOPER_GUIDE.md - Detailed development guide
- API_DOCUMENTATION.md - Complete API reference
- DATABASE_SCHEMA.md - Database structure
- DOCUMENTATION_GUIDE.md - How to maintain docs
For Issues:
- Check logs in backend terminal
- Check browser console for frontend errors
- Check SQL Server error logs
- Review this documentation
For Updates:
- Backend: Update NuGet packages
- Frontend: Update npm packages
- Test thoroughly after updates
Version: 1.0.0
Status: Production Ready
Last Updated: December 2025
Features Complete:
- ✅ Authentication & Authorization
- ✅ Task Management
- ✅ Location Hierarchy
- ✅ Real-time Notifications
- ✅ Responsive UI
- ✅ Print Functionality
- ✅ Task Rescheduling
Happy Coding! 🚀