Skip to content

ajacobm/alexlee

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

27 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

Alex Lee Developer Exercise

A full-stack application built with .NET 8 and React.js, showcasing technical skills through algorithm implementation, SQL Server database management, and modern web development practices with enterprise-ready deployments.

🎯 Project Overview

This project addresses the Alex Lee Developer Technical Screening requirements with a comprehensive solution featuring:

  • Backend: .NET 8 WebAPI with CQRS pattern, EF Core, and SQL Server Express
  • Frontend: React.js SPA with modern state management and Alex Lee branding
  • Algorithms: C# extension methods with cross-platform file search
  • Database: SQL Server Express in Docker with stored procedures and original SQLExerciseScript.sql data
  • DevOps: Docker containers with volume mounting for Windows/Linux compatibility

πŸ—„οΈ SQL Server Express Integration

NEW: This project now uses SQL Server Express instead of SQLite, providing:

  • βœ… Enterprise-grade database running in Docker containers
  • βœ… Stored procedures implementing SQL Exercise questions #4-6
  • βœ… Automatic database initialization using provided SQLExerciseScript.sql
  • βœ… Cross-platform file search with Windows volume mounting
  • βœ… Production-ready deployment with health checks and monitoring

πŸ“– Complete SQL Server Integration Guide

πŸ—οΈ Architecture

alex-lee/
β”œβ”€β”€ backend/                    # .NET 8 WebAPI
β”‚   β”œβ”€β”€ src/
β”‚   β”‚   β”œβ”€β”€ AlexLee.Api/        # WebAPI controllers & middleware
β”‚   β”‚   β”œβ”€β”€ AlexLee.Application/ # CQRS commands/queries  
β”‚   β”‚   β”œβ”€β”€ AlexLee.Domain/     # Domain models (records)
β”‚   β”‚   β”œβ”€β”€ AlexLee.Infrastructure/ # EF Core & SQL Server
β”‚   β”‚   └── AlexLee.Algorithms/ # Enhanced file search utilities
β”‚   β”œβ”€β”€ scripts/                # SQL Server initialization scripts
β”‚   └── Dockerfile              # Multi-stage build with SQL Server support
β”œβ”€β”€ frontend/                   # React.js SPA with Alex Lee branding
β”œβ”€β”€ SQLExerciseScript.sql       # Original SQL Server data script
β”œβ”€β”€ sql-server.sh               # SQL Server management helper script
└── docker-compose.yml          # SQL Server Express environment

βœ… Solved Problems

C# Problems (Completed βœ…)

  1. String Interleaving - Extension method with 8 unit tests
  2. Palindrome Checker - Extension method with case/punctuation handling (8 tests)
  3. Parallel File Search - Enhanced with Windows/Docker cross-platform support (5 tests)

SQL Problems (Implemented with Stored Procedures βœ…)

  1. Line Numbering - GetPurchaseDetailsWithLineNumbers stored procedure
  2. Duplicate Detection - GetDuplicatePurchaseDetails stored procedure
  3. Stored Procedure Integration - Direct EF Core stored procedure calls

React Problems (Completed βœ…)

  1. Purchase Detail Grid - Professional UI with Alex Lee styling and filtering
  2. Create/Update Modal - Form validation with CRUD operations

πŸš€ Quick Start

SQL Server Express Environment (Recommended)

Using Helper Script (Linux/macOS/WSL):

# Make script executable
chmod +x sql-server.sh

# Start full SQL Server Express environment  
./dev.sh dev

# Check SQL Server status
./dev.sh sql-status

# Test API endpoints including stored procedures
./dev.sh test-api

# Access SQL Server shell for manual queries
./dev.sh sql-shell

Using Docker Compose Directly:

# Development with SQL Server Express
docker-compose up --build

# Production environment
./dev.sh prod
# OR: docker-compose -f docker-compose.prod.yml up -d

Access Points

  • Frontend: http://localhost:3000 (Alex Lee styled React app)
  • Backend API: http://localhost:5000
  • Swagger Documentation: http://localhost:5000/swagger
  • SQL Server: localhost:1433 (SA/P@ssw0rd123!)

πŸ—ƒοΈ SQL Server Features

Database Structure

-- Automatically created from SQLExerciseScript.sql
CREATE TABLE dbo.PurchaseDetailItem (
    PurchaseDetailItemAutoId BIGINT IDENTITY(1,1) NOT NULL,
    PurchaseOrderNumber VARCHAR(20) NOT NULL,
    ItemNumber INT NOT NULL,
    ItemName VARCHAR(50) NOT NULL,
    ItemDescription VARCHAR(250),
    PurchasePrice DECIMAL(10,2) NOT NULL,
    PurchaseQuantity INT NOT NULL,
    LastModifiedByUser VARCHAR(50) NOT NULL,
    LastModifiedDateTime DATETIME NOT NULL
);

API Endpoints for SQL Exercises

# Question #6: Purchase details with line numbers
curl "http://localhost:5000/api/purchasedetails/with-line-numbers"

# Question #5: Duplicate detection
curl "http://localhost:5000/api/purchasedetails/duplicates"

# Summary with stored procedure info
curl "http://localhost:5000/api/purchasedetails/summary"

Stored Procedures

  • GetPurchaseDetailsWithLineNumbers - Implements ROW_NUMBER() for Question #4
  • GetDuplicatePurchaseDetails - Identifies duplicates for Question #5
  • CheckDatabaseReady - Health check utility

