Day 59: Fried Brains Redux…

Today was a tad uglier than yesterday. Thankfully, I didn’t feel like such an idiot, as some of our issues were communal. Everyone was having issues with their Nav Bar changing back to a “logged out” status when one clicked onto another page link. The trick was, believe it or not, to NOT do that. We ended up putting in click events for the links rather than hrefs, so that the components switched out, rather than the entire page reloading every time (which was wiping out the user authentication).

Right now, I’m struggling with the edit user page. Whenever I have issues with a page, it’s usually with any type of PUT request. I know it’s not the server, as I’ve tested that ad nauseum with Postman. If this were JavaScript and not Angular/Typescript, I’d be done by now! Not that I’m resentful…One of the other idiot things I’m struggling with is how to hide or show a DIV. With jQuery, it would be a no-brainer. One might say…I’D BE DONE BY NOW!!!

As I’m completely fried this evening, I took a break and have been knitting. I’m so brain-dead that I’ve been constantly checking the pattern, as I’m afraid of doing the wrong thing…AND several rows into this, I discovered that I did do something wrong. I forgot to put in a buttonhole! Guess who’s going to need to learn how to make an Elizabeth Zimmermann “afterthought buttonhole”?

This will have to wait until I figure out make the damned edit user page edit a damned user…preferably the correct user…

Day 58: We have liftoff!

Today was the official beginning of our final project, using our Capstone pages, our server from the last project, and Angular. Despite my misgivings, things are going well so far! I tested my server changes, after getting rid of the page renderings, and everything checked out. I’ve been doing what our instructor suggested and approaching things one step at a time. I created the client and I did the easy stuff. I copied in each component that used to be a “handlebar,” set up routing, and fired up the pages, one by one–just to make sure they appeared. They didn’t have functionality yet, of course, but they did show up! I was DYING to bring in the patterns page, too, but that’s going to be a nice-to-have, if I can get the other pages working in time. I also have a Team Details page that would be fantastic to get working by the Tuesday Noon deadline, but that one is really on the “I want a pony” wishlist…

This evening, I managed to get the code done for the Leagues and Users data. I even managed to add code to do a loop to dynamically create the Leagues list on the home page! I may have to do some googling to figure out how to bring in the Teams data, seeing as that has member data as a subset of the teams data. I’m happy with what I’ve accomplished so far, though.

Day 57: Serving It Up

This was one of those days where everything went wrong. I dropped my smoothie getting out the door, I faced horrendous traffic getting into class, and I spilled what was left of my smoothie all over myself.

And then there was Angular.

We’ve had only three days of Angular instruction, and now we’re being let loose to modify our sites to use this for our final project. We also found out today that since we are no longer using Handlebars or JavaScript for our site, we need to jettison all client-side JavaScript and handlebar pages to make way for Typescript and components. We have to get rid of any routers or controllers for former Handlebar pages in the server code. This poses a bit of an issue for me. Everything in my server was set up by—you guessed it—pages! I set up routes by pages, and under the route and controller scripts I had code for each page, with the different CRUD operations for the page under this, which in turn had service code script files. I know it sounds odd, but it worked. This afternoon, I had to reorganize it all by the files we’re using and their CRUD (pun intended). I have to admit that this is a cleaner way of doing it, but it took ages to set up. I had a few false starts, but the server finally fired up at 4:45. I still need to employ the dreaded Postman to test it tomorrow.

On a humorous note, this evening I met with my fellow IIBA members. I’m technically no longer a BA but I’m still a member of IIBA, as I’m an officer and my term isn’t up for a year and a half. I recently swapped duties with another officer, so I needed to meet with her and other people to show them all how to send out notices for chapter events and how to update the website. Overall, it went well, and I think they understood things.

When we got all done, I realized they were all staring at me.

“What?” I asked. (Was it my breath?)

“You…you…you’re beginning to…”

“Yes?”

“It’s…uncanny!”

“What?”

I couldn’t figure what they were driving at.

Finally, someone blurted it out.

“You sound like a…DEVELOPER!” They all nodded in unison.

“Yeah, it’s really weird.”

Someone else piped up, “And you actually SWORE!”

Honestly, I’m sort of proud.

Day 56: Breaking it down…

After my little adventure last night where I almost permanently hosed my server, I decided to leave well enough alone for now and just go with the pages I’ve rendered so far. If we’re going to have to rewrite pages in Angular, I’d just as soon not have too much to convert. I do want to work on eventually converting them all, so that I can practice different types of server routing…Oh my God…I really AM turning into a nerd…

