Skip to content

Commit

Permalink
Merge pull request #9 from appvia/package-updates
Browse files Browse the repository at this point in the history
chore: update packages
  • Loading branch information
KashifSaadat authored Jul 3, 2024
2 parents fdb358b + a5595c9 commit ec321e0
Show file tree
Hide file tree
Showing 6 changed files with 1,388 additions and 1,527 deletions.
21 changes: 21 additions & 0 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
MIT License

Copyright (c) 2024 Appvia Ltd

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
33 changes: 33 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
# Todo App

This is a simple demo nodejs todo app which depends on a MySQL database. It allows you to create, update, and delete tasks in a user-friendly interface.

## Features

- Add item to list
- Mark item as done
- Delete item from list

## Installation

1. Clone the repository: `git clone https://github.com/appvia/todo-app.git`
2. Run docker compose up --build --detach

## Usage

1. Open the app in your browser: `http://localhost:3000` (may take a few seconds to start up)
2. Create a new task by entering a description and clicking "Add Item"
3. Update the status of a task by clicking the checkbox next to it
4. Delete a task by clicking the "Delete" button next to it

## Published Images

The images are published on Github Container Registry: https://github.com/appvia/todo-app/pkgs/container/todo-app

## Contributing

Contributions are welcome! If you find a bug or have a feature request, please open an issue or submit a pull request.

## License

This project is licensed under the [MIT License](LICENSE).
16 changes: 8 additions & 8 deletions app/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,14 +9,14 @@
"dev": "nodemon src/index.js"
},
"dependencies": {
"express": "^4.17.1",
"express": "^4.19",
"mysql": "^2.18.1",
"sqlite3": "^5.0.0",
"uuid": "^3.3.3",
"wait-port": "^0.2.2"
"sqlite3": "^5.1",
"uuid": "^10.0",
"wait-port": "^1.1"
},
"resolutions": {
"ansi-regex": "5.0.1"
"ansi-regex": "6.0.1"
},
"prettier": {
"trailingComma": "all",
Expand All @@ -26,8 +26,8 @@
"singleQuote": true
},
"devDependencies": {
"jest": "^27.2.5",
"nodemon": "^2.0.13",
"prettier": "^1.18.2"
"jest": "^29.7.0",
"nodemon": "^3.1.4",
"prettier": "^3.3.2"
}
}
7 changes: 3 additions & 4 deletions app/spec/routes/addItem.spec.js
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
const db = require('../../src/persistence');
const addItem = require('../../src/routes/addItem');
const ITEM = { id: 12345 };
const uuid = require('uuid/v4');
const uuid = require('uuid');

jest.mock('uuid/v4', () => jest.fn());
jest.mock('uuid', () => jest.fn());

jest.mock('../../src/persistence', () => ({
removeItem: jest.fn(),
Expand All @@ -17,7 +16,7 @@ test('it stores item correctly', async () => {
const req = { body: { name } };
const res = { send: jest.fn() };

uuid.mockReturnValue(id);
uuid.v4.mockReturnValue(id);

await addItem(req, res);

Expand Down
4 changes: 2 additions & 2 deletions app/src/routes/addItem.js
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
const db = require('../persistence');
const uuid = require('uuid/v4');
const uuid = require('uuid');

module.exports = async (req, res) => {
const item = {
id: uuid(),
id: uuid.v4(),
name: req.body.name,
completed: false,
};
Expand Down
Loading

0 comments on commit ec321e0

Please sign in to comment.