Palette Picker BE is a backend connected to our Palette Picker FE React App allows for storage color palettes and projects.
A successful response returns an array of project objects.
GET
/api/v1/projects
Name | Type | Description |
---|---|---|
id | integer | Unique project ID |
name | string | Project name |
created_at | string | Project creation date/time |
update_at | string | Project's last updated date/time |
Example:
[
{
"id": 1,
"name": "Neature",
"created_at": "2019-12-03T22:17:16.382Z",
"updated_at": "2019-12-03T22:17:16.382Z"
},
{
"id": 2,
"name": "Fall Stuff",
"created_at": "2019-12-03T22:17:16.387Z",
"updated_at": "2019-12-03T22:17:16.387Z"
},
{
"id": 3,
"name": "Animal Coats",
"created_at": "2019-12-03T22:17:16.388Z",
"updated_at": "2019-12-03T22:17:16.388Z"
}
]
A successful response returns the specified project object, by ID.
GET
/api/v1/projects/:id
Name | Type | Description |
---|---|---|
id | integer | Unique project ID |
name | string | Project name |
created_at | string | Project creation date/time |
update_at | string | Project's last updated date/time |
Example:
[
{
"id": 3,
"name": "Animal Coats",
"created_at": "2019-12-03T22:17:16.388Z",
"updated_at": "2019-12-03T22:17:16.388Z"
}
]
A successful response returns the id of the new project.
POST
/api/v1/projects
Name | Type | Description |
---|---|---|
id | integer | Unique project ID |
name | string | Project name |
Example:
10
A successful response returns the id of the new project.
DELETE
/api/v1/projects/:id
| Name | Type | Description | |id|integer| Unique project ID| |name|string|Project name|
Example:
5
A successful response returns an array of palette objects.
GET
/api/v1/palettes
Example:
[
{
"id": 137,
"name": "Fall",
"projects_id": 25,
"color1": "#3CCB84",
"color2": "#697689",
"color3": "#3CCB84",
"color4": "#697689",
"color5": "#3CCB84",
"created_at": "2019-12-04T23:34:45.821Z",
"updated_at": "2019-12-04T23:34:45.821Z"
},
{
"id": 138,
"name": "Winter",
"projects_id": 27,
"color1": "#3CCB84",
"color2": "#697689",
"color3": "#3CCB84",
"color4": "#697689",
"color5": "#3CCB84",
"created_at": "2019-12-04T23:34:45.821Z",
"updated_at": "2019-12-04T23:34:45.821Z"
},
{
"id": 139,
"name": "Spring",
"projects_id": 26,
"color1": "#3CCB84",
"color2": "#697689",
"color3": "#3CCB84",
"color4": "#697689",
"color5": "#3CCB84",
"created_at": "2019-12-04T23:34:45.821Z",
"updated_at": "2019-12-04T23:34:45.821Z"
}
]
A successful response returns the specified palette object, by ID.
GET
/api/v1/palettes/:id
Need valid id
in URL.
Example
/api/v1/palettes/137
Example:
[
{
"id": 137,
"name": "Fall",
"projects_id": 25,
"color1": "#3CCB84",
"color2": "#697689",
"color3": "#3CCB84",
"color4": "#697689",
"color5": "#3CCB84",
"created_at": "2019-12-04T23:34:45.821Z",
"updated_at": "2019-12-04T23:34:45.821Z"
}
]
A successful response returns the id of the new palette.
POST
/api/v1/palettes
Need to provide a valid new palette object in the body.
{
name: <String>,
color1: <String>,
color2: <String>,
color3: <String>,
color4: <String>,
color5: <String>
}
Example:
{
name: "Fall",
color1: "#FFFFFF",
color2: "#000000",
color3: "#688780",
color4: "#BA3EH9",
color5: "#008800"
}
Example:
10
A successful response returns a message saying "Patch with an id of ${id} was successful".
PATCH
/api/v1/palettes/:id
Need valid id
in URL.
Example
/api/v1/palettes/137
AND
Need to list and existing key and new value you wish to overwrite in the body.
{ key: value }
Example:
{ color1: "#FFFFFF" }
Example:
"Patch with an id of 5 was successful."
A successful response returns a message saying "Project with an id of ${id} successfully deleted".
DELETE
/api/v1/palettes/:id
Need valid id
in URL.
Example
/api/v1/palettes/5
Example:
"Project with an id of 5 successfully deleted."
A successful response returns an array of the projects with names that match the query string.
GET
/api/v1/projects/?key=value
Need a valid query in the URL.
?name=projectNameYouAreSearchingFor
Example:
?name=neature
Case does not effect search
Example:
{
"id": 25,
"name": "Neature",
"created_at": "2019-12-04T23:34:45.815Z",
"updated_at": "2019-12-04T23:34:45.815Z"
}
-
Back-End: build using Express, knex, and PostgreSQL. Each API endpoint should respond with JSON-formatted data.
-
Front-End: build using React utilizing SCSS.
-
Tested with Jest/Enzyme.
-
Victor Abraham (https://github.com/VPAbraham)
-
Quinne Farenwald (https://github.com/qfarenwald)