Coder Social home page Coder Social logo

node-todo-challenge-pub's Introduction

Node TODO Challenge

Challenge solution. Jesús Gil (jgilnom)

Requirements and Steps:

  • Clone this respository

  • Define the following env variable and value needed by the console cli:

     API_URL = http://127.0.0.1:3000
    

    Of course we could miss and hard-code this variable in the python code, but to allow customization in real hypothetical environments and to hide the real API URL from the code.

  • If not installed, install tabulate with pip:

    pip install tabulate

  • Run docker-compose up in the root folder of the repository

  • Run todo-cli-apis.py with Python passing the different options supported and arguments needed. This script is inside the Python folder. Some examples:

    • todo-cli-apis.py test
    • todo-cli-apis.py create --description dummy_item
    • todo-cli-apis.py delete --description dummy_item
    • todo-cli-apis.py get_all --format json

Security

To increase security, the different connection strings, urls and passwords were moved to ENV VARIABLES in the following files:

  • database.js
  • todo-cli-apis.py

In order to make it easy to run and out-of-the-box solution, the following ENV variables were included in the docker-compose.yml but of course, in a real environment these variables would be readed from some Secrets Manager and mapped into the container in run-time using external-secrets in example:

  • MONGO_INITDB_ROOT_USERNAME
  • MONGO_INITDB_ROOT_PASSWORD
  • MONGODB_URI

CI/CD

The repository includes 3 Github Workflows to:

  • Docker Build-Push the docker image to DockerHub in case that consuming from other real environment is needed
  • Python Validate the console cli
  • Node NPM validate and test

node-todo-challenge-pub's People

Contributors

jgilnom 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.