Hated everyone.
They share.
And in this video we're going to discuss about the file structure as well as the models, especially
the user model.
The file structure that we are going to be using is going to look exactly same as we discussed.
The only difference is we will be having approaches as well as index or JS.
So instead of slash, they both will be present in our application.
You can skip it.
There is no such big hurdle there.
We have already discussed that part in the earlier section.
We'll be having all of this except the seeds.
We don't want to have seeds that much of the data to be pushed in.
But still, I will walk you through as a basic overview that how this can be worked, it's really simple.
Just connect the database, fetch some values, and that set apart from that.
All of the files, all of the folders are going to be needed by us.
So we will be creating that in a minute.
Now, let's go ahead and talk about the structure that we'll be having.
The first and the most important part of building any application is to decide that how the models is
going to be there.
Now, these kinds of structures definitely happens first on pen and paper, not on these tools, and
then it moves on to these tools.
Then it moves on to some something like Mood Modeler or any kind of other database modeler.
It helps us to actually visualize it much, much better and also give us some of the scripts which is
not required.
We rarely use them, but it's always a good approach in case you are designing things professionally,
to have the tools and access something like Mood Modeler or any other database modeler that you can
have.
Since we don't have it, we have to work through with the basics of it.
So in this one, we are going to first work on with the user model itself.
So I don't want any of that.
So I'll just start.
Okay, let's get rid of that.
So again, I told you how to bring up this mind map already discussed about that part.
So let's go ahead and have a simple mind map up here.
So this is going to be our e-comm app.
And with this e-comm app, the first thing is we're going to be working on is simply the models itself.
So let me go ahead and come on, don't do this.
Let me go ahead and try to do this again.
Okay.
So this one is going to be E app or e-commerce application.
I think I need to zoom in.
Yeah, that is much better now.
Okay.
Yeah.
This is much better.
And definitely I need to fix the spelling up here.
So e com app, which is an e commerce app.
Now, again, we can have more things up here.
There can be controllers and routes and all of that.
Right now we are discussing all about is the models itself.
So let's go ahead and see that how the models are going to look like.
Now, we obviously will have a whole lot of models working on and definitely in the future you can add
more.
But at this point of time, all I'm working on is the user model.
So how the user model is going to look like a couple of interesting fact.
We have already discussed these.
One, we are going to call all of them as with the capital first uppercase letter, but it is not required.
You have already read in the documentation that when it goes in the database it is going to call us
users all lowercase but further down the road.
I really want to work on that.
How this entire application is going to be having this user.
The whole thing is really simple.
If somebody registered on your on your website, what do you expect him what kind of data are you expecting
him to collect from him?
So let's go ahead and add a simple note up here.
I usually put up better designs up here, but let's just say we're going to be putting up some nodes
up here.
Okay.
So how this is going to look like, I obviously will ask him for the name right now.
At this point, I'm not worried about is it going to be string if he doesn't bust on me the name, what
kind of error message I'll be giving it?
No, I don't.
I don't care about them at this point of time.
Later on I surely do.
So I obviously want to grab email.
I want to also set the password.
Yes, I know things are coming to a mind that OC password needs to be encrypted.
We are going to use hashes.
Yes, we will all do that, but not right now.
This is not a point where you actually worried about that.
And we are also going to have a photo from the user.
Now, we have already figured out that we are going to be using Cloud Native for having the photos,
but it's exactly the same if you want to throw them up on Firebase or a Cloud wherever you like.
And from further down the road, we will keep this photo as a simple object.
So I just kind of put an object up here that in the photo I'll be storing the URL or the secure URL,
of course, and the unique ID that cloud native gives me.
So these are the two things I'll worry on that.
In fact, I can write it down here, so it's going to be ID and secure you URL.
So these are the two things that I will be having it up here.
Okay.
So can I stretch it?
I guess?
No.
Okay.
So these are the two things that I'll be having for this photo.
Let me bring them on to the next line.
There we go.
So what else you are going to need up here?
We are also going to work on roles.
What are these roles?
So there will be a regular user who can come onto your application and buy this stuff there.
There is also going to be admin user who will get an access to the dashboard where he can just create
new products, see all the users in this dashboard and maybe in the future you might want to inject
a manager level role as well.
And manager may be able to see only just the orders in the dashboard.
So there is going to be a security perspective based on the role.
So we're going to study that part as well.
And with all of the all of the models that we're going to create, there is going to be property which
is going to be created at.
So this is going to be something as soon as you make a new entry in the database, that time will be
logged into the database.
That at this point of time, this entry was created in the database.
Regardless, it can be product, it can be user, or it can be anything.
Now that's it.
That's all we are going to be doing it totally.
It's really simple.
You can definitely add more information once you are done with the course.
Not right now.
And this is all are we all done with this model, which is a user model?
Not precisely.
Not right now, because there is going to be another video where we are going to have a small talk about
this user model.
So we'll come back there.
Now, next step is how we're going to design the product, and that is going to be a little bit more
involved compared to this one.
So let's go ahead, move on to the next video and see that how we are going to model our product.