Introducing Neighborhoods, the newest app on the market pioneering a platform aimed for new family starters to get intimately familiar with potential Neighborhood communities!
The project is structured as follows:
api/index.ts
sets up the backend database connection and Express server. This should actually be in theserver
folder, but it must be here due to a Vercel limitation.server/
contains the backend codeclient/
contains the frontend codeApp.vue
is the root component of your applicationmain.ts
is the entry point of your application, which initializes Vuecomponents/
contains the components of the frontendcommon/
contains general form components that can be reused across different concepts
public/
contains base HTML files and static assetsrouter.ts
contains the Vue routerstore.ts
contains the Vuex store, which stores application state and persistent data
Run npm install
in your terminal to install local dependencies. Request Team DDAG for the .env
file to access the MongoDB database.
- Run
npm run serve
, which compiles the frontend for hot-reloading with webpack and serves it at port8080
. - Open a new terminal (with the original one still open) and run
npm run dev
to start the backend at port3000
. - To view your website, connect to localhost:8080
Note, Vue proxies any URL it can't resolve on the client side (at port 8080) to the server (to port 3030).
This renders the index.html
file that will be used to interact with the backend
Returns
- A success message
- An object with currently logged in user's details (without password) or null if not logged in
Body
username
{string} - The user's usernamepassword
{string} - The user's password
Returns
- A success message
- An object with user's details (without password)
Throws
403
if the user is already logged in400
ifusername
orpassword
is not in correct format format or missing in the req401
if the user login credentials are invalid
Returns
- A success message
Throws
403
if user is not logged in
Body
username
{string} - The user's usernamepassword
{string} - The user's password
Returns
- A success message
- An object with the created user's details (without password)
Throws
403
if there is a user already logged in400
ifusername
orpassword
is in the wrong format409
ifusername
is already in use
Body (no need to add fields that are not being changed)
username
{string} - The user's usernamepassword
{string} - The user's password
Returns
- A success message
- An object with the update user details (without password)
Throws
403
if the user is not logged in400
ifusername
orpassword
is in the wrong format409
if theusername
is already in use
Returns
- A success message
Throws
403
if the user is not logged in
Returns
- A success message
- An object with the neighborhood
Throws
400
ifname
,city
orstate
is not given403
if user is not logged in404
ifname
,city
,state
of a neighborhood is not a recognized neighborhood
Returns
- A success message
- An array of neighborhoods in a city, state
Throws
400
ifcity
orstate
is not given403
if user is not logged in
Returns
- A success message
- An array of all the neighborhoods
Throws
403
if user is not logged in
Body
name
{string} - The name of the neighborhoodcity
{string} - The city of the neighborhood's locationstate
{string} - The state of the neighborhood's locationlatitude
{string} - The latitude of the neighborhood's locationlongtitude
{string} - The longtitude of the neighborhood's locationcrimeRate
{string} - The crime rate in the neighborhoodaveragePrice
{string} - The average price of a home in the neighborhoodaverageAge
{string} - The average age of the residents in the neighborhood
Returns
- A success message
- An object with the created neighborhood
Throws
400
if any neighborhood information provided is in the wrong format401
if user making the request is not the admin403
if user is not logged in409
if neighboorhood already exists
Body
crimeRate
{string} - The new crime rate in the neighborhoodaveragePrice
{string} - The new average price of a home in the neighborhoodaverageAge
{string} - The new average age of the residents in the neighborhood
Returns
- A success message
- An object with the updated neighborhood
Throws
400
ifname
,city
orstate
is not given400
if any updated neighborhood information is in the wrong format401
if user making the request is not the admin403
if user is not logged in404
ifname
,city
,state
of a neighborhood is not a recognized neighborhood
Returns
- A success message
Throws
400
ifname
,city
orstate
is not given401
if user making the request is not the admin403
if user is not logged in404
ifname
,city
,state
of a neighborhood is not a recognized neighborhood
Returns
- An array of reviews of a neighborhood with
name
,city
,state
Throws
400
ifname
,city
orstate
is not given403
if the user is not logged in404
ifname
,city
,state
of a neighborhood is not a recognized neighborhood
Returns
- An array of reviews created by user with username
author
Throws
400
ifauthor
is not given403
if the user is not logged in404
ifauthor
is not a recognized username of any user
Body
neighborhoodId
{string} - The id of the location of the reviewrating
{string} - The rating of the reviewcontent
{string} - The content of the review
Returns
- A success message
- A object with the created review
Throws
400
if the reviewcontent
is empty or a stream of empty spaces400
if the reviewrating
is not a number or between 0 and 10403
if the user is not logged in413
If the reviewcontent
is more than 4096 characters long
Returns
- A success message
Throws
403
if the user is not logged in403
if the user is not the author of the review404
if thereviewId
is invalid
Returns
- A boolean on whether or not a user is a resident of neighborhood
Throws
400
if user is not given or neighborhoodId is not given403
if the user is not logged in404
if no user has given username or neighborhoodId of a neighborhood is not a recognized neighborhood
Returns
- An array of neighborhoods an user is a resident in
Throws
400
if neighborhoodId is not given403
if the user is not logged in404
if neighborhoodId of a neighborhood is not a recognized neighborhood
Body
name
{string} - The name of the neighborhoodcity
{string} - The city of the neighborhood's locationstate
{string} - The state of the neighborhood's location
Returns
- A success message
- The created certifiedResidency
Throws
400
if any neighborhood information provided is in the wrong format403
if the user is not logged in409
if neighborhood already exists
Returns
- A success message
Throws
403
if the user is not logged in404
if the certifiedResidencyId is not valid
Returns
- A success message
- An array of all the vibe checks of the logged in user
Throws
403
- If the user is not logged in
Body
availabilityId
{string} - The id of the availability of the desired resident
Returns
- A success message
- The created vibe check
Throws
400
if availabilityId is missing403
if the user is not logged in404
if the availabilityId is not valid
Returns
- A success message
Throws
403
if the user is not logged in404
if vibe check with vibeCheckId does not exist
Returns
- A success message
- An array of all the availabilities of a neighborhood
Throws
400
if neighborhoodId is not given403
if the user is not logged in404
if neighborhoodId of a neighborhood is not a recognized neighborhood
Body
neighborhoodId
{string} - The id of the neighborhoodvideoLink
{string} - The video link of the meetingdateTime
{string} - The date and time that the availability is scheduled for
Returns
- A success message
- The created availability
Throws
403
if the user is not logged in404
if neighborhoodId is not a recognized neighborhood409
if date and time already exist
Returns
- A success message
Throws
403
if the user is not logged in404
if availability with availabilityId does not exist
Returns
- A success message
- An array of strolls of belonging to user with username
Throws
400
- if author is not given403
- if the user is not logged in404
- if no user has given author
Returns
- A success message
- An array of strolls of strolls of the neighborhood with name city and state
Throws
400
if name, city or state is not given403
if the user is not logged in404
if name, city, state of a neighborhood is not a recognized neighborhood
Body
neighborhoodId
{string} - The id of the neighborhood of the strollstrollVideo
{string} - the link of the stroll video to the firebase storagetitle
{string} - the title of the stroll
Returns
- A success message
- An object with the created stroll
Throws
403
if the user is not logged in404
if no neighborhood with neighborhoodId exists400
if title of stroll or videoStroll is not properly formatted string
Returns
- A success message
Throws
403
if the user is not logged in404
if the strollId is not valid