How to (approach) building user profiles / areas - angularjs

**edit: I realise this is a somewhat general post, I am merely looking for some guidance, examples etc.
I have just set out with the goal of (self)learning some deeper web development and have started with Angularjs. I have realised that I learn better when building towards a set project.
With that in mind, I set out to build a relatively simple web app where by users (mainly aimed at Professional chefs) can log in, access their profiles /user area. Users can then add items to a food ingredient database which may include variables such as weight, quantity,price etc. They can then add recipes, drawing from the ingredient database, with the app returning their food cost, tax breakdown as well other predefined calculations.
I have already built the bare bones of the application with Angularjs handling He various front end routes and layout.
I have wired the app to use Firebase for the purposes of User authentication and registration components.
As I mentioned, I am mostly self learning and I'd like some pointers on how to implement a user profile area with Angularjs, using Firebase as the back-end database.
I'd like to achieve the following:
after user login, direct to a user specific page
The user page/area should have abilities such as: profile photo upload, change email, change password etc (usual user operations)
Once the above is achieved:
seperate pages where users can add to their database of ingredients
seperate page where users can create recipes utilising database items, returning cost breakdown etc.
The user operations page / area is my main concern for the moment.
Thanks in advance.

Related

How to show selective UI features?

I have a UI that needs to either show icons on a timeline view or not based on user profile. How can I show for some users and not for others? For example : the Sports Admin team needs to see the scores of all teams over time in the view (showing all years visually) but the players (when they login to the same web app) only see the timeline view with their team's performance over the years (not other details for a particular year). How can I achieve this? I am using Angular JS and javascript
I have looked into role based SSO login and show selectively and also cookies. My goal is faster performance - meaning the page needs to load fast.
I was able to find a solution for the problem above that we have been facing. After many design sessions, the best approach was to have a "User Settings" link that would save the preferences at a backend database per user id that's already captured via SSO login. The backend returns data based on the user settings as the queries to get data from backend are now made dynamic to take the selections from User Settings into account while querying the backend. As a result the front end shows data specific to user.
Tested this and seems to work perfectly without any affecting any page load performance whatsoever.

Firebase Realtime array populate div

Okay so I’m need guidance on where to start.
What I want to do is upon clicking a button in my web app which will be labelled “search” the web app will connect to my realism database and search the data base for the “search criteria” and the once found all matching cases it will create div blocks with the information inside it, in a list view and assign the ID of the div to the UID it gets back from the database.
database:
Users
--> Country
---->State
----->City
------>Post/ZipCode
------->UID
--------> Users informantion
Welcome to StackOverflow!
A great place to get started is the Firebase Realtime Database doocumentation or searching for Firecasts on YouTube (linked below).
As requested, here are some questions to ask yourself to get started and help scope out and define your new Firebase project.
What language are you going to use?
Are you planning on using any frameworks/libraries? e.g. For Javascript, these would include things like jQuery, Polymer, and React
What information are you storing in your database? e.g. user profiles, private user data/settings, public indexes, username lists, etc.
How is your database structured?
What data is being searched? The entire database? Values in a certain location?
What data needs to be displayed in your view?
Is the data accessible for just the current user or is it a public database that anyone can use?
What search criteria will be used? Is it just one filter at a time or many?
The answers to these questions aren't set in stone, but are to help you start thinking about the future of your project. They can be changed at any time as this isn't SQL where everything has to have its own schema.
If you intend on using "advanced searches" where you'll filter by multiple parameters at the same time, consider using Cloud Firestore instead.
I recommend looking at some Firecasts to help guide you through these questions. Here are some links to them:
Firebase YouTube Channel
Video: Getting Started with the Firebase Realtime Database on the Web
Playlist: Firebase on the Web

2 apps with the same database in Firebase

My project is to create an app similar to Uber.
There are 2 APPs, one for partners and the other for clients and I saw that I can create more than one app within the same Firebase project,that way I can use the same database for both APPs.
What I did not understand, how to do is differentiate the partners and the clients?
In the "Auth" menu, I would have to differentiate them with a Boolean.
Can I do this using Firebase? If not, does anyone know show me another way to do? or another database?
Another question I have is in relation to part of the payment, How I store the data of the credit card at Firebase? It support for this? Does anyone know show me a library to make payments straight through the app?
I don't think you can do that from the "Auth" Menu. This "Auth" function is only there for the sole purpose of letting user signup and login to your app.
You just need to implement the user category in your Real time database.
Store the user's uID, with key:value "userType":"client" or "userType":"partner".
And whenever the associated uID logs into your app succesfully. you need to read from the Real Time database to determine whether this user is a "client" or "partner" and show the appropriate functionality accordingly (or direct them to a different View controller eg: ClientViewController / PartnerViewController). Or if you have 2 entirely separate apps. Then this can act as a verification, just to make sure if this user is indeed a partner / client.
I'm not sure what to do with the payment system. But you can look at library like Braintree or something.

Firebase Data Structuring

we are building two Ionic apps at the startup I work for. We saw the benefit of rapid development that Firebase offers and we decided to use it as our backend. We are building hotel booking apps for users (people that want to search and book hotels) and for the hotels so that they can manage their bookings. The first app for the users is done and we have all our data and authentication rules stored at a Firebase Data URL. We are about to start building the second app meant for the hotels and we have some serious questions:
Should we use the same Firebase Data URL for the hotel app or should we create another one? If we use the same Firebase Data URL, that means data for the hotels and the users will be mixed and the URL will handle authentication for the entities.
Please we would really appreciate your input and opinions on best practices on how to do this. Thank you.
There's no reason why you cannot use the same URL
myHotelAppRootNode
Users
someUser
someUser
Hotels
someHotel
someHotel
Then set up the rules to restrict access.
We have data and users in the same url in our beta app and it's not causing any mixing of data; as long as the rules are correct (which can be a bit challenging).
Using two URL's may slightly uncomplicate the rules per, but then you have multiple authentication points since it's two URL's. So say, once a user authenticated with a single URL model, they would then have access to hotel data directly whereas with two you have to auth them once, and then the app would need to auth them again to the second URL.

Accessing All Sharepoint 2010 User Profiles

I'm attempting to iterate through all User Profiles in SharePoint 2010 from a Silverlight application that will be added to a SharePoint page. Based on what I've learned, the User Profile Service is different than the SharePoint Website's store of a list of users who are "members" of the site or have ever visited it. To get that list of users, see this question.
I know about the asmx web service that SharePoint 2010 provides at mysite.com/_vti_bin/UserProfileService.asmx, but that doesn't seem to have anything like a GetAllUserProfiles method. The closest it looks like I can get is by iterating through all users with successive calls to the GetUserProfileByIndex method, but that's far from optimal.
Is there a way to access User Profiles via a built-in Sharepoint 2010 REST-ful service, such as what's provided for site links at mysite.com/_vti_bin/listdata.svc/Links? If not, what approach do you recommend to get all existing User Profiles in SharePoint 2010?
EDIT:
The purpose of this is to provide summary profile information in the Silverlight control. For example, showing the User Profiles that have the most "Interests" set in their profile. This task is only possible by iterating through all User Profiles.
Are you sure you want to do this through a web service? Getting all links for a user means 20 simple urls. Getting all user profiles means 20,000 large complex objects.
Iterating through all profiles is something I have done in import code, but outside of that I can't think of a scenario where it wouldn't make more sense to use search - especially when user interaction is involved.

Resources