I use angular client and express/mongodb server for my website. I need to implement a location picker.
Here is a demo.
http://plnkr.co/edit/a3KlK8dKH3wwiiksDSn2?p=preview
I need to store users address in my database. I dont want to store the entire complex object as it would be very tedious. (see the screenshot)
I need to be able to suggest friends nearby, same street, or same city, same state etc.
If i store the formatted_address, it's easy to save, but hard to get the relationship between 2 places. e.g. 2 user may enter the following 2 addresses.
Santa Monica, CA, USA
California, USA
So what information should I save?
Related
I'm looking for a way to store data for a Google Assistant action for all devices/users in a household, without requiring voice matching to identify a user.
I know you can store data in user.storage, but I don't necessarily want to require voice matching to link to a user, and if I use user.storage the data will only be associated with one user. I just want anyone on any of the devices (Google Home) in the household to be able to use the data persisted in the action.
One approach could be to obtain the device ID (if possible) when setting up the action and store the data by device ID. Then link all other devices in the household by device ID through the list of devices associated with the original user's account (if that's possible). Any other options?
This is currently not possible, there's no way to save data and have everyone in the household access it. I'm sure you've already seen the documentation on Save Data in a Conversation.
On shared devices like Smart Displays and Speakers, personal results are turned off by default. They can be enabled again following these instructions:
Open Assistant settings on your Android phone
Select device in "Assistant devices"
Turn Personal results on.
But this means other household members can see personal results, e.g. Calendar entries.
To determine if you will be able to use userStorage, you can use the recently launched GUEST/VERIFIED flag, see documentation here.
User storage is designed to work at a user-only level. If you don't have something like voice match setup, user storage will not persist. The best approach to having family or multi-person data sharing would be to use something like Google Sign-In to get their email, and then have a companion service like a website where users can share access with other emails. Then your service can pull from a common data source.
I see several SaaS companies, such as bitrix have different top level domains by country ex:
bitrix.de for germany
bitrix.in for india etc.
A lot of times this is required because of legal requirements that the data generated in Germany should stay within the EU/German data center, and vice versa same for India.
My queries
To achieve the above, there would be 1 database + 1 App Server in India, and a similar 1 database + App server for Germany also?
What should happen if a user created an account on bitrix.in ie in the Indian database, and then he goes and tries to accidentally log in to bitrix.com, should such a login go through or should I tell the user that he is on the wrong site?
Tx
You can create a central database for storing meta data - accounts, logins, etc. This could be common/shared across all countries/domains or it could be separate in each database but replicated at a central meta database.
Now when someone logs in, after authentication (using the central meta database) you can redirect them to the appropriate domain.
In such a configuration when creating a new user you will have to ensure that the user is unique across all domains/databases.
I am creating an application that will track user locations and create incident tickets related to this information. Therefore I have the following setup
Basic Setup
iPhone App: Tracking user location (lat, long) and reverse geocode the information
Server: Database for saving incident tickets including the location information
I am struggling now with the “right way” to save location information for tracking users and incidents. The flow should be as follows:
Intended Approach
Tickets being created should be persistently saved with the information given, like lat, long, address so I see a table of incidents that happened
The geo information should be efficiently handled in terms of reverse geocoding, as I thought about caching the address and lat,long info, which could possibly not allowed to google TOS
Application / Server Workflow
Iphone App User hits a button and executes a POST request sending lat/lng to the server
Server system creates a ticket associated to this request and saves this ticket info in a table called incidents
The challenge I am facing now, is how to handle the management of location data correctly, like the address information. As I want to use reverse geocoding to get the street name associated with the latitude and longitude information, I could use the Reverse Geolocation service on the iPhone or GoogleMaps API. The first question I am having is:
Question 1)
Should I reverse geocode on the iPhone and send the address info via POST request to the server as well and save the info in a table?
Question 2)
Should I only sent lat/lng information and do reverse geocoding on the server before I save the data to the database
The next step I am struggling with is, how to efficiently save the data in the database, considering database normalisation.
Currently whats happening on the server is:
Create incident
When the server receives the POST request coming from the app, an incident ticket is being created and saved to the table incidents
The user lat/lng posted to the server from the app will be used to attach this info to the ticket entry to be saved in the database
So the current table format is:
incidents (id, incident_reference, address_id, latitude, longitude)
Now I do not know where to save the corresponding reverse geocoded information (address)
Question 3)
Should this information be saved with the ticket info itself? I see challenges there, as I would create redundant information
So the current table format would be:
incidents (id, incident_reference, latitude, longitude, street_name)
Therefore I could use the reverse geocode info I receive from the iPhone app directly to save it directly to the incidents table. But wouldn’t that be a bad practice though? I think I would create multiple times the same address information, which would not be good in terms of database normalisation? It somehow does not look like a good idea….
To find a solution, I thought about creating a separate address table with the following table setup:
incidents (id, incident_reference, address_id, latitude, longitude)
addresses (address_id, latitude, longitude, street_name)
Question 4)
Using this approach I would imagine, that I could then cache the already received reversed geocode info, to save it in the database and query my table addresses next time for an existing address. The challenge i see here is, that there would be possibly never the exact same latitude/longitude so I would have duplicate address entries with different lat/lng information in the table.
Q1: No, leave that to the server, to reduce the impact on the iPhone (bandwidth usage, battery usage)
Q2: See Q1
Q3: see comment
Q4: what is your question? Are lat/lon the same for different incidents on the same address? I very much doubt it.
New user so I can't post images. Image link provided below:
http://i.stack.imgur.com/EXf0G.jpg
This is for a walk-in booking system not an online reservation system.
Normal Booking scenario:
User/Member gives information to receptionist. Users can book up to a month in-advance.
Receptionist searches user/member info. Receptionist must be logged in to search user/member or make a booking.
if details are found the booking continues as normal, if not user details are added to the users file.
Booking time/date/type is then checked for availability. If available then a booking is made.
Extra:
There are two types of staff account 'normal-user' (Receptionist) and 'admin' (Manager).
Manager can reset staff account passwords and create new staff accounts.
Manager can edit session details on the timetable (time, date, type) etc. Do i need a timetable class here??
In order to answer that, we would need a much more developed specification.
I would suggest you develop with what you have, meeting only the minimum requirements for each iteration. Then, if you find your users need a timetable of some sort, then add it at that point.
In general, don't add more complexity than you need until you know you need it. The more moving parts a system has, the harder it is to maintain and use and to put together in the first place. Get the application up and functioning and in the users' hands. Until you get real feedback from them, you are just taking stabs in the dark. Let the users' tell you what they need and want.
I have created a website using modx evolution v1.0.2.
The website that I have developed has 12 different types of users (categorized in groups). Each user will be shown a different price depending on the group to which he belongs.
Till now I have been able to fetch the group name of current logged in user (created a snippet for that), but how can I achieve the above mentioned functionality so that each user should be able to see only the price that I have coded according to his group.
For example:
If a user is associated with the 'ocassional' group then he should be shown the price as , say, 50 bucks
and if a user is associated with the 'regular' group then he should be shown the price as, say, 40 bucks
I can easily do this by coding a single snippet for every product's variant, but there are a lot of variants (more than 100 and growing).
I have created a resource(page) for every product and it's variant. Every variant has a price. It is this price that I want to be shown according to the logged in user group membership.
I hope I am able to explain my query clearly.
Please help me do this functionality.
Thanks
I'm not really convinced that modx (as much as i love it) is a great solution for e-commerce sites.
However, the best solution might be to use the database to store the prices of variants per user group and retrieve them yourself using a snippet.