Notepad App
Table of Contents
Introduction
This is a Notepad App that provides CRUD (Create, Read, Update, Delete) functionalities via API endpoints. The app is backed by unit tests for each endpoint to ensure stability and reliability.
Installation
- Clone the repository
git clone https://github.com/your-repo/notepad_app.git
- Navigate to the project directory
cd notepad_app
- Install the dependencies
pip install -r requirements.txt
- Run the application
python main.py
Usage
The application provides the following features:
- Create a Notepad: Users can create a new notepad with text content.
- Read a Notepad: Users can read the content of an existing notepad.
- Update a Notepad: Users can update the content of an existing notepad.
- Delete a Notepad: Users can remove an existing notepad.
- List All Notepads: Users can view a list of all their notepads.
API Endpoints
-
Create a Notepad
- Endpoint:
/api/v1/notepad/create
- Method: POST
- Payload:
{ "title": "string", "content": "string" }
- Endpoint:
-
Read a Notepad
- Endpoint:
/api/v1/notepad/read/{id}
- Method: GET
- Endpoint:
-
Update a Notepad
- Endpoint:
/api/v1/notepad/update/{id}
- Method: PUT
- Payload:
{ "title": "string", "content": "string" }
- Endpoint:
-
Delete a Notepad
- Endpoint:
/api/v1/notepad/delete/{id}
- Method: DELETE
- Endpoint:
-
List All Notepads
- Endpoint:
/api/v1/notepad/list
- Method: GET
- Endpoint:
Running Tests
To run the unit tests, navigate to the project directory and run the following command:
python -m unittest discover -s notepad_app/tests -p 'test_*.py'
This will run all the unit tests located in the notepad_app/tests
directory.