Skip to content

nicholasjam/coding-challenge-serverless-guru

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

10 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

Full-Stack Task Management Application

A complete serverless full-stack application built with AWS Lambda, DynamoDB, API Gateway, and React. This project demonstrates modern web development practices with a scalable serverless architecture, responsive design, and automated CI/CD pipelines.

🎯 Project Overview

This application was built as a comprehensive coding challenge showcasing:

  • Complete CRUD functionality for task management
  • Serverless backend with AWS Lambda and DynamoDB
  • Modern React frontend with Material-UI
  • Responsive design for all device sizes
  • CI/CD pipelines with GitHub Actions
  • Infrastructure as Code with Serverless Framework
  • Comprehensive testing and documentation

πŸ—οΈ Architecture

Backend (Serverless)

  • Framework: Serverless Framework
  • Runtime: Node.js 18.x
  • Database: AWS DynamoDB with Global Secondary Index
  • API: AWS API Gateway (REST) with CORS
  • Functions: 5 AWS Lambda functions for CRUD operations
  • Validation: Joi schema validation
  • Testing: Jest with comprehensive test coverage

Frontend (React)

  • Framework: React 18 with hooks and context
  • UI Library: Material-UI (MUI) v5
  • State Management: React Context + useReducer
  • HTTP Client: Axios with interceptors
  • Routing: React Router v6
  • Date Handling: date-fns
  • Notifications: Notistack for user feedback

DevOps & CI/CD

  • Version Control: Git with feature branch workflow
  • CI/CD: GitHub Actions for multi-stage deployments
  • Infrastructure: Infrastructure as Code with Serverless Framework
  • Hosting: Netlify for frontend, AWS for backend
  • Monitoring: AWS CloudWatch for logs and metrics

πŸ“ Project Structure

task-manager/
β”œβ”€β”€ backend/                 # Serverless backend
β”‚   β”œβ”€β”€ src/
β”‚   β”‚   β”œβ”€β”€ handlers/        # Lambda function handlers
β”‚   β”‚   β”‚   β”œβ”€β”€ createTask.js
β”‚   β”‚   β”‚   β”œβ”€β”€ getTasks.js
β”‚   β”‚   β”‚   β”œβ”€β”€ getTask.js
β”‚   β”‚   β”‚   β”œβ”€β”€ updateTask.js
β”‚   β”‚   β”‚   └── deleteTask.js
β”‚   β”‚   β”œβ”€β”€ models/          # Data models and validation
β”‚   β”‚   β”‚   └── Task.js
β”‚   β”‚   └── utils/           # Utility functions
β”‚   β”‚       β”œβ”€β”€ dynamodb.js
β”‚   β”‚       └── response.js
β”‚   β”œβ”€β”€ serverless.yml       # Infrastructure configuration
β”‚   β”œβ”€β”€ package.json
β”‚   └── README.md
β”œβ”€β”€ frontend/                # React frontend
β”‚   β”œβ”€β”€ src/
β”‚   β”‚   β”œβ”€β”€ components/      # Reusable UI components
β”‚   β”‚   β”‚   └── Layout/
β”‚   β”‚   β”œβ”€β”€ pages/           # Page components
β”‚   β”‚   β”‚   β”œβ”€β”€ TaskList.js
β”‚   β”‚   β”‚   β”œβ”€β”€ TaskDetail.js
β”‚   β”‚   β”‚   β”œβ”€β”€ CreateTask.js
β”‚   β”‚   β”‚   β”œβ”€β”€ EditTask.js
β”‚   β”‚   β”‚   └── NotFound.js
β”‚   β”‚   β”œβ”€β”€ services/        # API services
β”‚   β”‚   β”‚   β”œβ”€β”€ api.js
β”‚   β”‚   β”‚   └── taskService.js
β”‚   β”‚   β”œβ”€β”€ context/         # State management
β”‚   β”‚   β”‚   └── TaskContext.js
β”‚   β”‚   └── config/          # Configuration
β”‚   β”‚       └── environment.js
β”‚   β”œβ”€β”€ public/
β”‚   β”œβ”€β”€ package.json
β”‚   └── README.md
β”œβ”€β”€ .github/
β”‚   └── workflows/           # CI/CD pipelines
β”‚       β”œβ”€β”€ backend-deploy.yml
β”‚       └── frontend-deploy.yml
β”œβ”€β”€ docs/                    # Documentation
β”‚   β”œβ”€β”€ API.md              # API documentation
β”‚   └── DEPLOYMENT.md       # Deployment guide
β”œβ”€β”€ scripts/                 # Development scripts
β”‚   └── setup.sh            # Automated setup script
└── README.md               # This file

✨ Features

Task Management

  • βœ… Create Tasks: Rich form with validation and date picker
  • βœ… View Tasks: Detailed task information with status tracking
  • βœ… Update Tasks: In-place editing with real-time validation
  • βœ… Delete Tasks: Safe deletion with confirmation dialogs
  • βœ… List Tasks: Paginated list with advanced filtering

User Experience

  • πŸ“± Responsive Design: Optimized for mobile, tablet, desktop, and large screens
  • 🎨 Modern UI: Clean, intuitive Material Design interface
  • ⚑ Real-time Updates: Live status updates and notifications
  • πŸ” Advanced Filtering: Filter by status, priority, and search text
  • πŸš€ Performance: Optimized loading states and error handling

