Gifthive is the one and only place you need, to save all gift ideas for your loved ones. You can add, manage, and view all of your gift ideas in one place, so that you never forget what you where supposed to get dad for Father's day, or your sister on her next birthday!
JavaScript
Gifthive
As part of the Technigo Web Dev Bootcamp, this project was created as the Final Project. It includes an API, containting several different routes for handling gift items, lists (hives) and users, as well as a frontend handling all user interactions.
Gifthive is the one and only place you need, to save all gift ideas for your loved ones. You can add, manage, and view all of your gift ideas in one place, so that you never forget what you where supposed to get dad for Father's day, or your sister on her next birthday!
Environment Variables
To run this project, you will need to add the following environment variables to your .env file of the backend.
MONGO_URL - Get your Conncection String from MongoDB Atlas.
You will also need to add the following environment variables to your .env file of the frontend.
VITE_BACKEND_API - Add your own backend API deployment link
API Reference
Show all endpoints
GET /
Description
Shows all available endpoints
/user-routes
Get the all users (only used in development, is commented out so not currently visible on the "/" route)
GET /users
Get the dashboard/secret page
GET /dashboard
Parameter
Type
Description
Auth
Header
Required. Authorization Middleware checks for header "Auth"
accessToken
string
Required. AccessToken comes from the logged in user
Regsiter a new user
POST /register
Parameter
Type
Description
username
string
Required. Unique. The username of the new user.
password
string
Required. The password for the new user
Login a user
POST /login
Parameter
Type
Description
username
string
Required. Unique. The username of the new user.
password
string
Required. The password for the new user
Update user information
PUT /users/:id
Parameter
Type
Description
Auth
Header
Required. Authorization Middleware checks for header "Auth"
accessToken
string
Required. AccessToken comes from the logged in user
id
string
The userId of the user
username
string
The new username
password
string
The new password
Delete a user
DELETE /users/:id
Parameter
Type
Description
Auth
Header
Required. Authorization Middleware checks for header "Auth"
accessToken
string
Required. AccessToken comes from the logged in user
id
string
The userId of the user to be deleted
Get all the hives that a user has been shared
GET /users/shared-hives/:id
Parameter
Type
Description
Auth
Header
Required. Authorization Middleware checks for header "Auth"
accessToken
string
Required. AccessToken comes from the logged in user
userId
string
The userId used to get all hives they have been shared.
/gift-routes
Get all hives
GET /hives/
Parameter
Type
Description
Auth
Header
Required. Authorization Middleware checks for header "Auth"
accessToken
string
Required. AccessToken comes from the logged in user
Get shared hives with gifts
GET /hives/shared-with/:id
Parameter
Type
Description
Auth
Header
Required. Authorization Middleware checks for header "Auth"
accessToken
string
Required. AccessToken comes from the logged in user
id
string
Required. Gets the list of shared hives from the users id.
Get individual hive
GET /hives/:id
Parameter
Type
Description
Auth
Header
Required. Authorization Middleware checks for header "Auth"
accessToken
string
Required. AccessToken comes from the logged in user
id
string
The hiveId
Post gift to a hive
POST /gifts
Parameter
Type
Description
Auth
Header
Required. Authorization Middleware checks for header "Auth"
accessToken
string
Required. AccessToken comes from the logged in user
hiveId
string
Required. The hiveId in which the gift gets added
gift
string
Required. The name of the gift
tags
array
Optional. Tags that could be added to the gift, separated by comma
bought
boolean
Optional. Status of bought or not
dueDate
string
Optional. Expected due date for gift item
Add new hive with optional gift and tags
POST /hives
Parameter
Type
Description
Auth
Header
Required. Authorization Middleware checks for header "Auth"
accessToken
string
Required. AccessToken comes from the logged in user
name
string
Required. The name of the hive to be added
gift
string
Optional. Gift to be added to this hive
tags
string
Optional. Tags to be added to the gift in case one is added
dueDate
string
Optional. Expected due date for gift item
Share a hive to an other user
POST /hive/:id/share
Parameter
Type
Description
Auth
Header
Required. Authorization Middleware checks for header "Auth"
accessToken
string
Required. AccessToken comes from the logged in user
shareToEmail
string
Required. The email of the user you wish to share the hive to
Update a gifts information
PUT /gifts/:id
Parameter
Type
Description
Auth
Header
Required. Authorization Middleware checks for header "Auth"
accessToken
string
Required. AccessToken comes from the logged in user
gift
string
Optional. The new name of the gift
tags
array
Optional. The new tag names
bought
boolean
Optional. The new status of bought
dueDate
string
Optional. Expected due date for gift item
Update a hive name
PUT /gifts/:id
Parameter
Type
Description
Auth
Header
Required. Authorization Middleware checks for header "Auth"
accessToken
string
Required. AccessToken comes from the logged in user
name
string
Required. The new name of the hive
Delete an individual gift
DELETE /gifts/:id
Parameter
Type
Description
Auth
Header
Required. Authorization Middleware checks for header "Auth"
accessToken
string
Required. AccessToken comes from the logged in user
Delete an individual hive
DELETE /hive/:id
Parameter
Type
Description
Auth
Header
Required. Authorization Middleware checks for header "Auth"
accessToken
string
Required. AccessToken comes from the logged in user
Unshare a specific hive from the email it is shared to
DELETE /hives/unshare/:id
Parameter
Type
Description
Auth
Header
Required. Authorization Middleware checks for header "Auth"
accessToken
string
Required. AccessToken comes from the logged in user
id
string
Required. The id of the hive you wish to unshare
unshareFromEmail
string
Required. Request in the body, pointing to the user account the hive is to be unshared from
/search-routes
Search for hives or gifts
GET /search
Parameter
Type
Description
Auth
Header
Required. Authorization Middleware checks for header "Auth"
accessToken
string
Required. AccessToken comes from the logged in user
searchTerm
string
Required. The queryparam that is positioned right behind /search ("/search/searchTerm=")
searchValue
string
Required. The queryparam that is positioned right behind /searchTerm, the actual value searched for ("/search/searchTerm=HiveName")