Skip to content

Conversation

Copy link

Copilot AI commented Jul 19, 2025

Summary

This PR reorganizes the entire repository structure to improve code organization and adds comprehensive Docker support with automated CI/CD workflows.

Changes Made

📁 Repository Structure Reorganization

  • Created src/ folder to contain all source code
  • Moved code directories to src/:
    • exercises/src/exercises/ (lab sample works)
    • project/src/project/ (actual project submissions)
    • starter/src/starter/ (starter code templates)
    • ci-scripts/src/ci-scripts/ (CI/CD utilities)
  • Kept essential docs in root:
    • README.md, LICENSE, .gitignore
    • images/ (certificates and documentation)
    • Configuration files (.angulardoc.json, .travis.yml, etc.)

📝 Documentation Updates

  • Updated README.md with new folder structure and paths
  • Added DOCKER.md with comprehensive Docker usage instructions
  • Updated all project links to reference new src/ paths

🐳 Docker Support

  • Created main Dockerfile with multi-stage build support
  • Added .dockerignore for optimized builds
  • Supports building any Node.js project in the repository via build args:
    docker build --build-arg PROJECT_PATH=src/project/image-filter-udagram-app -t udacity-image-filter .

🚀 GitHub Actions CI/CD

  • Updated existing workflows to use new src/ paths
  • Fixed build commands to use available scripts (tsc vs build)
  • Added comprehensive Docker build/publish workflow (docker-build-publish.yml):
    • Builds multiple project variants automatically
    • Publishes to GitHub Container Registry (ghcr.io)
    • Supports both main Dockerfile and individual project Dockerfiles
    • Includes proper tagging (branch, semver, SHA)
    • Matrix strategy for building multiple projects simultaneously

🔧 Build Improvements

  • Verified all builds work with new structure
  • Updated workflow commands to match available npm scripts
  • Added safety checks in Docker workflow to only build projects with package.json

Testing

Verified npm builds work in new structure:

  • src/exercises/udacity-c2-basic-server - npm ci + tsc ✓
  • src/project/image-filter-udagram-app - npm ci + build ✓

Docker builds validated with new Dockerfile structure

GitHub Actions workflows updated and tested

Impact

This reorganization provides:

  1. Better code organization with clear separation of concerns
  2. Cleaner root directory with only essential documentation
  3. Full Docker support for containerizing any project
  4. Automated CI/CD for Docker image builds and publishing
  5. Improved maintainability with consistent structure

Container Images

The following images will be automatically built and published:

  • ghcr.io/nithinmohantk/udacity-aws-developer-project-workspace/image-filter-udagram
  • ghcr.io/nithinmohantk/udacity-aws-developer-project-workspace/udacity-c2-frontend
  • ghcr.io/nithinmohantk/udacity-aws-developer-project-workspace/udacity-c2-restapi-feed
  • ghcr.io/nithinmohantk/udacity-aws-developer-project-workspace/udacity-c2-restapi-user

💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.

Copilot AI and others added 2 commits July 19, 2025 19:59
Co-authored-by: nithinmohantk <453945+nithinmohantk@users.noreply.github.com>
Co-authored-by: nithinmohantk <453945+nithinmohantk@users.noreply.github.com>
Copilot AI changed the title [WIP] Can you move all the code to src folder and organize them properly, keeping all essential docs in root folder. update Dockerfile to match the same. Also include github actions build for Dockerfile to package and publish the code as container file. Reorganize repository structure with src/ folder and add Docker support with CI/CD Jul 19, 2025
Copilot AI requested a review from nithinmohantk July 19, 2025 20:13
Copilot finished work on behalf of nithinmohantk July 19, 2025 20:13
Copy link
Owner

@nithinmohantk nithinmohantk left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

all looks good.

@nithinmohantk nithinmohantk marked this pull request as ready for review August 15, 2025 16:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants