H M < >
CMU597: Industry Project - Lecture 4

Sprint 1: Core System Foundations

Part A: Architecture & MVS | Part B: Sprint 1 Build

James Williams

Birmingham Newman University

jwilliams@staff.newman.ac.uk

3-hour session • 2 parts • 2 team tasks

Session Timeline

Part A: Architecture & Minimum Viable System (90 minutes)

30 minutes: Lecture on architecture patterns and system design

45 minutes: Task 1 - Design team system architecture

15 minutes: Break

Part B: Sprint 1 Build (90 minutes)

30 minutes: Guidance on implementing first component

45 minutes: Task 2 - Build Sprint 1 feature

15 minutes: Standup and blocker discussion

Learning Objectives

  • Understand common software architecture patterns
  • Learn when to apply different architectural styles
  • Design system architecture diagrams for team projects
  • Understand what makes a Minimum Viable System (MVS)
  • Implement first functional component collaboratively
  • Practice agile development workflows during sprint
  • Use version control effectively for team development
  • Track progress on Kanban boards in real-time

What is Software Architecture?

Software Architecture: The high-level structure of a system including components, their relationships, and how they communicate.

Why Architecture Matters:

  • Guides Development: Team knows how components fit together
  • Enables Parallel Work: Team members work on different components simultaneously
  • Scalability: Design for growth from the start
  • Maintainability: Clear structure makes changes easier
  • Communication: Shared understanding across team
Think of it as: A blueprint for your software, like architectural plans for a building.

Client-Server Architecture

Pattern: Separate client (frontend) and server (backend) that communicate over network.
┌─────────────────┐         HTTP/REST         ┌─────────────────┐
│                 │ ◄─────── Request ────────► │                 │
│     CLIENT      │                            │     SERVER      │
│  (Frontend UI)  │ ◄─────── Response ───────► │   (Backend API) │
│                 │                            │                 │
└─────────────────┘                            └────────┬────────┘
                                                        │
                                                        ▼
                                                 ┌──────────────┐
                                                 │   DATABASE   │
                                                 └──────────────┘
                    

Use When:

  • Building web or mobile apps with backend
  • Need to separate UI from business logic
  • Want multiple clients (web, mobile) using same backend

Client-Server Example: E-Commerce App

Components:

Client (React): Product browsing, cart management, checkout UI
Server (Node.js/Express): Product API, user authentication, order processing
Database (PostgreSQL): Products, users, orders

// Client: Fetch products from server
async function getProducts() {
  const response = await fetch('http://api.example.com/products');
  const products = await response.json();
  return products;
}

// Server: Product API endpoint
app.get('/products', async (req, res) => {
  const products = await db.query('SELECT * FROM products');
  res.json(products.rows);
});

API-First Architecture

Pattern: Design and build API before frontend, following REST or GraphQL principles.
                 ┌─────────────────┐
                 │   API GATEWAY   │
                 └────────┬────────┘
                          │
          ┌───────────────┼───────────────┐
          │               │               │
    ┌─────▼─────┐   ┌────▼────┐   ┌─────▼─────┐
    │   Web     │   │  Mobile │   │  Partner  │
    │   Client  │   │   App   │   │    API    │
    └───────────┘   └─────────┘   └───────────┘
                    

Benefits:

  • Multiple frontends can use same API
  • Frontend and backend teams work independently
  • Clear contract between teams (API specification)
  • Easier to test and document

Layered (N-Tier) Architecture

Pattern: Organize code into horizontal layers, each with specific responsibility.
┌─────────────────────────────────────┐
│      Presentation Layer (UI)       │
├─────────────────────────────────────┤
│    Application Layer (Business)    │
├─────────────────────────────────────┤
│    Data Access Layer (Database)    │
├─────────────────────────────────────┤
│         Database                    │
└─────────────────────────────────────┘
                    

Layer Responsibilities:

  • Presentation: User interface, input validation
  • Business Logic: Application rules, calculations, workflows
  • Data Access: Database queries, ORM operations
  • Database: Data storage

Microservices Architecture

Advanced Pattern: Usually too complex for student projects, but good to understand.
                    ┌──────────────┐
                    │  API Gateway │
                    └──────┬───────┘
           ┌───────────────┼───────────────┐
           │               │               │
    ┌──────▼──────┐ ┌─────▼─────┐ ┌──────▼──────┐
    │   User      │ │  Product  │ │   Order     │
    │  Service    │ │  Service  │ │   Service   │
    └──────┬──────┘ └─────┬─────┘ └──────┬──────┘
           │               │               │
        ┌──▼──┐        ┌──▼──┐        ┌──▼──┐
        │ DB  │        │ DB  │        │ DB  │
        └─────┘        └─────┘        └─────┘
                    

For Your Projects: Start with monolith (one server). Microservices add complexity.

Data Pipeline Architecture (For ML/Data Projects)

