- Read Tutorial
- Watch Guide Video
What we need to do now is get in this feature where we can move it. We also want to display the correct numbers and have it display this as selected
when it is, which we can only do if we have an ID
.
We can only do any of these things if we have an ID or if we have an object. We have to have actual request objects. Now, that's going to be done with the actual data we get from server, instead of hard-coding in a ton of dummy data.
What I want to do is just dive right into the back-end, and getting the back-end stuff from our server that I've built. We are going to have to start with creating items
because we don't have any items to deal with. I already have one item in my database.
So make sure you have Mongo running. I'll walk you through that one more time, and just make sure you get it running. Then we will start on that in the next video. I'm just going to close out all of my Mongo instances.
Now, what we want to do is make sure in our server. We cloned this a while back, the prop-management-server
. Make sure you have Mongo installed, and then to get it started up all we have to do is type in mongo
. Let's open up a new window and type in mongod
.
I already have it running. I haven't restarted my computer, so the DBpath
is in use. Just make sure you run mongod
in Mongo
. Now, what we can do is control our database here in the Mongo tab. We typed in mongo
, so we can say stuff like db.users.count()
.
First, we have say PROP_DEV
, so we're using that database. Now, this database is going to generate for you because of the code I've written that's for the server. What you want to do is say db.users.count()
, and this will show you all of your users.
We're going to have quite a few, because when we develop the sign in
and sign up
features we were creating them left and right. You'll see that I have 11
users. You'll probably have somewhere around that too, unless you used the same one every single time somehow.
When we were creating the Create Account feature, we made quite a few users. We're also going to have access to newsletters
. I have 1
, and we're going to have access to requests
. There's a good chance that this isn't working for a lot of you, especially if you're in the classroom right now.
Now, what you have to do is just make sure you get Mongo
running, get the server running, and it's o the Github
. I will pull that up over time just so you know exactly where it is on GitHub. I'm going to go to my profile, so you're going to want to search my profile.
If you go to GittHub, and search Maxnelson997
and you're going to see is old repo I made forever ago. What you want to do is click on users
and then click on Maxnelson997
. What you want to do is find my server. Go into repositories and it should be called nodeserver
.
Go to nodeserver, and this is the repo. Make sure you get this running. Make sure you get Mongo installed on your system and running. Make sure you can do all this. You're probably going to have it running by now if you got past the sign and sign up feature, because it was required that we did that.
Once you have that set up, which you probably already do, you should be able to run db.users.count()
. If you have 0
, go and create a user. The way you do that is by going into localhost:3000
. We built this feature out. Just hit not a member
and register. Create a user. We built that out, so you can do that.
Then you should have users in your database. What we want to focus on is requests
. In the next video, what we want to do is implement the new request feature. This is going to require a little bit of front-end coding because we haven't really built out the form for it.
It's not letting me sign in, probably because the server is not running. If you can't sign in, make sure you run npm run dev
on the prop-management-server, and then we should be able to log in. Then go ahead and go to requests.
Basically, what we want to do in the next video is create our new request feature. We're going to do a little bit of refactoring and get that functional in the next couple of videos. We didn't change anything in our code. I'll see you in the next video.