πŸ“ Enhanced File Search (Problem #3)

Cross-platform file search with Windows/Docker support:

Volume Mounting Strategy

# Mounts Windows C:/Users to /app/search-files/windows in container
volumes:
  - /mnt/c/Users/meyer/Desktop:/app/search-files/windows:ro

API Usage

# Get available search paths (Windows/Docker aware)
curl "http://localhost:5000/api/algorithms/file-search/available-paths"

# Search in mounted Windows directory
curl -X POST "http://localhost:5000/api/algorithms/file-search" \
     -H "Content-Type: application/json" \
     -d '{"searchTerm":"TODO","directoryPath":"/app/search-files/windows/Documents"}'

πŸ§ͺ Testing

Backend Tests (29 passing)

# Using helper script
./dev.sh dev
sleep 10  # Wait for SQL Server
./dev.sh test-api

# Manual testing  
cd backend && dotnet test --verbosity normal

Test Categories

  • String Extensions: 8 test cases
  • Palindrome Logic: 8 test cases
  • File Search: 5 test cases with cross-platform support
  • Integration Tests: 8 test cases

SQL Server Verification

# Manual SQL Server testing
./dev.sh sql-shell

# In SQL shell:
USE AlexLeeDB;
EXEC dbo.GetPurchaseDetailsWithLineNumbers;
EXEC dbo.GetDuplicatePurchaseDetails;

πŸ“‹ Complete Requirements Checklist

βœ… C# Problems (Completed)

  • Problem 1: String interleaving with unit tests
  • Problem 2: Palindrome checker with comprehensive test cases
  • Problem 3: Parallel file search with Windows/Docker volume support

βœ… SQL Problems (Implemented)

  • Problem 4: ROW_NUMBER() line numbering via stored procedure
  • Problem 5: Duplicate detection via stored procedure
  • Problem 6: Stored procedure integration with EF Core

βœ… React Problems (Completed)

  • Problem 7: Purchase detail grid with Alex Lee styling and filtering
  • Problem 8: Modal CRUD operations with form validation

βœ… Technical Implementation

  • SQL Server Express: Docker containerized with health checks
  • Database Initialization: Automatic SQLExerciseScript.sql loading
  • CQRS Pattern: Commands/Queries with MediatR
  • Domain Models: Immutable records pattern
  • Cross-platform Support: Windows volume mounting in Docker
  • Production Deployment: Docker Compose orchestration
  • Comprehensive Testing: 29 unit tests + API integration tests

πŸ› οΈ Technology Stack

Backend:

  • .NET 8 WebAPI
  • SQL Server Express 2022
  • Entity Framework Core 9
  • MediatR (CQRS pattern)
  • xUnit with 29 test cases

Frontend:

  • React 18 + TypeScript
  • Alex Lee Corporate Branding
  • React Query for state management
  • Professional UI components

Infrastructure:

  • Docker + SQL Server Express
  • Cross-platform volume mounting
  • Health checks and monitoring
  • Production-ready orchestration

πŸ“Š API Documentation

Core Endpoints

  • Swagger: http://localhost:5000/swagger
  • Health: http://localhost:5000/health
  • Purchase Details: http://localhost:5000/api/purchasedetails

SQL Exercise Endpoints

  • Line Numbers: GET /api/purchasedetails/with-line-numbers
  • Duplicates: GET /api/purchasedetails/duplicates
  • Summary: GET /api/purchasedetails/summary

Algorithm Endpoints

  • String Interleave: POST /api/algorithms/string-interleave
  • Palindrome Check: POST /api/algorithms/palindrome-check
  • File Search: POST /api/algorithms/file-search
  • Available Paths: GET /api/algorithms/file-search/available-paths

🎨 Alex Lee Branding Integration

The frontend features authentic Alex Lee corporate styling:

  • Professional Typography: Corporate font family
  • Brand Colors: Blue (#0074bc) and gold (#e8b441) color scheme
  • Triangular Design Elements: Inspired by Alex Lee visual identity
  • Responsive Layout: Desktop and mobile optimized
  • Production Polish: Professional UI/UX with loading states

πŸ”§ Development & Management

SQL Server Management Commands

./dev.sh dev         # Start development environment
./dev.sh sql-status  # Check SQL Server health
./dev.sh sql-shell   # Interactive SQL Server shell  
./dev.sh backup-db   # Backup database
./dev.sh logs        # Show application logs
./dev.sh clean       # Full cleanup

Development Workflow

# Start complete environment
./dev.sh dev

# Make changes to code...

# Test changes
./dev.sh test-api

# View logs  
./dev.sh logs

# SQL debugging
./dev.sh sql-shell

πŸ“ˆ Production Deployment

Production-ready features:

  • SQL Server Express with persistent volumes
  • Health checks for all services
  • Multi-stage Docker builds for optimal image sizes
  • Windows file system volume mounting
  • Comprehensive logging and monitoring
# Start production environment
./dev.sh prod

# Check production status
docker-compose -f docker-compose.prod.yml ps

πŸ† Project Completion Status

This Alex Lee Developer Exercise is COMPLETE with enterprise-grade implementation:

βœ… All 8 Problems Solved - C#, SQL, and React requirements met
βœ… SQL Server Express Integration - Production database with stored procedures
βœ… Cross-platform File Search - Windows/Docker volume mounting
βœ… Professional UI - Alex Lee corporate branding and styling
βœ… Production Deployment - Docker orchestration with health monitoring
βœ… Comprehensive Testing - 29 unit tests + API integration verification

πŸ“š Documentation


Author: Adam Jacob Meyer
Repository: github.com/ajacobm/alex-lee
Exercise: Alex Lee Developer Technical Screening - SQL Server Express Edition

About

100% Spec-Flow Developed! An assessment of Agentic Coding with Sonnet 4.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published