From 6d87d63be6abc9db0b4a9bba3b6432cf103ef72c Mon Sep 17 00:00:00 2001 From: Michael Callahan <118235615+calforcal@users.noreply.github.com> Date: Fri, 1 Sep 2023 08:53:57 -0600 Subject: [PATCH 1/4] Update readme --- README.md | 313 +++++++++++++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 312 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 0792402..dd066d6 100644 --- a/README.md +++ b/README.md @@ -1,9 +1,320 @@ # project_planner_be +## About Project Planner +Project Planner is designed to streamline the project planning process for junior to mid level developers. By leveraging advanced AI technology, this app assists users in crafting comprehensive project plans and generating innovative ideas tailored to their chosen project type and preferred technologies. + +[Project Spec/Requirements](https://mod4.turing.edu/projects/capstone/) + +### Deployed UI +- [Frontend Deployment]() +- [Frontend Repository](https://github.com/AI-Project-Planner/project-planner-ui) + ## Table of Contents - RESTful Endpoints - Environment Set Up - Contributors ## RESTful Endpoints -- \ No newline at end of file +
+ +### Generate a Project +
+ +```http +POST /api/v1/users/:id/projects +``` + +#### Parameters: + +``` +:id => user_id +``` + +| Code | Description | +| :--- | :---------- | +| 200 | `OK` | + +#### Request Body: + +```json +{ + "type": "frontend", + "technologies": "react, typescript and javascript", + "time": "1 week", + "collaborators": 2 +} +``` + +#### Example Response: + +```json +{ + "id": "1", + "type": "project", + "attributes": { + "name": "TaskMaster Pro", + "steps": "Project Setup: Create Git repository and define project structure\nBackend Setup: Develop Express.js application, set up API routes\nDatabase Design: Design and implement database schema", + "description": "TaskMaster Pro is an all-inclusive task management application designed to optimize team collaboration and productivity.", + "features": "User registration and login\nCreate, assign, update, and track tasks\nReal-time collaboration and updates\nPriority-based task categorization", + "interactions": "User logs in to TaskMaster Pro account.\nDashboard displays tasks by priority: High, Medium, Low.\nUser adds a task, assigns it, and sets a due date.\nTask appears under the respective priority category.\nAssigned user starts task, status updates in real-time.\nUpon completion, task is marked as done and updates for all.", + "colors": "#3498DB\n#27AE60\n#F39C12\n#F0F3F4\n#333333\n#E74C3C", + "saved": false, + "timeline": "week", + "timeline_int": 1, + "user_id": "1" + } +} +``` + +Error Response: + +| Code | Description | +| :--- | :---------- | +| 503 | `Server is down.` | + +```json + { + "Error": "Server is down.", + "Status": 500 + } +``` + +
+ +### Update Saved Status for A Users Project + +
+ +```http +PATCH /api/v1/users/:user_id/projects/:project_id/ +``` + +#### Parameters: + +``` +:user_id => user_id +:project_id => project_id +``` + +| Code | Description | +| :--- | :---------- | +| 202 | `ACCEPTED` | + +#### Request Body: + +```json +{ + "saved": "true" +} +``` + +#### Example Response: + +```json +{ + "id": "1", + "type": "project", + "attributes": { + "name": "TaskMaster Pro", + "steps": "Project Setup: Create Git repository and define project structure\nBackend Setup: Develop Express.js application, set up API routes\nDatabase Design: Design and implement database schema", + "description": "TaskMaster Pro is an all-inclusive task management application designed to optimize team collaboration and productivity.", + "features": "User registration and login\nCreate, assign, update, and track tasks\nReal-time collaboration and updates\nPriority-based task categorization", + "interactions": "User logs in to TaskMaster Pro account.\nDashboard displays tasks by priority: High, Medium, Low.\nUser adds a task, assigns it, and sets a due date.\nTask appears under the respective priority category.\nAssigned user starts task, status updates in real-time.\nUpon completion, task is marked as done and updates for all.", + "colors": "#3498DB\n#27AE60\n#F39C12\n#F0F3F4\n#333333\n#E74C3C", + "saved": true, + "timeline": "week", + "timeline_int": 1, + "user_id": "1" + } +} +``` + +Error Response: + +| Code | Description | +| :--- | :---------- | +| 404 | `Project or User ID not found.` | + +```json + { + "Error": "Project or User ID not found.", + "Status": 404 + } +``` + +
+ +### Get ALL of a Users Projects + +
+ +```http +GET /api/v1/users/:id/projects/ +``` + +#### Parameters: + +``` +:id => user_id +``` + +| Code | Description | +| :--- | :---------- | +| 200 | `OK` | + + +#### Example Response: + +```json +{ + "data": + [ + { + "id": "1", + "type": "project", + "attributes": { + "name": "TaskMaster Pro", + "steps": "Project Setup: Create Git repository and define project structure\nBackend Setup: Develop Express.js application, set up API routes\nDatabase Design: Design and implement database schema", + "description": "TaskMaster Pro is an all-inclusive task management application designed to optimize team collaboration and productivity.", + "features": "User registration and login\nCreate, assign, update, and track tasks\nReal-time collaboration and updates\nPriority-based task categorization", + "interactions": "User logs in to TaskMaster Pro account.\nDashboard displays tasks by priority: High, Medium, Low.\nUser adds a task, assigns it, and sets a due date.\nTask appears under the respective priority category.\nAssigned user starts task, status updates in real-time.\nUpon completion, task is marked as done and updates for all.", + "colors": "#3498DB\n#27AE60\n#F39C12\n#F0F3F4\n#333333\n#E74C3C", + "saved": true, + "timeline": "week", + "timeline_int": 1, + "user_id": "1" + } + }, + { + "id": "2", + "type": "project", + "attributes": { + "name": "Different Project Pro", + "steps": "Project Setup: Create Git repository and define project structure\nBackend Setup: Develop Express.js application, set up API routes\nDatabase Design: Design and implement database schema", + "description": "It's different!", + "features": "User registration and login\nCreate, assign, update, and track tasks\nReal-time collaboration and updates\nPriority-based task categorization", + "interactions": "User logs in to TaskMaster Pro account.\nDashboard displays tasks by priority: High, Medium, Low.\nUser adds a task, assigns it, and sets a due date.\nTask appears under the respective priority category.\nAssigned user starts task, status updates in real-time.\nUpon completion, task is marked as done and updates for all.", + "colors": "#3498DB\n#27AE60\n#F39C12\n#F0F3F4\n#333333\n#E74C3C", + "saved": true, + "timeline": "days", + "timeline_int": 4, + "user_id": "1" + } + } + ] +} +``` + +Error Response: + +| Code | Description | +| :--- | :---------- | +| 404 | `User ID not found.` | + +```json + { + "Error": "User ID not found.", + "Status": 404 + } +``` + +
+
+ +## Environment Set-Up + +### Prerequisites + +Before getting started, ensure that you have the following installed on your system: + +- Python (version 3.11.5 or higher) +- pip (Python package manager) + +### Installation + +Follow these steps to install the Project Planner App: + +1. Clone the repository: + +``` +git clone https://github.com/AI-Project-Planner/project_planner_be.git +``` + +2. Navigate to the project directory: + +``` +cd project_planner_be +``` + +3. Create a virtual environment (optional but recommended): + +``` +python3 -m venv env +``` + +4. Activate the virtual environment: + +macOS/Linux: + +``` +source env/bin/activate +``` + +Windows: + +``` +source env/Scripts/activate +``` + +5. Install the required environment packages: + +``` +pip install -r requirements.txt +``` + +6. Run migrations: + +``` +python3 manage.py makemigrations +python3 manage.py migrate +``` + +7. Run test suite to ensure functionality is working. + +``` +python3 manage.py test +``` + +If any modules are missing: + +
+ +``` +pip install < MISSING MODULE > +``` +
+
+
+ +7. Start the development server: + +``` +python3 manage.py runserver +``` + +The server should start running at http://127.0.0.1:8000/. + +## Contributors + +- Amy Marie Spears + - [LinkedIn](https://www.linkedin.com/in/amy-marie-spears-900997105/) + - [GitHub](https://github.com/amspears007) +- Javen Wilson + - [LinkedIn](https://www.linkedin.com/in/javen-wilson/) + - [GitHub](https://github.com/javenb022) +- Garrett Gregor + - [LinkedIn](https://www.linkedin.com/in/garrett-gregor/) + - [GitHub](https://github.com/garrettgregor) +- Michael Callahan + - [LinkedIn](https://www.linkedin.com/in/michaelcallahanjr/) + - [GitHub](https://github.com/calforcal) \ No newline at end of file From a305859710c971d3aa7544219999085005b35a60 Mon Sep 17 00:00:00 2001 From: Michael Callahan <118235615+calforcal@users.noreply.github.com> Date: Fri, 1 Sep 2023 09:43:26 -0600 Subject: [PATCH 2/4] Fix small issue with serializer --- project/models.py | 6 +++--- project/tests.py | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/project/models.py b/project/models.py index b12b4be..29a8da0 100644 --- a/project/models.py +++ b/project/models.py @@ -40,10 +40,10 @@ def serialize_all_projects(projects): "interactions": f"{x.interactions}", "colors": f"{x.colors}", "timeline": f"{x.timeline}", - "timeline_int": f"{x.timeline_int}", - "saved": f"{x.saved}", + "timeline_int": x.timeline_int, + "saved": x.saved, "tagline": f"{x.tagline}", - "collaborators": f"{x.collaborators}", + "collaborators": x.collaborators, "user_id": f"{x.user_id.id}" } } diff --git a/project/tests.py b/project/tests.py index 6054755..bdd3165 100644 --- a/project/tests.py +++ b/project/tests.py @@ -13,7 +13,7 @@ def setUp(self): def test_project_model_exists(self): projects = Project.objects.count() - + code.interact(local=dict(globals(), **locals())) self.assertEqual(projects, 2) def test_project_model_has_attributes(self): From 65ad230471bfe0f15baf2b243c7cc6013b66880d Mon Sep 17 00:00:00 2001 From: Michael Callahan <118235615+calforcal@users.noreply.github.com> Date: Fri, 1 Sep 2023 09:52:09 -0600 Subject: [PATCH 3/4] Remove a pry from test --- project/tests.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/project/tests.py b/project/tests.py index bdd3165..6054755 100644 --- a/project/tests.py +++ b/project/tests.py @@ -13,7 +13,7 @@ def setUp(self): def test_project_model_exists(self): projects = Project.objects.count() - code.interact(local=dict(globals(), **locals())) + self.assertEqual(projects, 2) def test_project_model_has_attributes(self): From 696a823ee1ee8c61a86a9f7a714447f0dddbc204 Mon Sep 17 00:00:00 2001 From: Michael Callahan <118235615+calforcal@users.noreply.github.com> Date: Fri, 1 Sep 2023 09:53:25 -0600 Subject: [PATCH 4/4] Remove a pry from test --- project/models.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/project/models.py b/project/models.py index 29a8da0..06435ef 100644 --- a/project/models.py +++ b/project/models.py @@ -44,7 +44,7 @@ def serialize_all_projects(projects): "saved": x.saved, "tagline": f"{x.tagline}", "collaborators": x.collaborators, - "user_id": f"{x.user_id.id}" + "user_id": x.user_id.id } } array.append(z)