The ToDo app uses the following technologies and javascript libraries:
- MongoDB
- Express.js
- Node.js
- express-handlebars
- method-override
- connect-flash
- express-session
- mongoose
- bcryptjs
- passport
- docker & docker-compose
You can register with your email address, and you can create ToDo items. You can list ToDos, edit and delete them.
First install the depdencies by running the following from the root directory:
npm install --prefix src/
To run this application locally you need to have an insatnce of MongoDB running. A docker-compose file has been provided in the root director that will run an insatnce of MongoDB in docker. TO start the MongoDB from the root direction run the following command:
docker-compose up -d
Then to start the application issue the following command from the root directory:
npm run start --prefix src/
The application can then be accessed through the browser of your choise on the following:
localhost:5000
Basic testing has been included as part of this application. This includes unit testing (Models Only), Integration Testing & E2E Testing.
Basic Linting is performed across the code base. To run linting, execute the following commands from the root directory:
npm run test-lint --prefix src/
Unit Tetsing is performed on the models for each object stored in MongoDB, they will vdaliate the model and ensure that required data is entered. To execute unit testing execute the following commands from the root directory:
npm run test-unit --prefix src/
Integration testing is included to ensure the applicaiton can talk to the MongoDB Backend and create a user, redirect to the correct page, login as a user and register a new task.
Note: MongoDB needs to be running locally for testing to work (This can be done by spinning up the mongodb docker container).
To perform integration testing execute the following commands from the root directory:
npm run test-integration --prefix src/
E2E Tests are included to ensure that the website operates as it should from the users perspective. E2E Tests are executed in docker containers. To run E2E Tests execute the following commands:
chmod +x scripts/e2e-ci.sh
./scripts/e2e-ci.sh