Technical Features

  • πŸ” Input Validation: Comprehensive client and server-side validation
  • πŸ›‘οΈ Error Handling: Graceful error handling with user-friendly messages
  • πŸ“Š State Management: Efficient state management with React Context
  • πŸ”„ API Integration: Robust API layer with retry logic and caching
  • πŸ§ͺ Testing: Unit and integration tests for critical functionality

πŸš€ Quick Start

Option 1: Automated Setup (Recommended)

# Clone the repository
git clone <repository-url>
cd task-manager

# Run automated setup
./scripts/setup.sh

# Start development environment
./start-dev.sh

Option 2: Manual Setup

Prerequisites

  • Node.js 18+ and npm
  • AWS CLI configured
  • Serverless Framework CLI (npm install -g serverless)

Backend Setup

cd backend
npm install
npm run dynamodb:install
npm run dynamodb:start &
npm run offline

Frontend Setup

cd frontend
npm install
# Create .env.local with REACT_APP_API_URL=http://localhost:3000/dev
npm start

🌐 Live Demo

Application URLs

  • Production Frontend: https://taskmanager.netlify.app (will be available after deployment)
  • Development API: Available after running ./deploy.sh dev
  • Production API: Available after running ./deploy.sh prod

Demo Features

  • Complete CRUD operations for tasks
  • Responsive design demonstration across device sizes
  • Real-time filtering and search
  • Modern Material-UI interface
  • Error handling and loading states

πŸ“– API Documentation

Endpoints Overview

Method Endpoint Description
GET /tasks List all tasks with optional filtering
GET /tasks/{id} Get specific task by ID
POST /tasks Create new task
PUT /tasks/{id} Update existing task
DELETE /tasks/{id} Delete task

Example Usage

# Get all tasks
curl -X GET "https://api-url/tasks"

# Create task
curl -X POST "https://api-url/tasks" \
  -H "Content-Type: application/json" \
  -d '{"title": "New Task", "priority": "high"}'

# Update task status
curl -X PUT "https://api-url/tasks/task-id" \
  -H "Content-Type: application/json" \
  -d '{"status": "completed"}'

For complete API documentation, see docs/API.md.

🚒 Deployment

Automated CI/CD

The application uses GitHub Actions for automated deployments:

  • Development: Push to develop branch β†’ Auto-deploy to dev environment
  • Production: Push to main branch β†’ Auto-deploy to production environment

Manual Deployment

# Deploy to development
./deploy.sh dev

# Deploy to production
./deploy.sh prod

For detailed deployment instructions, see docs/DEPLOYMENT.md.

πŸ§ͺ Testing

Run All Tests

./run-tests.sh

Individual Test Suites

# Backend tests
cd backend && npm test

# Frontend tests
cd frontend && npm test

Test Coverage

  • Backend: Unit tests for Lambda handlers and utilities
  • Frontend: Component tests and integration tests
  • API: Endpoint testing with various scenarios

πŸ“± Responsive Design

The application is optimized for multiple device sizes:

Mobile (< 600px)

  • Collapsible navigation drawer
  • Single-column task layout
  • Touch-friendly interface
  • Floating action button for quick access

Tablet (600px - 960px)

  • Adaptive navigation
  • Two-column task grid
  • Optimized spacing

Desktop (960px - 1280px)

  • Persistent side navigation
  • Three-column task grid
  • Full feature set

Large Screens (> 1280px)

  • Maximum width container
  • Enhanced visual hierarchy
  • Optimized content spacing

πŸ› οΈ Development

Available Scripts

Backend

npm run offline          # Start local development server
npm run deploy:dev       # Deploy to development
npm run deploy:prod      # Deploy to production
npm test                # Run tests
npm run lint            # Run ESLint

Frontend

npm start               # Start development server
npm run build           # Build for production
npm test                # Run tests
npm run lint            # Run ESLint

Environment Configuration

Backend

  • TASKS_TABLE: DynamoDB table name
  • STAGE: Deployment stage (dev/prod)
  • REGION: AWS region

Frontend

  • REACT_APP_API_URL: Backend API URL
  • REACT_APP_STAGE: Environment stage

πŸ† Technical Highlights

Backend Architecture

  • Serverless Functions: 5 optimized Lambda functions
  • Database Design: DynamoDB with GSI for efficient queries
  • Validation: Joi schemas for robust input validation
  • Error Handling: Consistent error responses with proper HTTP codes
  • Logging: Structured logging for monitoring and debugging

Frontend Architecture

  • Component Structure: Reusable, composable React components
  • State Management: Efficient global state with Context API
  • Performance: Code splitting and lazy loading
  • UX: Loading states, error boundaries, and optimistic updates
  • Accessibility: ARIA labels and keyboard navigation support

DevOps Practices

  • Infrastructure as Code: Complete infrastructure defined in code
  • Multi-stage Deployments: Separate dev and production environments
  • Automated Testing: CI/CD pipeline includes automated testing
  • Monitoring: CloudWatch integration for logs and metrics
  • Security: Input validation, CORS configuration, and secure deployments

πŸ“š Documentation

🀝 Contributing

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

πŸ“„ License

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

πŸ™ Acknowledgments

  • AWS for providing excellent serverless infrastructure
  • Material-UI for the comprehensive React component library
  • Serverless Framework for simplifying AWS deployments
  • React Team for the amazing frontend framework
  • GitHub Actions for reliable CI/CD pipelines

Built with ❀️ as a comprehensive full-stack coding challenge demonstrating modern web development practices.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 2

  •  
  •