Today’s deeper dive into Angular was a bit better than yesterday, although I’m still not sure HOW we’re going to pull off rewriting our pages. I’ve been reading ahead and it STILL looks confusing. I’m hoping that as we go along it will become clearer. I get the concept of breaking things (the partials and views we have now) into components, but we’re launching into another round of divding things up further into routes, components, and providers (services). We did a few of these today and I STILL have no idea how to determine what goes into which type of file.

In other more exciting news, I believe I’ve figured out how to vary my nav bar using Handlebar conditions, depending on whether a user is logged in or not. My next step is to figure out how to pull this off for users who are admins, so that other users (a.k.a. the unwashed public) aren’t privy to the admin link.

Actually, after last night’s adventure, my next step is to go to bed!

Day 55: Angular-ing for a clue…

When you google or bing the word “Angular” in a browser, you return:

“Angular is a TypeScript-based open-source web application framework…”

OR

“Angular Cheilitis is a condition that causes red, swollen patches in the corners of your mouth…” I’ll spare you the details, except to say that, yes, this can be caused by a fungus, or as I like to call it, a “fungus amungus.”

The second definition, pertaining to festering sores, is a MUCH better descripton of my entire day attempting to understand Angular. For our final project we are going to have to convert our Handlebar pages into this format, along with our code. I’m hoping to have some sort of clue in the next few days, because right now, I have NO idea how I’m going to do this for my Capstone pages.

Speaking of my pages, I took leave of my senses this evening and attempted to have the server render yet another Capstone page–the Edit Team Details page. I’m over and above where I need to be for activating pages, but I just HAD to try one more…I’ve spent the last 3 hours of my life (that I’m never getting back again) attempting to do a PUT request that hitherto worked just FINE with the old server. I screwed everything up so badly I had to wipe out the entire folder, clone the code from my GitHub Repo again, and reinstall the npm packages.

I think I need to quit for the evening, before I break anything else…

Day 54: Reprieve…

I’m not sure what divine intervention occurred today, but our instructor pushed out the due date. Instead of having to have our entire server done by 5:00 Friday, he extended the deadline to Saturday at 5:00 p.m…THEN he left the room, came back in, and declared that he didn’t care when it was done, as long as it was done so that it would work with our final Angular project.

I spent most of the day working on router/controller/services again, but with our instructor’s help, I finally managed to understand how to apply it to my existing connections. Anything else wrong was idiotic typos or case-sensitive issues. My personal favorite catastrophe was the “looping” server. All of a sudden, my console started spewing out “get JSON 404 over and over and OVER again. I tried commenting out code and taking out scripts, thinking they were the culprit. Come to find out, it was due to having the Node server debugger still open.

As of Friday afternoon, I STILL wasn’t done. Even though the due date has been pushed out, I’m going to work on the rest this weekend, so that I’m ready for learning Angular on Monday. I need to clean up the code, make sure pages validate, add comments, copy over the Postman tests, and pull out any unnecessary console.log troubleshooting code.

ALSO, I was so proud of myself for finishing the edit user profile page, but at the end of the day I realized that I had completely forgot to enact the delete function. Oops…

If I have time, I may try to render more pages. We only have to go as far as the landing page, but my site makes no sense without at least having the crocheting and knitting patterns page, too!

Day 53: Does Not Compute…

In a “slight” schedule change, Friday’s project, for the entire bloody capstone server, which was due Sunday at 5:00 p.m., is now due TOMORROW at 5:00 p.m. Our instructor has an overly-optimistic view of how long this is going to take us—I believe he estimates six hours (I was still in shock of having to be done by tomorrow, so I forget the exact amount). I’m guessing he’s basing this on how long it might take HIM. In our case, we worked well over that amount of time today and I think I speak for many when I say I’m still confused. Granted, we don’t have to render all the pages or all the info, but it took me ages to just figure out how to make a PostgreSQL file from our JSON file.

The good news is that I managed get, post, put, and delete for the PostgreSQL file (insert your own “CRUD” joke here). I also managed to render my pages. However, I’m still struggling over the damn Router, Controller, and Services thing and how to apply this to non-PostgreSQL files. I’ve been trying for hours at home now and can’t figure it out. I’ve googled, done the damned debugger, but I keep getting some idiot Postman message saying “Cannot read property ‘end’ of undefined” for my services js. code for leagues. May I pause here to say that I’m REALLY beginning to hate the ****ing Postman…When I had the league code under just Router and Controller it worked fine.

