Skip to content

MalNko/secure-task-manager

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

11 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

πŸ”’ Secure Task Manager

CI/CD - Production Security Scanning License: MIT .NET React Docker

A production-ready task management application showcasing enterprise-level DevSecOps practices, automated CI/CD pipelines, comprehensive security scanning, and cloud-native architecture.

🌟 Project Highlights

This portfolio project demonstrates:

  • βœ… Complete CI/CD Pipeline - Automated build, test, and deployment across multiple environments
  • βœ… Security-First Approach - Integrated vulnerability scanning at every stage
  • βœ… Infrastructure as Code - Docker containerization with orchestration
  • βœ… Multi-Environment Strategy - Dev, Staging, and Production workflows
  • βœ… Automated Testing - Unit and integration tests with code coverage
  • βœ… Cloud-Native Design - Microservices architecture ready for cloud deployment

πŸ—οΈ Architecture

System Architecture

β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚                        GitHub Actions                        β”‚
β”‚  β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”  β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”  β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”  β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”   β”‚
β”‚  β”‚   Dev    β”‚  β”‚ Staging  β”‚  β”‚   Prod   β”‚  β”‚ Security β”‚   β”‚
β”‚  β”‚ Pipeline β”‚  β”‚ Pipeline β”‚  β”‚ Pipeline β”‚  β”‚ Scanning β”‚   β”‚
β”‚  β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜  β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜  β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜  β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜   β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
                            β”‚
                            β–Ό
β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚                     Docker Containers                        β”‚
β”‚  β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”  β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”  β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”     β”‚
β”‚  β”‚   React UI   β”‚  β”‚  .NET API    β”‚  β”‚  PostgreSQL  β”‚     β”‚
β”‚  β”‚  (Port 3000) β”‚  β”‚ (Port 5000)  β”‚  β”‚  (Port 5432) β”‚     β”‚
β”‚  β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜  β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜  β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜     β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜

Technology Stack

Backend:

  • .NET 8.0 Web API
  • Entity Framework Core
  • PostgreSQL Database
  • JWT Authentication
  • BCrypt Password Hashing

Frontend:

  • React 18
  • Axios for API calls
  • Modern CSS styling
  • Responsive design

DevOps & Security:

  • Docker & Docker Compose
  • GitHub Actions CI/CD
  • Snyk (Dependency scanning)
  • Trivy (Container scanning)
  • GitLeaks (Secret detection)
  • SonarCloud (Code quality)

πŸš€ Quick Start

Prerequisites

Running with Docker (Recommended)

# Clone the repository
git clone https://github.com/MalNko/secure-task-manager.git
cd secure-task-manager

# Start all services
docker-compose -f docker/docker-compose.yml up --build

Access the application:

Running Locally

Backend API:

cd src/SecureTaskManager.API
dotnet restore
dotnet run

Frontend:

cd src/SecureTaskManager.Web
npm install
npm start

Database:

docker-compose -f docker/docker-compose.yml up db

πŸ” Security Features

Automated Security Scanning

Every code push triggers comprehensive security checks:

  1. Secret Scanning - GitLeaks detects accidentally committed credentials
  2. Dependency Vulnerabilities - Snyk scans for known CVEs in packages
  3. Container Security - Trivy scans Docker images for vulnerabilities
  4. Code Quality - SonarCloud analyzes code for bugs and security hotspots

Application Security

  • πŸ”’ JWT-based authentication
  • πŸ”’ Bcrypt password hashing
  • πŸ”’ SQL injection protection via parameterized queries
  • πŸ”’ CORS configuration
  • πŸ”’ Security headers (X-Frame-Options, X-Content-Type-Options, etc.)
  • πŸ”’ Rate limiting middleware
  • πŸ”’ Input validation and sanitization

πŸ”„ CI/CD Pipeline

Multi-Environment Strategy

graph LR
    A[Developer Push] --> B[Dev Branch]
    B --> C[CI - Dev Pipeline]
    C --> D[Automated Tests]
    D --> E[Security Scans]
    
    F[Merge to Staging] --> G[Staging Pipeline]
    G --> H[Integration Tests]
    H --> I[Docker Build]
    
    J[Merge to Main] --> K[Production Pipeline]
    K --> L[Full Test Suite]
    L --> M[Security Audit]
    M --> N[Docker Registry]
    N --> O[Deployment]