Pattern: Flow data through stages: collection → processing → analysis → output.
┌──────────┐    ┌──────────┐    ┌──────────┐    ┌──────────┐
│   Data   │───►│  Clean/  │───►│   ML     │───►│  Serve   │
│  Ingest  │    │Transform │    │  Model   │    │  Results │
└──────────┘    └──────────┘    └──────────┘    └──────────┘
                    

Example: Sentiment Analysis App

Ingest: Collect tweets via API
Transform: Clean text, tokenize
Model: Run sentiment classification
Serve: Dashboard displays results

Model-View-Controller (MVC) Pattern

Pattern: Separate data (Model), UI (View), and logic (Controller).
        ┌─────────────┐
        │    VIEW     │  (UI - displays data)
        └──────┬──────┘
               │
        ┌──────▼──────┐
        │ CONTROLLER  │  (Logic - handles events)
        └──────┬──────┘
               │
        ┌──────▼──────┐
        │    MODEL    │  (Data - business objects)
        └─────────────┘
                    

Separation of Concerns:

  • Model: User, Product, Order classes
  • View: React components, HTML templates
  • Controller: Route handlers, API endpoints

Choosing the Right Architecture for Your Team

Project Type Recommended Pattern Why
Web App with DB Client-Server + Layered Clear separation, team can split frontend/backend
Mobile + Web App API-First Single backend serves multiple clients
ML/Data Science Data Pipeline Natural flow from data to insights
Simple CRUD App MVC Monolith Simple, everything in one codebase
Team Decision: Discuss in Task 1 which pattern fits your project best.

What is a Minimum Viable System?

MVS: The simplest version of your system that demonstrates core functionality end-to-end. It should WORK but be minimal.

✓ MVS Includes:

  • One complete user flow
  • All layers connected (frontend → backend → DB)
  • Basic error handling
  • Deployable/runnable
  • Proves architecture works

✗ MVS Does NOT Include:

  • All features
  • Perfect UI/styling
  • Advanced optimizations
  • Edge case handling
  • Nice-to-have features

MVS Examples by Project Type

E-Commerce Platform MVS:

  • User can register and login
  • View list of 5 hardcoded products
  • Add one product to cart
  • View cart (no checkout yet)

Proves: Auth works, database connected, frontend/backend communicating

ML Image Classifier MVS:

  • Upload image via web form
  • Server runs classification model
  • Display top prediction
  • Store result in database

Proves: Pipeline works end-to-end, model integrated successfully

Task 1: Design Team System Architecture

Instructions (Work in your project teams):

  1. Choose Architecture Pattern (10 min):
    • Review patterns from lecture
    • Discuss which fits your project
    • Consider team skills and project requirements
  2. Identify Components (10 min):
    • List all major components (Frontend, Backend, DB, etc.)
    • Define what each component does
    • Identify technologies for each
  3. Draw Architecture Diagram (15 min):
    • Use whiteboard, draw.io, or Lucidchart
    • Show components as boxes
    • Draw arrows for data flow
    • Label communication protocols (HTTP, WebSocket, etc.)
  4. Define MVS Scope (10 min):
    • What's the ONE user flow to implement first?
    • Which components are needed for MVS?
    • What can wait until later sprints?

Time: 45 minutes

Deliverable: Architecture diagram + MVS scope document (save in docs/architecture.md)

Break Time

15 Minutes

Take a break. When you return, you'll start building!

Next: Part B - Sprint 1 Build

Part B: Building Your First Component

Now it's time to code! You'll implement your first functional component as a team.

Today's Goal:

  • Choose ONE user story from sprint backlog
  • Break it into tasks
  • Assign tasks to team members
  • Start implementation during session
  • Use Git branches and collaboration
  • Update Kanban board as you progress

Common First Features to Build

User Authentication:

Registration, login, JWT tokens, protected routes

Good because: fundamental to most apps, tests full stack

CRUD Operations:

Create, Read, Update, Delete for one entity (e.g., Products, Posts)

Good because: covers all HTTP methods, database operations

Data Display & Filtering:

Show list of items, add search/filter functionality

Good because: involves API calls, state management, UI

ML Model Integration:

Upload data, run model, display prediction

Good because: validates pipeline works end-to-end

Breaking Down a Feature Into Tasks

User Story: "As a user, I want to register an account so that I can log in later"

Technical Tasks:

  1. Database: Create users table with schema (name, email, password hash)
  2. Backend: Create POST /api/register endpoint
    • Validate input (email format, password strength)
    • Hash password with bcrypt
    • Insert user into database
    • Return success/error response
  3. Frontend: Build registration form
    • Input fields (name, email, password, confirm password)
    • Client-side validation
    • Call API on submit
    • Show success or error message
  4. Testing: Test registration flow end-to-end

Team Task Assignment Strategy

Option 1: Horizontal Split

  • Person A: Frontend
  • Person B: Backend API
  • Person C: Database
  • Person D: Testing/integration

Good: Everyone works in their comfort zone

Option 2: Vertical Split

  • Person A: User registration (full stack)
  • Person B: User login (full stack)
  • Person C: Profile page (full stack)

Good: Everyone learns full system

