v2.4.0
No
no configuration
Create feelingjy_development, feelingjy_test and feelingjy_production in MySQL.
rails db:schema:load
- Stores security information of each user. Comes from the devise user model. All other user information is stored on other tables with the same id for the same underlying user. Field change should require password or email verification.
has_one user_info
- Basic information about a user. Information stored could be changed as long as
the user is logged-in. Shares same ID as its corresponding
user
. belongs_to user
has_one instructor_info
has_many consult_transactions as student
has_many attachments as attachable
- Information only for instructors. Any user that has no transaction can register
as an instructor.
instructor_info
shares many views withuser_info
. shares same ID as its correspondinguser
. belongs_to user
has_many consult_transactions as instructor
has_one private_policy as instructor
- Consult transactions links students (general
user_info
) with instructors. It also other related models such aschat
andpayment
. It has different states for its full life-cycle. belongs_to student
belongs_to instructor
has_one chat
has_one payment
- A chat contains many chat lines. Assuming not only consult transaction can have
chat lines, a chat model is created. But now a chat belongs to a transaction. It
could be redesigned to belong to a polymorphic
chattable
model. belongs_to consult_transaction
has_many chat_lines
- Not fully implemented. The
method
field is reserved as an enum for values such ascredit_card
,alipay
,wechat
, etc.external_id
is reserved for details on each of those methods by polymorphism. belongs_to consult_transaction
- A message is an off-line chat line with
attachments
. Actually the two are so similar that we could consider unifying them. There is nochat
analogy formessage
, but we can definitely have one. Currently the idea is that, a student starts contacting the instructor with message, and throughout the whole instruction. Chat is used only when they have communication in a timed period, and chat comes with voice chat. belongs_to sender
belongs_to receiver
has_many attachments as attachable
- An attachment holds metadata for an uploaded file. It is associated with an
attachable
which contains user information. Callsauthorized_by(user)
checks the ownership of this attachment. Thefile
field is filled with a file uploaded bycarrierwave
. belongs_to attachable
- Not sure if we still need it. This table keeps private policy versions so we have evidence in case of law suits or some other troubles.
belongs_to instructor
no test suit
no service
Currently MySQL is used. Make sure MySQL uses /var/run/mysqld/mysqld.sock
as
the socket connection. Change /config/database.yml
or the MySQL config so Rails
can communicate with MySQL.
To have a working HTML5 audio communication, server needs to run under HTTPS, which requires using nginx or somehing alike. Checkout this blog for more information.
Redis needs to run on production environment for Rails Channel, so we can have chat room and audio communication.
Audio communication also requires a stun server for NAT discovery. More details
here.
There are many free stun servers online (for example this Google one: stun.l.google.com:19302).
Since running one is not computationally expensive, you can also install a
turnserver and run it with -S
option.
- cap production deploy
- cap production deploy:migrate
- cap production deploy:restart