There’s so way in hell im going to have this done by tomorrow. As it is, I don’t even have the edit user profile page done yet (which is a new page), or the rerouting to landing page/home page, depending on whether someone is logged in. AGAIN, this was working just fine until I had to break up the code into router/controller/services. Now I have no clue where to put this code.

Not that I’m resentful…

Day 52: MySQL…the Sequel…ize

Today we continued our MySQL adventure with something called “Sequelize” which honestly sounds like a Star Trek term—as in, “Mr. Sulu, sequelize the photon torpedoes!” It also sounds like something done with movie franchises that are well past their prime (“Rocky XIX,” anyone?). The entertaining thing is that autocorrect is coming up with all sorts of naughty words for Sequelize—especially if you initially spell it wrong.

Sequelize is an ORM (object-relational mapping) which we used for MySQL. This is also used for something called PostgreSQL, and yes, I think our instructor is just making stuff up now. All kidding aside, PostgreSQL seems to be very similar to Oracle tables, so I’m sure this will be beneficial to understand when I eventually return to our department.

The thing that’s giving me a coronary is that we need to learn all this stuff, at the rate of one major concept per day, and then APPLY IT TO THE CAPSTONE. I just barely have my routes operational from our last lab, and even so, my pages are not what one might call “functional,” except for the ones that applied to the requirements of the lab. To top it off, we now have to divide everything into routes, controllers, services, models…and I know I’m forgetting something. This is supposed to make the code easier to maintain, but honestly, if you can’t FIND anything, how much simpler is it??? I already get confused about which code is server code vs. client code. This is going to send me running screaming into the night…oh, right. We live in the boonies and THIS is what’s out there:

I’ll have to take my chances with the scary code…

Day 51: Oh, CRUD…

Today we learned all about MySQL. This was FINALLY something I knew something about. As a BA and previously as a developer, I’ve worked extensively with SQL. The most complicated part of this was installing MySQL Workbench. We mainly created files and performed CRUD—create, read, update, and delete. This was a bit tricky as applied to our new server friends POST, GET, PUT, and DELETE.

“PGPD” doesn’t have quite the same ring as “CRUD,” does it?

There was more work with Postman, as we determined if our routes worked. I had some nasty, nasty, ugly, angry red messages spewing furiously from the command prompt window every time I attempted the “U” in CRUD. It turned out to be something stupid. I’d put “post” instead of “put” when referring back to the db_queries.js. After that was fixed, everything worked fine.

In other news, we had to fill out a survey about our training. Our answers are going to be made into “cards” for our new department, so that they can get to know us better. This is absolutely HILARIOUS in my case, as my “new” department is going to be my old department, and they already know all about me. I felt sort of idiotic when under “fun facts about me” I said that “I knit and crochet!” My department is going to take one look at this and say, “Well, DUH!!!” Then they’re going to laugh until they snort in a decided undignified manner.

We also had to come up with a quote. This is one of my favorites, by W.H. Auden:

“You owe it to all of us to get on with what you’re good at.”

Precisely why I decided to attend Code Academy.

Day 50: Getting My Kicks…

…not exactly on Route 66…

As I mentioned last time, I did get our two assigned labs done. HOWEVER, I’m evidently insane, because I went nuts today and decided to try to convert my entire capstone project into our newly-learned Node Express hbs page format with routes and partials. I did manage to get all my pages to render, but as far as functionality…this was sort of hit-or-miss. The simple files were easy to create routes for. However, one of our databases has team info and then member info under each team, which is proving tricky to try to create routes for. I tried to check our original capstone server code to see if I could try to figure out how to crack the code (so to speak). At about 6:00 p.m. I finally created one “team-by-league” route which now makes my team page fully functional! I’m hoping to be able to figure out the other team/member routes.

The other issue is that my original capstone code relied heavily on URLParams. Now that we’re using routes I need to figure out a way to pass data to the member pages (add/delete/edit). I tried session storage, which I’d hoped would be the magic bullet, and indeed it was—for team data. For the member data underneath the team it was a fiasco. The code loops through all the members of a team and then stores the data for the LAST member in session storage. When you click an icon to go to a member’s edit or member delete pages, you land on the LAST person’s pages, no matter who you pick. I need to figure out how to pass the team ID and member ID to grab member data using yet another route (which you know is going to be convoluted).

Well, tomorrow is another day!

Chuck Berry – Get Your Kicks on Route 66