Recommended: Start with horizontal split (faster), later sprints use vertical.

Git Workflow During Sprint

# 1. At start of feature
git checkout main
git pull origin main
git checkout -b feature/user-registration

# 2. Work on your task, commit frequently
git add src/components/RegisterForm.jsx
git commit -m "feat: add registration form UI"

git add src/api/auth.js
git commit -m "feat: add registration API call"

# 3. Push to remote regularly (backup + visibility)
git push origin feature/user-registration

# 4. When done, create Pull Request
# Team reviews code, suggests changes

# 5. After approval, merge to main
# Delete feature branch after merged

Team Code Review Guidelines

What to Check:

  • Functionality: Does it work? Does it meet acceptance criteria?
  • Code Quality: Readable? Well-structured? Follows team standards?
  • No Bugs: Check for obvious errors, edge cases
  • Tests: Are there tests? Do they pass?
  • Documentation: Complex code have comments?

Constructive Feedback Example:

✓ "Consider extracting validation logic into a separate function for reusability"
✗ "This code is messy"

Quick Team Check-ins

Mini Standup: Every 20-30 minutes during build sessions, quick sync:
  1. Progress Update: What have you completed?
  2. Current Work: What are you working on now?
  3. Blockers: Stuck on anything? Need help?

Example:

"I finished the registration form UI. Now working on API integration. Stuck on CORS error - can someone help after their task?"

Help Each Other: If someone's blocked, pause and pair program to solve it together.

Integrating Team Code

Integration Challenges:

  • Merge Conflicts: Two people edited same file
    Solution: Pull from main frequently, communicate about file changes
  • API Mismatches: Frontend expects different response than backend sends
    Solution: Agree on API contract first, document it
  • Environment Differences: Works on one person's machine, not others
    Solution: Use .env files, Docker, document setup clearly
Integration Early Principle: Don't wait until end of sprint. Integrate components as soon as they're ready!

Testing Your Component

Levels of Testing:

Manual Testing:

  • Run the app locally
  • Try the feature as a user would
  • Test edge cases
  • Verify error handling

Automated Testing (if time):

  • Unit tests for functions
  • API endpoint tests
  • Integration tests
// Simple API test example (Jest + Supertest)
test('POST /api/register creates new user', async () => {
  const response = await request(app)
    .post('/api/register')
    .send({ email: 'test@example.com', password: 'password123' });
  
  expect(response.status).toBe(201);
  expect(response.body).toHaveProperty('userId');
});

Keeping Kanban Board Updated

Move Cards as Work Progresses:

To DoIn ProgressReviewDone

Best Practices:

  • Move card to "In Progress" when you start
  • Add comments with updates or blockers
  • Move to "Review" when ready for PR
  • Move to "Done" only when merged and deployed
  • Update at least once per day
Why? Entire team can see progress at a glance. No need to ask "who's working on what?"

Common Sprint 1 Issues & Solutions

Issue Solution
Story too big to finish Break into smaller stories, complete subset
Blocked by another task Use mocks/stubs, or pair to unblock
Merge conflicts Pull from main daily, small focused PRs
Someone behind schedule Pair programming, redistribute tasks
Technical blocker Ask instructor, use Moodle forum, Stack Overflow

Task 2: Implement Sprint 1 Feature

Instructions (Work in your project teams):

  1. Select User Story (5 min):
    • Choose ONE story from Sprint 1 backlog
    • Ensure it's achievable today + this week
  2. Break into Tasks (5 min):
    • List all technical tasks
    • Assign to team members based on skills
  3. Create Feature Branches (5 min):
    • Each person creates branch for their task
    • Push empty branches to remote
  4. Start Implementation (25 min):
    • Begin coding your assigned task
    • Commit frequently with clear messages
    • Update Kanban board to "In Progress"
  5. Quick Standup (5 min):
    • Share progress and blockers
    • Help team members who are stuck

Time: 45 minutes

Deliverable: Started implementation with initial commits pushed

Lecture 4 Summary

  • Software architecture defines high-level system structure
  • Common patterns: Client-Server, API-First, Layered, MVC, Data Pipeline
  • Choose architecture based on project type and team skills
  • MVS proves architecture with minimal but complete functionality
  • Break user stories into specific technical tasks
  • Use Git branches and pull requests for team collaboration
  • Code reviews improve quality and share knowledge
  • Update Kanban board to keep team synchronized

Next Lecture:

Sprint 1 Review & Sprint 2 Start
Demo your work, conduct retrospective, and plan next sprint

Before Next Lecture

  1. Complete Sprint 1 Work:
    • Finish your assigned tasks
    • Create pull requests for review
    • Review teammates' code
    • Merge approved PRs
  2. Update Documentation:
    • Save architecture diagram to docs/architecture.md
    • Update README if needed
  3. Prepare for Review:
    • Test your feature end-to-end
    • Prepare to demo what you built
    • Note any challenges for retrospective
  4. Submit to Moodle:
    • Architecture diagram
    • Link to merged PRs
    • Screenshot of working feature