Coder Social home page Coder Social logo

rentr's Introduction

rentr

Software Engineering II - Rentr

Client: https://rentr-front-end.herokuapp.com/

Server: https://rentr-dev.herokuapp.com/

The Team

  • Ronnie D'Souza (RonnieDsouza) Leader
  • Justin Choi (jcsnorlax97)
  • Hualong Qiao (Mik3Qiao)
  • Azizul Hakim (AzizulHakim96)
  • Nathan Carriere (NathanCarriere)

Languages/Technogies

  • FrontEnd React.js
  • Backend Node.js (w/ Express.js)
  • Database PostgreSQL

Descriptions/Objectives

We aim to create an apartment renting website. That is, provide a space for landlords to put up listings for their apartments which tenants can peruse through, in order to find an apartment that suits their needs. The goal is to provide sufficient functionalities for both parties requirements. This includes allowing the landlords to specify all the necessary information about the apartments. Meanwhile, the renters will be able to specify their preferences and budget ranges when searching for an apartment.

There are two main categories of users on our website; landlords and tenants. The majority of apartment seekers are youths/younger adults from ages 16-35. As most people this age are not seeking to buy, but to rent, this allows us to capture more of our target audience. We believe this can increase the popularity of Rentr among them as they share it by talking about it with their friends, increasing our user base.

Rentr allows tenants to search for listings with specified criteria. This allows tenants to quickly find their ideal apartment. In prioritizing convenience for our users, we will also provide the ability for tenants to ask landlords questions they have about a listing. This allows other tenants to learn more about a listing too, and helps landlords clear up miscellaneous questions tenants may have. These features help support both landlords and tenants.

Core features

Link - here

  1. User account management (Sprint 2)
  2. Adding apartment listings (Sprint 2)
  3. Modifying the rental properties (Sprint 3)
  4. Searching for rental properties they desire (Sprint 3)
  5. Q&A Section (Sprint 3~4)

Milestones

Others

  • Rentr Wiki - here

    • This consists of design digrams, meeting minutes, testing plan.
  • Rentr Backend API URI - here

rentr's People

Contributors

azizulhakim96 avatar jcsnorlax97 avatar mik3qiao avatar nathancarriere avatar ronniedsouza avatar

Stargazers

 avatar  avatar  avatar  avatar

Watchers

 avatar

rentr's Issues

[TASK] Story #36: Login Button Event Handler

Associated User Story:

#36

Task Description:

  • This ticket aims to handle the login event when the Login button from the Login prompt is pressed.

Dependencies:

#53, #54

Acceptance Criteria:

  • Click on login, dialog is poped up

[TASK] Story #35: Setup Backend - Node.Js + Express.Js + PostgreDB & Implement Account Creation Route

Description

In this issue, assignee should do an initial backend-project setup using NodeJS/ExpressJS and PostgreDB. If required, this issue might also implement the POST request for user account creation.

Sub-tasks

  • Basics - create .gitignore, package.json, README.md
  • Install dependencies & dev dependencies:
    • Basics: express, pg, cors, dotenv, nodemon
    • Logger: morgan
    • Linter & Formatter: Eslint + Prettier
    • Object Scheme Validator: @hapi/joi
    • DI (Dependency Injection) package: awilix
    • Testing framework: jest & supertest
  • Postgres Setup & Configuration
    • Sample .env template: .env.template
    • DB Configuration (Host, Port, User, Pw, Db): ./config/config
    • DB Migration (DB Initialization Script): ./migrations/init.sql
    • Postgres DB Connection (Pool): ./db/db.js
  • Welcome & Ping API endpoints
    • Route: api/routes/api.js
    • Controller: controllers/api.js
  • User API endpoint - POST request (User Registration)
    • Route
    • Middleware (Validations)
    • Controller
    • Services
    • Dao (Data Access Objecct)
    • Dto (Object Scheme Validator)

[TASK] Backend Server Setup for Deployment into Heroku

Associated User Story:

N/A

