This is a simple task management app made with Node.js + Express + Vue.js. It can run locally or in a Docker container.
- Latest version of Node.js installed locally: https://nodejs.org/
- Vue.js:
npm install --global vue-cli
- Install Docker: https://docs.docker.com/engine/installation/
- Clone the repository with
git clone https://github.com/p-cherukuri/task-mgmt-docker.git
or by downloading the ZIP file. cd task-mgmt-docker/services/tasks
- This is where the tasks app resides, with the Express server implementation being inserver.js
. The user interface is in theui
folder, and theapi
andconfig
folder contain the API routes and throwaway database config respectively.cd ui
to go into the root user interface folder, where the Vue app is. Here, first runnpm install
to build all the dependencies needed to run the UI properly.- Use
npm run dev
to see a local development version at http://localhost:8080, or usenpm run build
to build the static production files to be served in Express when running on Docker. cd ..
to go back to the roottasks
directory. I created a custom NPM build script that is used by runningnpm run build
. This builds a Docker image using the custom Dockerfile I wrote, and then immediately runs the Docker container on port8000
. These commands aredocker build -t user/task-app
anddocker run -p 8000:8000 -d -t user/task-app
respectively. To run a local development version of the app, first runnpm install
to get all the dependencies locally, then runnodemon
.- After running the build script, the app should be up and running at
http://localhost:8000
- this is the Vue app hosted on Express running in the Docker container. - The user interface lets you create a task with a description and due date, and then either mark it as complete or delete it. I implemented LocalStorage to allow the task list state to persist as long as the browser session data has not been cleared.
- I also tried to implement a data store with MongoDB - while the data store and API do work, I was unsuccessful in getting it to work through a build due to CORS issues I couldn't figure out how to solve. The API routes worked with Postman testing, however.
- This was my first time learning how to run an application on Docker on my own - I read about the usefulness of Docker Compose with running multi-container applications, but I couldn't set it up properly here.