Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- spinlister
- ------
- Well, they have toomany thins to handel they are currently working on next level which allow geolocation of bike(current when it is in use)
- and i found a letest concept by them to rent in loop with their smart lock protection ....
- Let's Talk about Technology stack, i am not sute what they are using but if i have to build i will select something like this....
- -----------------------------------------------------------------------------------------------------------------------------
- PLSql or MongoDB
- JQuery
- Nginx 1.7.12
- Ruby on Rails
- Ruby
- react.js or anguler.js
- Google Analytics
- Handlebars
- Moment.js
- Underscore.js
- Welll, They have server with ip: 104.25.16.12
- city: San Francisco
- Country: US
- Host/Organization/ISP: cloudflare
- last update on 30/01/2017 at around 23 o'clock
- open ports: 80, 443, 2082, 2083, 2086-87, 8080, 8443, 8880
- Let's talk about task(The database)
- ------------------------------------
- For building this application i will use "devise" and "cancancan" for simple user authorization and access
- Second, for location "geolocation" is best fit
- ...............................................
- This prototype need some models like USER, RIDE, RESERVATION, PHOTO and COMMENTS...
- Lets start with model and their relations.....
- (i am going to define their relation as rails style...)
- (inn this task, i am trying to write some validation and some function to show you my rails knowledge)
- 1.User
- ------
- class User < ActiveRecord::Base
- devise :database_authenticatable, :registerable,
- :recoverable, :rememberable, :trackable, :validatable,
- :omniauthable #by default function from devise
- validates :fullname, length: {maximum: 50}, presence: true
- has_many :rides
- has_many :reservations
- has_many :comments
- # we can add some omni-auth futures in it like login with facebook and google and funcution will like
- def self.from_omniauth(auth)
- user = User.where(email: auth.info.email).first
- if user
- return user
- else
- where(provider: auth.provider, uid: auth.uid).first_or_create do |user|
- user.fullname = auth.info.name
- user.provider = auth.provider
- user.uid = auth.uid
- user.email = auth.info.email
- user.image = auth.info.image
- user.password = Devise.friendly_token[0, 20]
- end
- end
- end
- end
- 2.ride
- ------
- class Ride < ActiveRecord::Base
- belongs_to :user
- has_many :photos
- has_many :reservations
- has_many :comments
- geocoded_by :address
- # If address is updated, geocode will generate a new set of latitude and longitude
- after_validation :geocode, if: :address_changed?
- validates :home_type, :room_type, :accomodate, :bedroom, :bathroom, :listing_name, :summary, :address, presence: true
- validates :listing_name, length: {maximum: 50}
- validates :summary, length: {maximum: 500}
- end
- 3.Reservation
- ------------
- class Reservation < ActiveRecord::Base
- belongs_to :user
- belongs_to :ride
- end
- 4.Photo
- --------
- class Photo < ActiveRecord::Base #here we can use many gem like paperclip or carrerway probebaly mt spelling are worng
- belongs_to :rides
- has_attached_file :image, styles: { medium: "300x300>", thumb: "100x100>" }
- validates_attachment_content_type :image
- end
- 5.comment(Feedback)
- ---------
- class Comment < ActiveRecord::Base
- belongs_to :rides
- belongs_to :users
- ## now all relationship are shown here
- Now Some points
- ---------------
- -- using cancanan we add some fields to specify them as HOST, ADMIN and CLIENTS
- and provide them a service like it ...
- -- I will use UX as like First page is a searching page to find a room and reserve ir and after it
- they wil pay using paypal, braintree or stripe like service provider ##i didn't made table of it but it will relate to reservation and use both from many to many associations
- -- i didn't introduce delay_job module for confirmation instruction mail from devise..
- --- till their is to many tables need for notification, discounts and other functionality,however, their is a table for coupons as well
- But most part of this application is searching ...
- in ruby many gem we have we can use "ransack", "acts_as_bookable", :elestic search" and many more but i recommend to make it by ourself for a better result, because this kind of app are alwase reliable on their search...
- --chat for host and clients
- -- well according to my search in spinlister they are going to provide their own service of bikes, in which they provide bike with geolocation and a smart lock
- Geolocation and smartlock--
- -------------------------
- if we have to inpliments this kind of things we have to make some api for geolocation tracking and password system for smart lock.
- smart lock need a separet api with high data encryption
- well we can build a lock bye own and with geolocation it will cost us around 25-35 USD, if all components can essly avilableil
- well if you going to china for this think and specific bord for smartlock and geolocation wich will cost you less
- basically we need ardino for it simple implimentation and sometimes we need python or embedded C to programme it
- basically smartlock is just a IOT module
- --- if yu are looking for servse like this you have to wait for a long time because their are many micro services we need to impliments
- ---- if you are looking for more on smartlocks i can made another document for it (smartlock and bluetooth)
- In this Task i didn't specifed field of data base because they are almost same as airbnb
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement