Git Product home page Git Product logo

fancy-coffee-table's People

Contributors

brossadents avatar uelb avatar

Stargazers

 avatar

Watchers

 avatar  avatar  avatar

fancy-coffee-table's Issues

Create the v0 controller architecture

We should stick to a REST API controller architecture and not think too much about the client side for the moment. The registrations and sessions controller will be managed by a third party library so is not explained here.

UsersController

  • GET /users/:id/users Users around the user whose id is :id and filtered by his preferences and maybe the evaluation scores

RoomsController

  • GET /users/:user_id/rooms Displayed rooms of the user whose id is :user_id
  • POST /users/:user_id/rooms Create or join a room by looking for an available user around the user whose id is :user_id
  • DELETE rooms/:id Hide the room whose id is :id for the current user
  • PUT rooms/:id Display the profile of the current user for the room :id

MessagesController

  • GET rooms/:room_id/messages Get all the messages of the room :room_id
  • DELETE messages/:id Delete the message :id
  • POST rooms/:room_id/messages Create a message for the current user in the room :room_id
  • PUT/PATCH messages/:id Update the message :id body

EvaluationsController

  • GET /users/:user_id/evaluations/average Get the average evaluation of the user :user_id
  • GET /users/:user_id/evaluations Get all the evaluations of the user :user_id
  • POST /users/:user_id/evaluations Create an evaluation for the user :user_id
  • PUT/PATCH /evaluations/:id Change the score of an evaluation

Create the v0 model architecture

Let's remind that in Rails, there are automatically an id (primary key), a created_at and an updated_at attributes, we will therefore not write those attributes below.

User

1. Attributes

  • email:string
  • password:string
  • firstname:string
  • lastname:string
  • latitude:float
  • longitude:float
  • gender:boolean
  • gender_preference:boolean
  • min_age_preference:integer
  • max_age_preference:integer

2. Instance Methods

  • name firstname + lastname
  • around(kms) Users around a specific user in a circle of kms radius
  • average_score Simple average of the scores the evaluations the user received

3. Class Methods

  • around(latitude,longitude) All users around a certain map position

4. Associations

  • has_many :rooms
  • has_many :pictures
  • has_many :sent_messages, foreign_key: :sender_id
  • has_many :received_messages, foreign_key :recipient_id
  • has_many :send_evaluations, foreign_key: :reviewer_id
  • has_many :received_evaluations, foreign_key: :reviewed_user_id

5. Validations

  • :email => [:presence, :format]
  • :password => [:presence]
  • firstname => [:presence]
  • lastname => [:presence]

Room

1. Attributes

  • latitude:float
  • longitude:float
  • first_user_id:integer
  • second_user_id:integer
  • displayed_for_first_user:boolean (default:true)
  • displayed_for_second_user:boolean (default:true)
  • first_user_profile_displayed:boolean (default:false)
  • second_user_profile_displayed:boolean (default:false)

2. Instance methods

  • is_active? Whether one of the users have chosen not to display the room

3. Class methods

4. Associations

belongs_to :first_user
belongs_to :second_user
has_many :messages

5. Validations

  • :latitude => :presence
  • :longitude => :presence
  • :first_user => :presence
  • :second_user => :presence
  • :displayed_for_first_user => :presence
  • :displayed_for_second_user => :presence
  • :first_user_profile_displayed => :presence
  • :second_user_profile_displayed => :presence

Message

1. Attributes

  • body:text (null: false)
  • sender_id:integer (null:false)
  • recipient_id:integer (null:false)

2. Instance methods

3. Class methods

4. Associations

  • belongs_to :sender, class_name: 'User'
  • belongs_to :recipient, class_name: 'User'
  • belongs_to :room

5. Validations

  • body: :presence
  • sender: :presence
  • recipient: :presence

Evaluation

I think we should let a user evaluate another one to exclude users that are polluting the app

1. Attributes

  • reviewer_id:integer (null: false)
  • reviewed_user_id:integer (null: false)
  • score:tinyint (null:false)

2. Instance methods

3. Class methods

4. Associations

  • belongs_to :reviewer, class_name: 'User'
  • belongs_to :reviewed_user, class_name: 'User'

5. Validations

  • :reviewer => :presence
  • :reviewed_user => :presence
  • :score => [:presence, min: 0, max: 5]

Create the v0 views

New registration page

Form with email, password

New session page

Form with email, password

New password page

Form with email

Edit registration page

Form with email, password, firstname, lastname, preferences, etc... (Cannot change email without password)

Home page

Basic Actions and nav :

  • Find a chat
  • Edit profile and preferences
  • Sign out

Room page

Basic Message chat
Actions :

  • Allow the other user to see my profile
  • Evaluate the other user
  • Send message
  • Meet ! (Maybe the business model can be based on this meet ability, we could discuss with bars, more customers for them, happy hour drinks for our users, or something like that)

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.