The Recycle Journey website's backend and frontend are both located in this repository.
Recycle Journey is an instructional website that offers users
the ability to estimate the cost of waste, identify their waste for sale or donation,
and receive guidance on how to properly handle waste before recycling.
Our target goal is people who interest in recycling /don't know how to start
and so aid in the preservation of our globe by improving the aesthetics and sustainability of our blue planet.
- Create / Read / Update / Delete user's Information Card
cd to Backend and Recycle Journey (for frontend) then run.
npm run dev
Parameter | Type | Description |
---|---|---|
success | boolean | the status of request |
msg | string | message for each request |
data | JSON | the actual data |
POST /login
Parameter | Type | Description |
---|---|---|
String | ||
password | String | password |
Example
{
"email" : "user1@gmail.com",
"password" : "1234"
}
Response
200
Login credential is correct
Parameter | Type | Description |
---|---|---|
fullname | String | fullname |
Example
{
"fullname": "Joji",
}
noted: If success, the Response will be sent with cookie named UserToken
POST /register
Parameter | Type | Description |
---|---|---|
fullname | String | fullname |
lastname | String | lastname |
company_organization | String | company_organization |
String | ||
password | password | password |
tel | String | tel |
profile_picture | String | profile_picture |
Example
{
"fullname" : "Joji",
"lastname" : "Charpie"
"company_organization" : "ABC coop"
"email" : "abcd@gmail.com"
"password" : "1234"
"tel" : "0123456789"
"profile_picture" : "www.mock.com"
}
Response
200
User has been created
no response body
GET /event
No Request Body
200
found todos
Response
Parameter | Type | Description |
---|---|---|
no parameter | Array of location | all locations or events related to user |
the event object
Parameter | Type | Description |
---|---|---|
id | string | id of event |
user_id | string | user id |
name | string | event name |
location | string | event location |
contact | string | event contact |
category | string | event category |
description | string | event description |
openAt | string | event open at |
closeAt | string | event close at |
date_start | string | date event starts |
date_end | string | date event ends |
event_url | string | event url |
banner_url | string | event banner url |
Example
[
{
"id": 4,
"user_id": 9,
"name": "Recycle & Reuse Fair",
"location": "321 Main Street, Green City",
"contact": "Sarah Johnson (555) 321-6547",
"category": "dono",
"description": "Join us at the Recycle & Reuse Fair where you can find innovative ways to repurpose items!",
"openAt": "10:00 AM",
"closeAt": "10:00 AM",
"date_start": "September 10, 2023",
"date_end": "September 12, 2023",
"event_url": "www.mock.com",
"banner_url": "www.mock.com",
}
]
POST /addEvent
Parameter | Type | Description |
---|---|---|
id | string | id of event |
user_id | string | user id |
name | string | event name |
location | string | event location |
contact | string | event contact |
category | string | event category |
description | string | event description |
openAt | string | event open at |
closeAt | string | event close at |
date_start | string | date event starts |
date_end | string | date event ends |
event_url | string | event url |
banner_url | string | event banner url |
200
success
Response
Parameter | Type | Description |
---|---|---|
id | string | id of event |
user_id | string | user id |
name | string | event name |
location | string | event location |
contact | string | event contact |
category | string | event category |
description | string | event description |
openAt | string | event open at |
closeAt | string | event close at |
date_start | string | date event starts |
date_end | string | date event ends |
event_url | string | event url |
banner_url | string | event banner url |
Example
[
{
"id": 4,
"user_id": 9,
"name": "Recycle & Reuse Fair",
"location": "321 Main Street, Green City",
"contact": "Sarah Johnson (555) 321-6547",
"category": "dono",
"description": "Join us at the Recycle & Reuse Fair where you can find innovative ways to repurpose items!",
"openAt": "10:00 AM",
"closeAt": "10:00 AM",
"date_start": "September 10, 2023",
"date_end": "September 12, 2023",
"event_url": "www.mock.com",
"banner_url": "www.mock.com",
}
]
PATCH /editEvent
Parameter | Type | Description |
---|---|---|
id | string | id of event |
user_id | string | user id |
name | string | event name |
location | string | event location |
contact | string | event contact |
category | string | event category |
description | string | event description |
openAt | string | event open at |
closeAt | string | event close at |
date_start | string | date event starts |
date_end | string | date event ends |
event_url | string | event url |
banner_url | string | event banner url |
200
success
Response
Parameter | Type | Description |
---|---|---|
id | string | id of event |
user_id | string | user id |
name | string | event name |
location | string | event location |
contact | string | event contact |
category | string | event category |
description | string | event description |
openAt | string | event open at |
closeAt | string | event close at |
date_start | string | date event starts |
date_end | string | date event ends |
event_url | string | event url |
banner_url | string | event banner url |
Example
[
{
"id": 4,
"user_id": 9,
"name": "Recycle & Reuse Fair",
"location": "321 Main Street, Green City",
"contact": "Sarah Johnson (555) 321-6547",
"category": "dono",
"description": "Join us at the Recycle & Reuse Fair where you can find innovative ways to repurpose items!",
"openAt": "10:00 AM",
"closeAt": "10:00 AM",
"date_start": "September 10, 2023",
"date_end": "September 12, 2023",
"event_url": "www.mock.com",
"banner_url": "www.mock.com",
}
]
DELETE /deleteEvent
Parameter | Type | Description |
---|---|---|
id | String | id of location |
200
deleted successfully
no response body