Giter Club home page Giter Club logo

udacity-capstone's Introduction

Udacity Capstone Project

The App

The app created is a simple TODO API implemented in NodeJS + MongoDB.

It has the following endpoints:

  • GET /todos - Lists all existing todos
  • POST /todos - Creates a todo { text: 'an todo item' }
  • GET /todos/:id - Gets a todo from a given id
  • PUT /todos/:id - Updates a todo { text: 'an updated todo item', complete: true }
  • DELETE /todos/:id - Deletes a todo

The project uses eslint & prettier for linting purposes, a jest + supertest for testing

  • npm run lint
  • npm test

For local development a docker environment has been created using docker-compose, a Makefile is provided for ease of use

  • make build - Builds the docker images
  • make start - Starts the containers (node & mongo)
  • make stop - Stops the containers

Kubernetes configuration

This project runs on Kubernetes as well, to apply it to a cluster run

kubectl apply -f .kube

It has 2 deployments and 2 services created

  • todos - The deployment and service for the app
  • mongo - The deployment and service for the mongo database

Cloudformation Scripts

AWS Cloudformation Scripts are provided to create an EKS cluster. The scripts have been separated into 2, the first one to create the underlying network, and the second one to create the cluster and node group. The scripts are in the .aws dir.

To create the network stack you would run the following command:

aws cloudformation create-stack \
    --stack-name=capacity-capstone-network \
    --template-body file://.aws/network.yml \
    --parameters file://.aws/network-params.json

After the network is created, create the eks stack: To create the network you would run the following command:

aws cloudformation create-stack \
    --stack-name=capacity-capstone-eks \
    --template-body file://.aws/eks.yml \
    --parameters file://.aws/eks-params.json \
    --capabilities "CAPABILITY_NAMED_IAM"

Jenkins pipeline

The project uses Jenkins for CI and CD, below are the steps and a brief description of each:

  • Linting - Step that lints the projects code (npm run lint)
  • Testing - Step that runs our test suites (npm test)
  • Build docker image - Step that builds our docker image from our Dockerfile
  • Push docker image - Step that tags and pushes our docker image to dockerhub
  • Clean up local docker images - Step that cleans up local images (clear space in our jenkins server)
  • Deploy to EKS - Step that configures kubectl and deploys our configuration to EKS

udacity-capstone's People

Contributors

ignaciojcano avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.