From c56528cf60d81c5beb92266fb9c9da72c3963f93 Mon Sep 17 00:00:00 2001 From: Khushbu Borole Date: Sun, 7 Jun 2026 17:50:20 +0530 Subject: [PATCH] Removed or updated obsolete multiple files --- api/to-do-db-source.json | 62 -------------------- docs/api/task.md | 48 --------------- docs/api/user.md | 46 --------------- docs/api/users-get-all-users.md | 53 ----------------- docs/api/users-get-user-by-id.md | 49 ---------------- docs/before-you-start-a-tutorial.md | 90 ----------------------------- docs/index.md | 45 +-------------- docs/tutorials.md | 13 ----- docs/tutorials/add-a-new-task.md | 65 --------------------- docs/tutorials/enroll-a-new-user.md | 63 -------------------- 10 files changed, 2 insertions(+), 532 deletions(-) delete mode 100644 api/to-do-db-source.json delete mode 100644 docs/api/task.md delete mode 100644 docs/api/user.md delete mode 100644 docs/api/users-get-all-users.md delete mode 100644 docs/api/users-get-user-by-id.md delete mode 100644 docs/before-you-start-a-tutorial.md delete mode 100644 docs/tutorials.md delete mode 100644 docs/tutorials/add-a-new-task.md delete mode 100644 docs/tutorials/enroll-a-new-user.md diff --git a/api/to-do-db-source.json b/api/to-do-db-source.json deleted file mode 100644 index 12ed1ae..0000000 --- a/api/to-do-db-source.json +++ /dev/null @@ -1,62 +0,0 @@ -{ - "users": [ - { - "last_name": "Smith", - "first_name": "Ferdinand", - "email": "f.smith@example.com", - "id": 1 - }, - { - "last_name": "Jones", - "first_name": "Jill", - "email": "j.jones@example.com", - "id": 2 - }, - { - "last_name": "Martinez", - "first_name": "Marty", - "email": "m.martinez@example.com", - "id": 3 - }, - { - "last_name": "Bailey", - "first_name": "Bill", - "email": "b.bailey@example.com", - "id": 4 - } - ], - "tasks": [ - { - "user_id": 1, - "title": "Grocery shopping", - "description": "eggs, bacon, gummy bears", - "due_date": "2025-02-20T17:00", - "warning": "-10", - "id": 1 - }, - { - "user_id": 1, - "title": "Piano recital", - "description": "Daughter's first concert appearance", - "due_date": "2025-04-02T15:00", - "warning": "-30", - "id": 2 - }, - { - "user_id": 2, - "title": "Oil change", - "description": "5K auto service", - "due_date": "2025-03-10T09:00", - "warning": "-60", - "id": 3 - }, - { - "user_id": 3, - "title": "Get shots for dog", - "description": "Annual vaccinations for poochy", - "due_date": "2025-05-11T14:00", - "warning": "-20", - "id": 4 - } - ] -} \ No newline at end of file diff --git a/docs/api/task.md b/docs/api/task.md deleted file mode 100644 index a09b5b9..0000000 --- a/docs/api/task.md +++ /dev/null @@ -1,48 +0,0 @@ ---- -layout: page ---- - -# `task` resource - -Base endpoint: - -```shell - -{server_url}/tasks -``` - -Contains information about tasks stored for the users of the service. - -To have a task in the service, the user must be added to -the service first. Learn more about the [user resource](user.md). - -## Resource properties - -Sample `task` resource - -```js - -{ - "user_id": 1, - "title": "Grocery shopping", - "description": "eggs, bacon, gummy bears", - "due_date": "2025-02-20T17:00", - "warning": "-10", - "id": 1 -} -``` - -| Property name | Type | Description | -| ------------- | ----------- | ----------- | -| `user_id` | number | The ID of the user resource to which this task is assigned | -| `title` | string | The title or short description of the task | -| `description` | string | The long description of the task| -| `due_date` | string | The [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format of the date and time the task is due | -| `warning` | number | The number of minutes relative to the `due_date` to alert the user of the task. This is normally a negative number to alert the user before the `due_date`.| -| `id` | number | The task's unique record ID | - -## READ - -* [Get all tasks _(coming soon)_](#resource-properties) -* [Get task by ID _(coming soon)_](#resource-properties) -* [Get task by user ID _(coming soon)_](#resource-properties) diff --git a/docs/api/user.md b/docs/api/user.md deleted file mode 100644 index 51fb814..0000000 --- a/docs/api/user.md +++ /dev/null @@ -1,46 +0,0 @@ ---- -layout: page ---- - -# `user` resource - -Base endpoint: - -```shell - -{server_url}/users -``` - -Contains information about the users of the service. - -A user resource describes the owners of the tasks in the service. -Before you can create a `task` resource in the service, -you must create the 'user' resource to assign to the `task`. - -Learn more about the [task resource](task.md). - -## Resource properties - -Sample `user` resource - -```js - -{ - "last_name": "Smith", - "first_name": "Ferdinand", - "email": "f.smith@example.com", - "id": 1 -} -``` - -| Property name | Type | Description | -| ------------- | ----------- | ----------- | -| `last_name` | string | The user's last name | -| `first_name` | string | The user's first name | -| `email` | string | The user's email address | -| `id` | number | The user's unique record ID | - -## Read operations - -* [Get all users](users-get-all-users.md) -* [Get users by ID](users-get-user-by-id.md) diff --git a/docs/api/users-get-all-users.md b/docs/api/users-get-all-users.md deleted file mode 100644 index bb2099b..0000000 --- a/docs/api/users-get-all-users.md +++ /dev/null @@ -1,53 +0,0 @@ ---- -layout: page ---- - -# Get all users - -Returns an array of [`user`](user.md) objects that contains all users that have registered with the service. - -## URL - -```shell - -{server_url}/users -``` - -## Parameters - -None - -## Request headers - -None - -## Request body - -None - -## Return body - -```js -[ - { - "last_name": "Smith", - "first_name": "Ferdinand", - "email": "f.smith@example.com", - "id": 1 - }, - { - "last_name": "Jones", - "first_name": "Jillio", - "email": "jlo.jones@example.com", - "id": 2 - } - ... -] -``` - -## Return status - -| Status value | Return status | Description | -| ------------- | ----------- | ----------- | -| 200 | Success | Requested data returned successfully | -| ECONNREFUSED | N/A | Service is offline. Start the service and try again. | diff --git a/docs/api/users-get-user-by-id.md b/docs/api/users-get-user-by-id.md deleted file mode 100644 index 1a1e808..0000000 --- a/docs/api/users-get-user-by-id.md +++ /dev/null @@ -1,49 +0,0 @@ ---- -layout: page ---- - -# Get user by ID - -Returns an array of [`user`](user.md) objects that contains only the user specified by the `id` parameter, if it exists. - -## URL - -```shell - -{server_url}/users/{id} -``` - -## Parameters - -| Parameter name | Type | Description | -| -------------- | ------ | ------------ | -| `id` | number | The record ID of the user to return | - -## Request headers - -None - -## Request body - -None - -## Return body - -```js -[ - { - "last_name": "Smith", - "first_name": "Ferdinand", - "email": "f.smith@example.com", - "id": 1 - } -] -``` - -## Return status - -| Status value | Return status | Description | -| ------------- | ----------- | ----------- | -| 200 | Success | Requested data returned successfully | -| 404 | Error | Specified user record not found | -| ECONNREFUSED | N/A | Service is offline. Start the service and try again. | diff --git a/docs/before-you-start-a-tutorial.md b/docs/before-you-start-a-tutorial.md deleted file mode 100644 index 27e62be..0000000 --- a/docs/before-you-start-a-tutorial.md +++ /dev/null @@ -1,90 +0,0 @@ ---- -layout: page ---- - -# Before you start a tutorial - -These are the steps you must do before you can run -the tutorials for the **To-Do service**. - -Expect this preparation to take about 20 minutes to complete. - -## Preparing for the tutorials - -To complete the tutorials in this section, you need the following. -You might want to open the links in separate browser tabs before you start installing the software. - - - -* A [GitHub account](https://github.com) -* A development system running a current version or a -long-term support, also known as _LTS_, version of the Windows, MacOS, or Linux operating system. -* The following software on your development system: - * [Git, command line](https://docs.github.com/en/get-started/quickstart/set-up-git) - * [GitHub Desktop](https://desktop.github.com). This is optional, but recommended. - * A fork of the [To-Do-Service repository](https://github.com/UWC2-APIDOC/to-do-service-sp25) - * A current or LTS version of `node.js` - * Version 0.17.4 of [json-server](https://www.npmjs.com/package/json-server) - * A current copy of the database file. You can get this by syncing your fork. - - **Tip**: if you're using a fork of the repository, create a working branch in which to do your tutorials. Create a new branch for each tutorial to prevent a mistake in one from affecting your work in another. - * The [Postman desktop app](https://www.postman.com/downloads/). Because you run the **To-Do service** on your development system with an `http://localhost` host name, the web-version of Postman can't perform the exercises. - * The [Postman desktop app](https://www.postman.com/downloads/). Because you run the **To-Do service** on your development system with an `http://localhost` host name, the web-version of Postman can't perform the exercises. - - - -## Test your development system - -To test your development system:. - -1. Create and checkout a test branch of your fork of the To-Do-service repository. Your `GitHub repository workspace` is the directory that contains your fork of the `to-do-service-sp25` repository. - - ```shell - cd - ls - # (see the to-do-service directory in the list) - cd to-do-service-sp25 - git checkout -b tutorial-test - cd api - json-server -w to-do-db-source.json - ``` - - If you installed the software correctly, you should see - the service start and display the URL of the service: `http://localhost:3000`. - -2. Make a test call to the service. - - ```shell - curl http://localhost:3000/users - ``` - -3. If the service is running correctly, you should see a list of users from the service, such as in this example. - - ```js - [ - { - "last_name": "Smith", - "first_name": "Ferdinand", - "email": "f.smith@example.com", - "id": 1 - }, - { - "last_name": "Jones", - "first_name": "Jill", - "email": "j.jones@example.com", - "id": 2 - }, - ... - ``` - -You should see the list of users. -If you receive an error in any step of the procedure, investigate, and correct the error before continuing. -Some common situations that cause errors include: - -1. You mistyped a command. -2. You aren't in the correct directory. -3. A required software component didn't install correctly. -4. A required software component isn't up to date. - -If you see the list of users from the service, you're ready to do -the [Tutorials](tutorials.md). diff --git a/docs/index.md b/docs/index.md index 3757d2f..6db82de 100644 --- a/docs/index.md +++ b/docs/index.md @@ -1,44 +1,3 @@ ---- -layout: page ---- +# KeepIt service API -# To-Do service API - -This is a mock API to simulate the REST interface of an -imaginary service. - -The To-Do service provides a cloud-hosted task list through which -subscribers can post tasks and receive reminders of those tasks. - -## Quickstart - -[Post your first task _(coming soon)_](#quickstart) with the To-Do service to see how easy it is to use! - -## Tutorials - -Learn how to do common tasks with in the To-Do service. - -First, do this tutorial to set up your development system for these tutorials. You only have to do this one time per development system. - -* [Before you start a tutorial](before-you-start-a-tutorial.md) - -After your system is ready, these tutorials show you how to perform common tasks. - -* [Enroll a new user](tutorials/enroll-a-new-user.md) -* [Add a new task](tutorials/add-a-new-task.md) -* [Change the due-date of a task _(coming soon)_](#tutorials) -* [Delete a task _(coming soon)_](#tutorials) - -## API reference docs - -Detailed descriptions of the service's resources. - -The API reference docs refer to a `{base_url}` when they -refer to the URL of a resource. The `{base_url}` value depends -on the installation of the service. - -When run locally for testing, the `{base_url}` is -generally `http://localhost:3000`. - -* [user resource](api/user.md) -* [task resource](api/task.md) +This is a placeholder for KeepIt service API documentation home page. diff --git a/docs/tutorials.md b/docs/tutorials.md deleted file mode 100644 index 85d0f86..0000000 --- a/docs/tutorials.md +++ /dev/null @@ -1,13 +0,0 @@ ---- -layout: page ---- - -# Tutorials - -These tutorials are available to help you start using the **To-Do service API**. - -Be sure to review [Before you start a tutorial](before-you-start-a-tutorial.md) -before you start your first tutorial. - -* [Enroll a new user](tutorials/enroll-a-new-user.md) -* [Add a new task](tutorials/add-a-new-task.md) diff --git a/docs/tutorials/add-a-new-task.md b/docs/tutorials/add-a-new-task.md deleted file mode 100644 index 279bfef..0000000 --- a/docs/tutorials/add-a-new-task.md +++ /dev/null @@ -1,65 +0,0 @@ ---- -layout: page ---- - -# Tutorial: Add a new task - -In this tutorial, you learn the operations to call to -add a new task for a user of the service. - -Expect this tutorial to take about 15 minutes to complete. - -## Before you start - -Make sure you've completed the [Before you start a tutorial](../before-you-start-a-tutorial.md) topic on the development system you'll use for the tutorial. - -## Add a new task - -Adding a new task to the service requires that you use the `POST` method to store the details of the new [`task`](../api/task.md) resource in the service. - -To add a new task: - -1. Make sure your local service is running, or start it by using this command, if it's not. - - ```shell - cd /to-do-service/api - json-server -w to-do-db-source.json - ``` - -1. Open the Postman app on your desktop. -1. In the Postman app, create a new request with these values: - * **METHOD**: POST - * **URL**: `{{base_url}}/tasks` - * **Headers**: - * `Content-Type: application/json` - * **Request body**: - You can change the values of each property as you'd like. - - ```js - { - "user_id": 3, - "title": "Get new tires", - "description": "Get new tires for Hoppity", - "due_date": "2025-03-11T14:00", - "warning": "-60" - } - ``` - -1. In the Postman app, choose **Send** to make the request. -1. Watch for the response body, which should look something like this. Note that the names should be the same as you used in your **Request body** and the response should include the new user's `id`. - - ```js - { - "user_id": 3, - "title": "Get new tires", - "description": "Get new tires for Hoppity", - "due_date": "2025-03-11T14:00", - "warning": "-60", - "id": 5 - } - ``` - -After doing this tutorial in Postman, you might like to repeat it in -your favorite programming language. To do this, adapt the values from -the tutorial to the properties and arguments that the language uses to -make REST API calls. diff --git a/docs/tutorials/enroll-a-new-user.md b/docs/tutorials/enroll-a-new-user.md deleted file mode 100644 index 3431206..0000000 --- a/docs/tutorials/enroll-a-new-user.md +++ /dev/null @@ -1,63 +0,0 @@ ---- -layout: page ---- - -# Tutorial: Enroll a new user - -In this tutorial, you learn the operations to call to -enroll a new user into the service. - -Expect this tutorial to take about 15 minutes to complete. - -## Before you start - -Make sure you've completed the [Before you start a tutorial](../before-you-start-a-tutorial.md) topic on the development system you'll use for the tutorial. - -## Enroll a new user - -Adding a new task to the service requires that you use the `POST` method to store the details of the new [`task`](../api/task.md) resource in the service. - -Enrolling a new user in the service requires that you use the `POST` method to store the details of a new [`user`](../api/user.md) resource in the service. - -To enroll a new user: - -1. Make sure your local service is running, or start it by using this command, if it's not. - - ```shell - cd /to-do-service/api - json-server -w to-do-db-source.json - ``` - -1. Open the Postman app on your desktop. -1. In the Postman app, create a new request with these values: - * **METHOD**: POST - * **URL**: `{{base_url}}/users` - * **Headers**: - * `Content-Type: application/json` - * **Request body**: - You can change the values of each property as you'd like. - - ```js - { - "last_name": "Jones", - "first_name": "Jenny", - "email": "jen.jones@example.com" - } - ``` - -1. In the Postman app, choose **Send** to make the request. -1. Watch for the response body, which should look something like this. Note that the names should be the same as you used in your **Request body** and the response should include the new user's `id`. - - ```js - { - "last_name": "Jones", - "first_name": "Jenny", - "email": "jen.jones@example.com", - "id": 5 - } - ``` - -After doing this tutorial in Postman, you might like to repeat it in -your favorite programming language. To do this, adapt the values from -the tutorial to the properties and arguments that the language uses to -make REST API calls.