Skip to content

About

A production-style full-stack todo application featuring JWT authentication, React frontend, Go REST API, MongoDB, Redis, Docker, and Kubernetes deployment with Kind.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Repository files navigation

Much To Do

A full-stack todo application built with modern web technologies. Features user authentication, todo management, and a clean, responsive UI.

Features

  • User Authentication: Register, login, and manage user accounts with JWT tokens
  • Todo Management: Create, read, update, and delete todos
  • Responsive UI: Modern React frontend with Tailwind CSS and Radix UI components
  • RESTful API: Go backend with Gin framework and comprehensive API documentation
  • Database: MongoDB for data persistence
  • Caching: Redis for session management and caching
  • Containerization: Docker support for easy deployment
  • Kubernetes: Production-ready deployment manifests

Tech Stack

Frontend

  • React 19 - UI framework
  • TypeScript - Type safety
  • Vite - Build tool and dev server
  • TanStack Router - Client-side routing
  • TanStack Query - Data fetching and caching
  • Tailwind CSS - Styling
  • Radix UI - Accessible UI components
  • React Hook Form - Form handling
  • Zod - Schema validation

Backend

  • Go 1.25 - Programming language
  • Gin - HTTP web framework
  • MongoDB - NoSQL database
  • Redis - Caching and sessions
  • JWT - Authentication tokens
  • Swagger - API documentation

DevOps

  • Docker - Containerization
  • Docker Compose - Local development
  • Kubernetes - Container orchestration
  • Kind - Local Kubernetes cluster
  • NGINX Ingress - Load balancing and routing

Prerequisites

  • Docker and Docker Compose (for local development)
  • Go 1.25+ (for backend development)
  • Node.js 18+ and npm (for frontend development)
  • kubectl and kind (for Kubernetes deployment)
  • MongoDB (optional, can use Docker)

Installation

  1. Clone the repository

    git clone https://github.com/esodevops/container-assessment.git
    cd container-assessment
  2. Backend dependencies

    cd Server/MuchToDo
    go mod download
  3. Frontend dependencies

    cd Client
    npm install

Running Locally

Using Docker Compose (Recommended)

  1. Start all services

    make dc-up
    # or
    docker-compose up --build
  2. Access the application

    • Frontend: kubectl port-forward svc/frontend-service 8082:80 -n much-todo
    • Backend API: kubectl port-forward svc/backend-service 8081:80 -n much-todo
    • API Documentation: http://localhost:8080/swagger/index.html

Manual Development Setup

  1. Start MongoDB and Redis

    docker-compose up mongodb redis
  2. Start Backend

    cd Server/MuchToDo
    go run cmd/api/main.go
  3. Start Frontend

    cd Client
    npm run dev
  4. Access the application

Kubernetes Deployment

Use these steps to deploy the full stack (MongoDB, backend, frontend, ingress) on a local kind cluster.

  1. Install ingress-nginx (one-time per cluster)

    kubectl apply -f https://raw.githubusercontent.com/kubernetes/ingress-nginx/main/deploy/static/provider/kind/deploy.yaml
    kubectl wait --namespace ingress-nginx \
      --for=condition=ready pod \
      --selector=app.kubernetes.io/component=controller \
      --timeout=120s
  2. Deploy the application

    ./scripts/k8s-deploy.sh

    What this script does:

    • Ensures the much-todo-cluster kind cluster exists
    • Waits for the control-plane node to be ready
    • Builds backend and frontend images and loads them into kind
    • Applies Kubernetes manifests under kubernetes/
  3. Verify resources

    kubectl get pods -n much-todo
    kubectl get svc -n much-todo
    kubectl get ingress -n much-todo
  4. Connect to MongoDB and run quick checks

    kubectl exec -it -n much-todo deploy/mongodb -- mongosh -u root -p
    # password: example
    show dbs
    use much_todo_db
    db.getCollectionNames()
    db.todos.find().limit(5)
    db.users.find().limit(5)
  5. Access the app (Option A: ingress)

    curl http://localhost
    curl http://localhost/api/health

    Open in browser:

  6. Access the app (Option B: port-forward)

    Run each command in a separate terminal:

    kubectl port-forward svc/frontend-service 8082:80 -n much-todo
    kubectl port-forward svc/backend-service 8080:80 -n much-todo

    Open in browser:

  7. Troubleshooting quick checks

    kubectl logs deployment/backend -n much-todo --tail=100
    kubectl logs deployment/frontend -n much-todo --tail=100
    kubectl logs deployment/mongodb -n much-todo --tail=100
  8. Cleanup

    ./scripts/k8s-cleanup.sh
    kind delete cluster --name much-todo-cluster

Testing

Backend Tests

cd Server/MuchToDo
go test ./...

Frontend Tests

cd Client
npm run test

About

A production-style full-stack todo application featuring JWT authentication, React frontend, Go REST API, MongoDB, Redis, Docker, and Kubernetes deployment with Kind.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages