So I am now in charge of a website that runs on mongodb and angular.js. Guy who wrote it for the friends of mine is a no good cokehead who when he was getting low on prozzy and coke money would log in and break shit so they would have to ring him for "support". twat.
Thing is, I have no fucking clue what I'm doing. What I've managed so far is...resurrect the site, get the shopping cart working, change the search bar to be case insensitive (because no fucker capitalises the first word in a search bar), and a few other things I won't bore you with. To be honest, I'm amazed I'm winging it this far.
Googling is becoming tiresome though for mongodb. They all show examples of code snippets you have to run instead of mongo shell commands (well most of them).
The issue is half the reason the search is a massive pile of wank is all the products are labelled stupidly. This would be a simple fix if I knew how to edit the fuckers, but as I said I have no clue what the FUCK I am doing.
Anyone know any good resources for a mongodb crash course? Or just how the fuck you edit database entries? Yeah I know that last one is requesting spoonfeeding, just a decent crash course would be very very helpful.
>>25629 Nah. I know the guy, and I've heard he's got miffed when he's discovered he's locked out of the server. He doesn't know it's me who's done it yet though. If I call him up it's a dead giveaway. He's quite a lot bigger than me. Also I won't be able to stop myself from railing at his retarded API choices. I mean come on, using regex for the search in a way that only one word works when there's a module specifically for multiple word text strings? Why would you ever do this?
>>25633 Who/how does it handle payments? Thats the first thing I would want to understand. What level of PCI is it. That dictates how/what you have to concentrate understanding first in the stack. People love MongoDB but it has a reputation for being careless, others compare it to snapchat for your data.
>>25634 >Who/how does it handle payments?
Paypal. That bit is sorted.
>What level of PCI is it.
*Insert joke about me not having access to the server motherboard as it's remote*. Sorry I don't understand what you mean by PCI here.
>People love MongoDB but it has a reputation for being careless, others compare it to snapchat for your data.
Oh wonderful.
>>25636 > Well the first thing to do is swap mongodb for MySQL.
I wouldn't know how to convert the database over. It would be a case of "now you have two problems".
I've never really done anything database related before. It's all been html/php, bash scripting or Spectrum BASIC.
Mongo is absolutely the wrong tool for an e-commerce platform. It's a stupidly fast object store, but it barely counts as a database. Performing the most basic query is difficult and computationally expensive. Unless you're literally Amazon, Mongo is all downside and no benefit. OP appears to be hopelessly out of his depth, but his client really needs to transition to Postgres.
Angular is an equally poor choice. It's great for big, complicated single-page apps, but it's totally the wrong tool for an e-commerce platform. A traditional MVC framework like Rails would be a far better choice. It seems that the previous developer used whatever was getting hype on HN, not the best tools for the job.
>>25640 >but his client really needs to transition to Postgres.
This was kind of what I was getting at. It's all well and good suggesting that the OP needs to get that shit onto a relational system if the system being recommended is useless. Postgres has its quirks but is pretty solid. I really can't understand why anyone still uses MySQL for anything serious. Maybe things have moved on, but when I was looking at it support for full-text indexing was pants, transactions were broken, replication was a complete shitshow, and if you accepted the default configuration it was liable to just swallow your data when you weren't looking. Pretty much the only saving grace was how easy it was to dump the database and restore the dump into an empty one.
>>25640 >It seems that the previous developer used whatever was getting hype on HN, not the best tools for the job.
The further I get into this project, the more apparent this becomes.
I went to check on the site today and it was lagging like fuck. Restarted the node app and it was fine. Now, he had set it up with some weird module that mimics cron, so if it ever went down it's supposed to restart it. Thing is it gets laggy as fuck after a few days, unlike cron which has been around since the seventies, and is coded properly.
Ripped out that bit and replaced it with a bash script and now it works as it should.
Why the fuck would you use something to replace cron? Just why? Rage ticked.
>>25686 It got me up to speed enough to be able to edit database entries so I could fix the crappy search, and I now know enough to add new products to the inventory. Can't complain.
Continuing to get away with it lads. Every time a new problem is put in front of me I say "Of course I can do that, I'll have it done by X time" when what I'm thinking is "How the fuck am I going to do this by X time?!". Haven't missed a deadline once.
>>25693 I had some advice from a fairly successful entrepreneur which was to do exactly what you're doing. Companies will ask him or his business if they can do something and they just say yes then just work out how to. Seems a bit obvious in retrospect.
>>25694 Yes, I'm going to take this approach in the future. It makes sense.
Well, the work is pretty much finished (I've finally blown through the budget they had set aside for the e-commerce side of things). I knew this was coming up soon so was a nice bloke and wrote a load of scripts for the server to look after itself, do daily checks for load problems and sort it if so, and a bunch of other stuff the last guy didn't do like make sure the server/database sets itself up again if it has to be rebooted.
There's some talk of work being thrown my way regarding the promotions/sales aspect of it, with a nice (20%) commission on any sales. Which I suspect they will need, because the site doesn't even show up in google yet if you google the website name. I'm pretty good with SEO as well, and they know this.
First "proper" tech job I've had, and I fell into it by accident. Perfect work for me, think I might look into doing this more.
At my work people hate our CEO. He comes into the office, tells us to do something, and everyone starts complaining that what he's asking is impossible, and of course he ignores this and says do it anyway.
Usually it turns out that he's actually right, it is possible and gets done on time.