Task Description:

  • Heroku

    • Create new account
    • Create new Heroku app in DashBoard.
    • Add "Heroku Postgres" add-ons in the app->Resources tab.
    • Update Config Vars in <app_page>->"Settings" tab by adding DB_ENVIRONMENT=production in it.
  • Rentr Project (Back-end)

    • Add npm start script in package.json (Required by Heroku for running the app)
    • Update config/config.js and db/db.js to handle DB in Production environment.
    • Deploy Node.JS app (/server folder) & current feature branch into Heroku for first-try.
  • Note: Before the end of this sprint, the Node.JS app (/server folder) & master branch need to be deployed into the Heroku as Prod. This would be done after develop has been merged into master. As no code changes involved to do that, no tickets would be created for that.

Dependencies:

Heroku

Acceptance Criteria:

  • Able to call the API locally, i.e. localhost
  • Able to call the API via the given domain name by Heroku.

[TASK] Story #26: Add "Create a listing" button

User story: #26

Somewhere on the site, add a "Create a listing" button which landlords can click, which causes a "Listing creation" form/dialog to open.

Testing criteria:

  • Button that says "create a listing" should appear somewhere (for now, doesn't matter much)
  • (Restrict access to landlords?)
  • Clicking the button should result in a dialog appearing.

Planned completion date: By Wednesday, February 17 (My estimate: 1 day of work)

Time spent so far: 2 hours

[TASK] Story #35: POST Route for Account Creation

Associated User Story:

#35

Task Description:

  • This ticket aims to implement an API endpoint for creating new user account.
  • This endpoint should be a POST request with JSON Body.

Dependencies:

#3

Acceptance Criteria:

TBD

[STORY] As a landlord, I want to add photos to my listing so people know what it looks like

Associated Issues & PRs (Sprint 2)

As a landlord, I want to be able to add photos to my listing so people can see what it looks like

Acceptance test:

  • Landlords can upload pictures and add it to the listing.
  • Listing should show pictures

Time Estimate: 5 Days

Developer tasks:

  • Add button on the listing details page: "upload"
  • Add the function for the button to upload picture in the frontend
  • Add the REST api "get" and "post" so pictures could be stored in the db, and picture will show after it's posted.
  • Test if it works for multiple listing.

[DUPLICATED] Back end: Implement apartment listings

Double check that this doesn't overlap with a dev task for #26

  • Create a back end POST route for the information in #49:

  • Title

  • Description

  • Number of bedrooms

  • City

  • Photos

  • Perform a DB update to store this information.

This should not involve creating a GET route. That should be a #26 dev task.

[TASK] Story #26: Add form to "Create a listing" dialog.

User story: #26

In the dialog that appears after clicking the "Create a listing" button (see: #65), add a form inside the dialog where the user can input listing details.. This form should have a submit button that sends the form data to the back end.

Testing criteria:

  • Has title field
  • Title field has a character limit of 100 characters and a message to user if they hit the character limit.
  • Has description field
  • Description field has a character limit of 5000 and a message to user if they hit the character limit.
  • Has number of bedrooms field.
  • Bedroom field should be a dropdown. Options: 1-10 bedroom, with final option being ">10"
  • Has number of bathrooms field
  • Bathrooms field should be a dropdown. Options: 1-5 bathroom, with final option being ">5"
  • Has submit button which passes form information to server.

Planned completion date: By Friday, February 19 (My estimate: 2 days of work)

[BUG] GET Ping API endpoint is not working.

Description

When the GET Ping API endpoint is called, the server responds with a 500 error instead of a 200 status.

Screen Shot 2021-02-14 at 3 40 45 PM

Expected Results

200 Success Status with a JSON object consisting of (i) current time and (ii) a successful time displayed.

Actual Results

500 Error Status with "TypeError: Cannot destructure property 'now' of 'rows[0]' as it is undefined."

Additional Notes

Based on investigation, the problem appears to be in ApiController in controllers/api.js. Instead of const { now } = rows[0], we should have const { now } = rows.rows[0].

  • Source code:
    Screen Shot 2021-02-14 at 3 47 33 PM

  • Return value of this.dbPool.query('SELECT NOW()').
    Screen Shot 2021-02-14 at 3 50 15 PM

[TASK] Story #23: Implement a GET route for retrieving a single existing listing from DB

Associated User Story (TBD):

#23 or/and #26

Task Description (TBD):

  • This ticket aims to implement an API endpoint for creating new user account.
  • Route: /api/v1/listing/:id
  • Areas that involve updates:
    • /api folder (required)
    • /controllers folder (required)
    • /service folder (optional - TBD - may have another task ticket to refactor codes from this)
    • /dao folder (optional - TBD - may have another task ticket to refactor codes from this)
    • /dto folder (optional - TBD - may have another task ticket to refactor codes from this)

Dependencies:

N/A

Acceptance Criteria (TBD):

  • /api/v1/listing/:id returns a single JSON object, which consists of fields as follows:
    1. Id,
    2. Title,
    3. Price,
    4. Number of bedrooms,
    5. Number of bathrooms, and
    6. Description.

[STORY] As a landlord, I want to list my apartment so potential renters can see the listing

Associated Issues & PRs (Sprint 2)

As a landlord, I want to be able to list my apartment so that potential renters can see the listing

Acceptance criteria:

  • : Landlords should be able to create an apartment listing.
  • : Both landlords and tenants should be able to see the listing.
  • : Pagination works when there is more than 1 page of listing

Estimated time: 3 days

Dev tasks:

    • : Add a button on the home page that allows the user to add a listing.
    • : Showing all the available listings on the homepage.
    • : Pagination that allows users to go to different pages

[DUPLICATED] Front end: Implement apartment listings

The goal of this is to implement the "listing creation" form.

It will give options for users to specify details about their listing:

  • Title
  • Description
  • Number of bedrooms
  • City
  • Photos

This should take the user inputted data and send it to the backend.

Relates to #23

[TASK] Story #36: Implement a GET route retrieving one single user from DB via user id for User Authentication during Login

Associated User Story:

#36

Task Description:

  • This ticket aims to implement an API endpoint for (front-end or user login feature) to retrieve an existing user from DB.
  • Route: /api/v1/user/:id
  • Areas that involve updates:
    • /api folder (required)
    • /controllers folder (required)
    • /service folder (required)
    • /dao folder (required)

Dependencies:

N/A

Acceptance Criteria (may be updated in the future):

  • /api/v1/user/:id returns a 200 status & a user json object when the user exists.
  • /api/v1/user/:id returns a 404 status error when the user does not exist.
  • /api/v1/user/:id returns a 500 status error when the query string is not an integer.

[BUG] POST User Registration API Endpoint is not working after initial database migration

Description

An error has been reported that after doing database migration with the use of init.sql and the commend \i <path_to_init.sql>, the server fails to register new user into the database even if the provided email and password are valid.

There are three kinds of error messages being found out during the exploration:

  1. "error: column "uemail" of relation "User" does not exist"
  2. "error: column "uid" of relation "User" does not exist"
  3. "ReferenceError: uId is not defined"

Based on investigation, this is potentially because of different OS parsing field names differently. For example, in order to persist the uppercase letters, they need to have double quotes ("") wrapping the field name; in contrast, for MacOS, uppercase letters are persist without the double quotes, and it will become another field name called \"uEmail\" instead of uEmail if we provide it with the quotations. Further research & investigations are required to resolve this cross-OS database issues.

Expected Results

201 Success Status with a JSON object consisting of (i) success message and (ii) the created user's uId.

Actual Results

500 Error Status with different kind of messages.

Additional Notes

  • Codes - UserDao:
    Screen Shot 2021-02-14 at 4 27 14 PM

  • Codes - DB Migration Script (init.sql)
    Screen Shot 2021-02-14 at 4 28 02 PM

  • Error 1 (provided by Azizul):
    bug3

  • Error 2 (provided by Azizul):
    bug2

  • Error 3 (provided by Azizul):
    bug

[STORY] As a landlord, I want to add a listing

Associated Issues & PRs (Sprint 2)

This will implement the "create a listing" form/dialog UI and back end. So it will entail creating a "Add listing" button for users, a form for them to input data, and a back end to store this data.

The actual retrieval/viewing of listings will be done by #23, so don't do any of that work.

Acceptance criteria:

  • Users can click on a button to add a listing, and then a listing creation dialog appears
  • Listing creation dialog/form includes fields for title, price, number of bedrooms, number of bathrooms, and description.
  • Users can click a submit button on the listing creation dialog to submit their entry

Estimate: 5 days

[TASK] Story #35: Homepage Layout - Header Component

Associated User Story:

#35

Task Description:

  • This ticket aims to implement a basic Rentr homepage layout for account management.
  • The homepage layout consists of a Header component.
  • The Header component should consists of two things:
    1. a Rentr Icon / Rentr Title on the top left, telling user the app they're using.
    2. a Login button or hyperlink text.
      • This ticket does not involve any behaviour implementation; the behavioural implementation would belong to another ticket.

Dependencies:

N/A

Acceptance Criteria:

  1. A Rentr Icon / Rentr Title is on the top left side of the page.
  2. A Login button / hyperlink text is on the top right side of the page.
  3. The Login button / hyperlink should be inside a component called Header. 2
  4. The Header component can be rendered via App.js.

[TASK] Story #36: POST Route for Account Login

Associated User Story:

#36

Task Description:

  • This ticket aims to implement an API endpoint for logging in.
  • This endpoint should be a POST request with JSON Body.
  • Note: This consists of lots of works as it may involve authentication & sessions.

Dependencies:

#3

Acceptance Criteria:

TBD

[TASK] Story #35: Login Prompt Popping Event Handler

Associated User Story:

#35, #36

Task Description:

  • This ticket aims to implement the behaviour of popping login prompt when the login button is clicked.
  • The login prompt should look like:
    Screen Shot 2021-02-08 at 7 51 34 PM
  • When an entry (either the one for email or password) is empty, it should display "[email protected]" as a default text, and "password" as a default text.
  • The entered password should be shown as black bullet points instead of actual passwords.
  • The behavioural implementation of Login button and Registration button do not need to be implemented yet. (It would be in another ticket.)

Dependencies:

#53

Acceptance Criteria:

  1. When login button is clicked, it should render a login prompt with (i) an entry for email address, (ii) an entry for password, (iii) a login button, and (iv) a registration button.
  2. The helper text for the "email" entry should be "[email protected]".
  3. The helper text for the "password" entry should be "password".
  4. The entered password should be displayed as black bullet points instead of the actual password.

[TASK] Story #26: Back end processing of "Create listing" form submission

User story: #26

This is to implement the back end processing of the "Create a listing" form submission. See #66 for a list of fields to be stored.

Testing criteria:

  • Character limit of 100 for title field
  • Character limit of 5000 for description field
  • A number of bedrooms field (front end will have a dropdown box, the final option probably being ">10")
  • A number of bathrooms field (front end will have a dropdown box, the final option probably being ">5")
  • After a form submission, the information is correctly entered into the database.

The details of the implementation is up to you. Feel free to create additional tickets to break things down further.

[STORY] As a landlord, I want to be able to edit my listing's details so I can fix any of the listing's mistakes

Epic: #117

As a landlord, I want to be able to edit my listing's details so I can fix any of the listing's mistakes

Acceptance test:

  • As a user who has posted a listing, I can modify my listing's:
    • title
    • price
    • number of bedrooms
    • number of bathrooms
    • description
    • Whether it allows pets
    • Whether it has parking
    • Whether it has laundry
    • Photos
  • And other users can see any modifications made

Time Estimate: TBD

[TASK] Story #23: Implement a GET route for retrieving all existing listings from DB

Associated User Story:

#23 or/and #26

Task Description:

  • This ticket aims to implement an API endpoint for front-end to retrieve all existing listings from DB.
  • Route: /api/v1/listing
  • Areas that involve updates:
    • /api folder (required)
    • /controllers folder (required)
    • /service folder (optional - TBD - may have another task ticket to refactor codes from this)
    • /dao folder (optional - TBD - may have another task ticket to refactor codes from this)
    • /dto folder (optional - TBD - may have another task ticket to refactor codes from this)

Dependencies:

N/A

Acceptance Criteria (may be updated in the future):

  • /api/v1/listing returns a list of JSON objects, and each object should consist of fields as follows:
    1. Id,
    2. Title,
    3. Price,
    4. Number of bedrooms,
    5. Number of bathrooms, and
    6. Description.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.