Comments (7)
First Revision
-
Collections (tables): Apartment and User (there will be some additional embedded collections - as described in the fields).
-
Apartment document will contain the following fields:
- Id (integer)
- Images paths (list of string)
- Description (string)
- Geolocation (Geolocation data)
- Address - an embedded document containing the following fields:
- City
- Street
- Number
- "yes-no" features (parking, elevator, pets...) (list of strings). TBD - refernce id to a collection
- Price (double)
- owner_id (reference to the user's id of the owner)
- Date published (date)
- Num of rommates the publisher is looking for (integer)
- Num of rommates currently in the apartment (integer)
- Num of rooms (integer)
- Floor:___ out of:___ (2 X integer)
- Entrance date (Date)
- Size (integer)
- Comments (list of embedded document containing the comments' fields: id(integer), title (string), text (string), user id (reference to the user's id of the publisher), date, root comment for allowing tree structure (reference to the comment id - integer)).
- Interested (list of references to the users' ids of the users who clicked on the "interested" button)
Indexes: Price, features, geolocation, description
-
User document will contain the following fields:
- Id (integer)
- First name (string)
- Last name (string)
- Birthday (Date)
- Username (srting)
- Password (string. we have to store an encrypted hash and not the plain one due to security reasons)
- Email (string)
- Profile picture path (string)
- About (string)
- Hobbies (list of strings)
- Gender (Boolean)
- Home city (String)
- Roommates preferences (list of strings)
Indexes: username, hobbies
from roommates.
Nice work Or.
Apartment document:
- Shouldn't the image field be a list of images instead?
- What about the date of leaving the apartment (checkout date).
from roommates.
Added. Thanks.
from roommates.
Hi @OrAbramovich ,
- I think the yes-no features ("tags") in the apartment entity should be a list of features instead of yes-no. For exmple if the apartment contains an air-conditioner but doesn't allows pets, then "air-conditioner" will be on the list and "pets" wont be.
- in Student, I think we should omit the field "Role", since a student can look for apartment one year and the next publish an apartment ad himself.
from roommates.
Hi @alonttal ,
- I just called it a "yes-no" features in order to be clear but, as written, it's a list of strings that are included in the apartment e.g "Elevator", "AC". We are not going to store strings/booleans about features that are not relevant to the apartment. We would like the list to be schema-free.
- Agree, the first design was to make a separation between student and an apartment owner - edited.
from roommates.
Second revision
(Following Back-end API discussion)
apartment = {
ID: ObjectID, //Mongo apartment ID - generated by MongoDB
ownerID: ObjectID, //Mongo user ID object
price: 1200,
entranceDate: Date,
interested: [ObjectID, ObjectID], //Mongo user ID object
address: {
city: 'city name',
street: 'street name',
number: 22,
apartmentNumber: 22
},
geolocation: {
lantitude: 22.07,
longtitude: 27.58
},
images: [path1, path2],
description: 'apartment description text',
tags: ['AC', 'Elevator', 'Pets'],
requiredNumOfRoommates: 2,
currentlyNumOfRoomates: 3,
numOfRooms: 2,
floor: 4,
totalFloors: 9,
area: 120,
ad: {
datePublsihed: Date,
comments: [
{
ownerID: ObjectID, //Mongo user ID object
date: Date,
text: 'some text here 1'
},
{
ownerID: ObjectID, //Mongo user ID object
date: Date,
text: 'some text here 2'
}
]
}
};
user = {
ID: ObjectID, //Mongo user ID - generated by MongoDB
firstName: 'name',
lastName: 'name',
birthdate: Date,
gender: 'male',
image: path,
about: 'some description here',
hobbies: ['Sport', 'Music'],
publishedApartments: [ObjectID, ObjectID], //Mongo apartment ID object
interestedApartments: [ObjectID, ObjectID], //Mongo apartment ID object
email: '[email protected]', //this will also be the username
password: 'my password', //should be encrypted
};
from roommates.
DB was designed and coded.
future changes will be discussed in a separate issue.
from roommates.
Related Issues (20)
- [User Manual] write how to use area review HOT 3
- Bug: not connecting to socket server after login HOT 2
- [User Manual] how to use group feature HOT 1
- Bug: When a new chat message arrival indication HOT 1
- Bug: Steppers are not working well in Apartment Page (sometimes) HOT 1
- Bug: Front-end: All buttons of groups should be disabled once a group is completed HOT 3
- Bug: Front-end: Close the deal button doesn't trigger the route that changes group status HOT 3
- Recommendation list is too long when there are many recommendations HOT 1
- Front end: Modify payment page to receive apartment ID and fetch price HOT 1
- Front end: Edit links to footer HOT 2
- Back end: Modify the close the deal route to send emails to members of closed group HOT 1
- Fix: Order group member suggestions ordered by matching HOT 3
- Back-end: Send mail to users once group is signed HOT 3
- Document: Update back-end API document HOT 2
- Add About us page HOT 1
- Bug: Prevent payment until 2 first steps are done HOT 1
- Make floor filter disabled by default HOT 1
- Bug: Reviews can't find a review HOT 1
- Front end: Add new message notification tone HOT 1
- Document: Write business flow HOT 4
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from roommates.