Loading

Pipeline Stages

  1. Build - Compile .NET API and React frontend
  2. Test - Run unit and integration tests
  3. Security Scan - Automated vulnerability detection
  4. Docker Build - Create optimized container images
  5. Deploy - Automated deployment (when configured)

πŸ“ Project Structure

secure-task-manager/
β”œβ”€β”€ .github/
β”‚   └── workflows/              # GitHub Actions CI/CD pipelines
β”‚       β”œβ”€β”€ ci-dev.yml         # Development environment
β”‚       β”œβ”€β”€ ci-staging.yml     # Staging environment
β”‚       β”œβ”€β”€ ci-prod.yml        # Production environment
β”‚       └── security-scan.yml  # Security scanning
β”œβ”€β”€ src/
β”‚   β”œβ”€β”€ SecureTaskManager.API/ # .NET Web API
β”‚   β”‚   β”œβ”€β”€ Controllers/       # API endpoints
β”‚   β”‚   β”œβ”€β”€ Models/           # Data models
β”‚   β”‚   β”œβ”€β”€ Data/             # Database context
β”‚   β”‚   └── Program.cs        # Application entry point
β”‚   └── SecureTaskManager.Web/ # React frontend
β”‚       β”œβ”€β”€ public/
β”‚       └── src/
β”‚           β”œβ”€β”€ components/    # React components
β”‚           └── services/      # API services
β”œβ”€β”€ tests/
β”‚   └── SecureTaskManager.Tests/ # Unit and integration tests
β”œβ”€β”€ docker/
β”‚   β”œβ”€β”€ Dockerfile            # API container
β”‚   β”œβ”€β”€ Dockerfile.web        # Frontend container
β”‚   β”œβ”€β”€ docker-compose.yml    # Multi-container orchestration
β”‚   └── nginx.conf           # Nginx configuration
└── docs/                     # Additional documentation

πŸ§ͺ Testing

Run Tests Locally

# Run all tests
dotnet test

# Run with coverage
dotnet test /p:CollectCoverage=true /p:CoverageReportsFormat=opencover

# Run specific test project
dotnet test tests/SecureTaskManager.Tests/SecureTaskManager.Tests.csproj

Test Coverage

  • Unit tests for controllers and services
  • Integration tests for API endpoints
  • Frontend component tests (React Testing Library)

πŸ“Š Monitoring & Observability

Health Checks

  • API Health Endpoint: /health
  • Database Connection: Verified on startup
  • Swagger Documentation: /swagger

Logging

  • Structured logging with Serilog
  • Console and file outputs
  • Request/response logging
  • Error tracking

🚒 Deployment

Docker Deployment

The application is containerized and ready for deployment to:

  • AWS ECS/EKS
  • Azure Container Instances
  • Google Cloud Run
  • Any Docker-compatible platform

Environment Variables

# API Configuration
ASPNETCORE_ENVIRONMENT=Production
ConnectionStrings__DefaultConnection=<database-connection-string>
Jwt__Key=<your-secret-key>

# Frontend Configuration
REACT_APP_API_URL=<api-url>

🀝 Contributing

This is a portfolio project, but suggestions and feedback are welcome!

  1. Fork the repository
  2. Create a feature branch (git checkout -b feature/amazing-feature)
  3. Commit your changes (git commit -m 'Add amazing feature')
  4. Push to the branch (git push origin feature/amazing-feature)
  5. Open a Pull Request

πŸ“ License

This project is licensed under the MIT License - see the LICENSE file for details.


πŸ‘¨β€πŸ’» Author

Malusi Thandolwethu Nathan Nkosi


🎯 Learning Outcomes

This project demonstrates proficiency in:

  • βœ… Cloud-native application development
  • βœ… DevOps & CI/CD pipeline design
  • βœ… Security best practices (DevSecOps)
  • βœ… Container orchestration
  • βœ… Full-stack development (.NET + React)
  • βœ… Database design and ORM usage
  • βœ… RESTful API design
  • βœ… Authentication & authorization
  • βœ… Test-driven development
  • βœ… Infrastructure as Code

πŸ“š Documentation

For more detailed documentation, see:


⭐ Star this repository if you find it helpful!

Made with ❀️ for learning and portfolio

About

DevSecOps portfolio project with CI/CD pipeline

Resources

Security policy

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors