Using Cline to Fix Vibe Code (Slop will be a $100M) Industry
March 13, 2025
Parker dives into using Claude (Kine) to diagnose and fix a vibe-coding misstep around auth and migrations with Supabase, then walks through a practical, plan-first approach to getting back on track. It’s messy, hands-on, and shows how to tame chaos with a disciplined workflow.
The Lincoln Method in Action#
- Adopts the Abraham Lincoln principle: plan before you code. Allocate time to plan (roughly 2/3) and use the rest to execute.
- Applies this to messy dev work, especially when auth, DB migrations, and CI environments collide.
- Demonstrates how a simple planning mindset can prevent “vibe coding” chaos from spiraling.
The Challenge: Vibe Coding with Auth and DB#
- Wanted an end-to-end blog CMS integration with MDX notes, docs, and a DB, but hit barriers with:
- Migration drift between local and remote environments
- Auth flow and admin role setup
- Complex migrations piling up in the repo
- Immediate goal: test if Claude/Kine can autonomously inspect and fix a migration/auth issue, not just chat about it.
Tools in Play#
- Claude (Dev) now rebranded as Klein (Kine) for agentic task execution
- Plan → Act loop to drive the work (with real-time cost tracking)
- Local Docker-based Supabase stack to mirror remote
- Browser tools baked into the agent for live testing
- Doc rocker concept: auto-summarize and generate docs from URLs to speed up research
- Repo Mix (formerly Repo Pack): grouping migrations into manageable chunks
The Debugging Workflow (Plan, Act, Verify)#
- Start with a broad plan: identify where migrations diverge and how the auth flow is wired.
- Use Klein to:
- Inspect local vs remote migrations
- Run migrations step-by-step and monitor outputs (including costs per request)
- Update middleware to use getUser/getSession appropriately
- Replace deprecated utilities with the newer client/server patterns
- Act iteratively:
- The agent makes changes, runs migrations, tests sign-in, and logs results
- It surfaces TypeScript errors and cookie timing issues to fix
- Verify live:
- Browser-based checks for login, admin routes, and content (posts)
- Check cookies handling and SSR/CSR boundaries
- Ensure admin creation and RBAC checks are secure (only specific email can be admin)
Migration Cleanup & RBAC: Fixes Implemented#
- Diagnosed multiple identical migrations and conflicting schema changes
- Cleaned up local migrations and reset the DB state
- Consolidated migrations into a clean, single path for push
- Added guard logic to prevent overwriting existing structures
- Implemented per-user session logic via middleware (getUser + getSession)
- Created an admin path and RBAC logic so only a specific account can be elevated
- Used a “master schema” approach to avoid drift when pushing remote migrations
Code/structure notes (conceptual):
- Use CREATE TABLE IF NOT EXISTS and similar guards to prevent duplicate objects
- Implement RBAC checks in code (example pattern)
- isAdmin(user) => user.email === "me@parkerx.com"
- Consolidate migrations into a single, testable file when possible
Local Testing Flow: Admin Sign-up, Posts, Cookies#
- Started locally with a clean state to test the admin flow
- Verified sign-up flow and admin access, then tested post creation and retrieval
- Noted how cookie timing can affect session initialization; waited for cookies to be ready before use
- Confirmed admin-only paths work and that regular users cannot access admin features
Practical tip: test cookies and session timing explicitly in your local flow to avoid race conditions in auth checks.
Cost & Performance Notes#
- The plan/act workflow exposes token/compute costs in real time, which helps avoid runaway AI usage.
- Compared to Claude Code, the approach is more cost-aware and controllable, albeit more hands-on.
- The real value is not just automation, but guided, bounded automation with human oversight.
Takeaways & Practical Tips#
- Plan first, then act. Use the Lincoln ratio to stay efficient.
- Lower the barrier to entry to build sustainable habits (e.g., quick-record workflows, doc-rockers) so you actually ship.
- When dealing with migrations:
- Keep local and remote environments in sync
- Consolidate migrations to reduce duplication
- Use guards like IF NOT EXISTS to prevent destructive overwrites
- Embrace a doc-rocker approach: generate docs from research URLs to accelerate learning and consistency
- Use strict linting and governance (RBAC checks, robust policies) to prevent ad-hoc mistakes
- Treat vibe coding as a learning process; use it to build repeatable patterns rather than one-off hacks
Next Steps / Series Idea#
- This is a hands-on, uncut look at tackling real-world onboarding and maintenance work with AI-assisted tooling.
- Potential follow-ups: deeper dive into RBAC in Next.js apps, more on doc-rockers, and a clean-room guide to robust migration hygiene.
Links#
- Cline AI assistant for dev workflows
- Supabase (Postgres-backed backend)
- Next.js (App Router, server components)
- Docker (local dev environment)
- Repo Mix (migration consolidation concept)
- RBAC concepts in web apps
- Doc rocker concept for auto-generating docs from research sources
If you’ve got questions or want more detail on any step, drop a comment and I’ll expand on that part in the next update.
Transcript
hey there I'm Parker X and I led a product team for a startup from zero to $73 million sales before we exited we did go back down to about 47 and we got hammered by door Dash new breeds for a little while then after that I went all in on startups launched a couple different ideas none of them panned out every time then one of them doesn't work you know you get closer to one that does work but along the way I taught myself all the development things I need to do to be full stack using AI pretty much every day and I talk a lot about the different AI tools so this going be a different sort of video a little longer form but we're going to be using Claude what used to be called Claude uh Dev but now it's called Kine and I usually hate the idea of basically sorry this is the community that I'm running let me pull up a little drawing thing I don't like the idea of basically just like ID hopping but I think every once in a while something comes along and it's worth it so first of all everyone's always trying to get the edge right it's like you know everyone's in search of like what's the next prompt and I think that's a good thing but I also know that Vibe coding is going to produce a lot of really bad projects and we want to implement good practices of what I call the Abraham Lincoln method why him why the old president well because he always talked about if he had six hours then he'd use four of those hours for planning in his case with you know chopping down a tree and using an axe sharpening the axe and then two hours to chop so you know kind of that ratio of like two3 1/3 so in this case we always want to plan before we go and this app we're about to use to something that's pretty annoying where it involves authentication and databases so it's not just like a single page thing it's like you know it's got a DB over here and it's got you know a little lock whatever it's going to be a couple different things and this came this actually bug came out of just straight Vibe coding right I wanted to test and see like I know how to do this by hand I've done this by hand tons of times will this go autonomously and do all the work for me but it doesn't so now I want to record this as a good example of how to fix it and also test out Clyde Clyde or Clyde I think it's Clyde yeah so Clyde used to be Claude Dev and Claude Dev invented basically agentic flows what that is is it the thing that everyone flips out about where it's like you know you got your ID over here and you get your chat thing and it's where it goes and goes and goes and then you can hit yes or no they invented that they did it long before wind surf long before cursor a lot of people don't know this but they did that first it's really similar to like back in the day with like stories from Snapchat where you know snap did it first they kind of innovated and then IG and Linkedin and everybody else like Fast Fallout AKA copy so that's the similar situation that's going on here well let's just jump into it so no Cuts I'm going to basically say we have a bug on super base implementation I was writing blog posts with markdown and the actual code files using MDX files I quickly realized it would be a barrier to entry for me to write consistently I also just for context I also want to emphasize that whenever you want to build a habit you got to reduce the barrier to entry on all of it like even with me making these videos like I have to have all the stuff up so that I remind myself that I had to do the thing same thing would be with writing blog articles if I have to open up my GitHub and then open up the project and then write in MDX and then go and format it's like not the vibe but if I can build a goey where I jump in I hit a record icon and I can just talk to it and then there's a pipeline or a set of prompts behind the scenes that's basically like G to transcribe that work um and I actually have that I think that's on my website but it's human Storyteller to blog post that's an awesome prompt that you can do where basically you could tell any story about an experience and then it will try to tie that into an analogy with whatever your Niche is you're teaching so I wanted to build that into my blog but that required building a CMS so I was like okay let me build one of those and I tried to Vibe code it long story short didn't work so now we need to inspect all the superbase migrations we're running a Docker instance of it locally and we have one remote pretty sure there's migration inconsistencies between the two environments we also need to cover off which is username and password username Parker Rex actually I'm not going to do that because then you log in and I'll feel like changing it um we migrated from make it simpler this will involve middleware the existing superbase client and server utilities and yeah that's pretty much it so I'm going to copy that then I'm going to go to plan so plan was configured to use open AI one and what I want to do is also test how let's see super base actually it's gonna be like super base pretty sure they have like llm rules see running AI models it's not what's the popular thing that people are doing nowaday just so you guys know too is you know before when you go and you develop like when I started taking it seriously close to three years ago you know the and this has been forever where it's like okay I want to do some development it's really like research and development a lot of people forget about this step but you do research right it's like if I want to do what I'm about to do with superbase that's you know the back end as a service that could include off that can include Edge functions that could include a database that could include a lot of different things right and then with each one of those it's like oh are you doing RL blah blah blah so within there You' go and do research so you manually go and read all this and I still think that you need to know how this works because if you know the fundamentals then you can point it the right direction that's what I'm about to do I'm about to kind of Speed Up This research step you can even make like what would be called like a dock rocker and a dock rocker's responsibility would basically be like a couple steps where it's like fetch URL parse slash sanitize the contents which is what you're doing right you manually go and you would read a document on a URL and youd parse it in your own brain like you're not GNA look and read like footer and then You' summarize and mark down and then after that this how you had to use like this is like one step ahead of what used have to do and then I'll show you how and then you'd say use cases slash examples so that you can say like in superbase world it's like okay here's some common things that you want to do when you're setting up a database like for migration you know it'll provide you this markdown file of examples of migration so it's like okay to do it you need to do you know MPX Su base whatever it is right or migration so for this particular instance you might be doing a lot of different commands to be able to manage all this stuff that's going on and now like so we've gone from research being manual to research like where you could do a custom doc rocker and I still think that this is better if you did have a custom one I have one it's kind of pay me just an extra step right it's what I was saying earlier so now what you can do in ide we're about to do is you know you can just do an ad symbol and then give it it and then cursor obviously you have like cursor docks so you can this would be a dock and then it would show you if it's done or if it's not done and then try or whatever so if you're working on like a health integration you could give it the whoop stuff and sometimes just so you know it's better off actually to do like the index of the route so like docs for Nutro instead of like just like docs especially in superbase world like you'd want these to be like separate you wouldn't want to have like all of basis stuff because that's going to be like you know 5,000 different pages versus if you got more specific with like nextjs like this would be a better way to kind of go after it than just like because you don't care about spell you don't care about that other stuff so we're gonna try it out with this so let's go to and I guess just to wrap it sorry is a lot of companies now are coming out with files that are optimized for LM so you don't actually have to do the step where be like space lm. text and that'll be this like it'll be like the optimized version that the company officially put out such that you can get the best information out of it so we're going to try and find that um space LL and docs and I'm guessing it's not going to be infiltrated miror space tutori I saw them put this out from one of the founders not seeing it I think Twitter's down yeah wow that sucks so as Twitter down detector wow yeah they are been down for like two hours okay so we're not going to use an LM text instead we're going to do it the not the old fashioned way with the clo fashion way where I'm going to go ahead and find like I mentioned earlier the off documentation for nextjs so I'll come in here we're using server side rendering we got the guide for nextjs this make sure we're using best practices for next.js app router with server side rendering as well as client side rering and Doc here and I'm pretty sure it'll just do it I don't know if I have to do like a oh paste youl to fetch contents doing it yeah okay so let's see what it comes up with we're going to fire off this plan and you will see the magic of I want to make sure I call it the right thing it doesn't pick up in the mic okay so it is called Klein and you'll see there's some interesting stuff going on so it's telling me the context window size so it did 33,000 point6 yeah 33,600 K context window it's adding up the context now it's going through all the migrations now what I'd like to see I don't actually know the token count of the project so I think it's going in the whole project but no it's not so I don't know where it's getting this number quick way to find that out is to use I renamed it I think it's called repo mix now so I'll just do generate a repo mix file actually and I use repo mix count the number of tokens in my project sand node modules and next so it came back and you can see I had 146,000 input tokens and I have 4,000 output tokens context windows at 42k no clue how it's managing that but let's see how it's doing it let's count the refound mix don't think get to pass the flag twice or that's not so it came back with a proposed plan to ensure that it's going to compare the local schemas mean I should probably run orb sack as I told it was probably server or the uh local database can use Tik token okay I hate using ion I use a CLI tool with node or something in a JavaScript so while that's going see what it came back with oh it's already back oh that's lines of code that's not tokens whatever we're going to use pip just so we have a better understanding of how it's actually working to count all these things it's counting up some tokens probably takes a second do the same for remote that's 627,000 tokens okay had 146 in good not anymore um what I think I need to mention was I know I troubl shot this for a second before I just basically wiped all the differences so they definitely have the same on thing I think I just broke the rules because I'm asking you to go ahead and do some of the work for me but it's in plan but I just want to see how it reacts okay let's flip over to act and what's so cool is the second that I did that it's going to start going right so it's executing some commands it's checking where we're at in terms of the version numbers it got a DB status got a migration list and the whole time it's adding up the cost so you can see it's in A180 but that's because we were using a one the second that we dropped into sunet 7 or 3.7 you can see each request is like a penny 1.2 pennies just crazy so now it's going through it SE the middleware implementation sees that it's using get session instead of get user which is good because that's not supposed to be the case that was the product using CLA code and just asking for it to go oh no I got Auto approved 20 requests would you like to reset the count yeah me it definitely is a lot more cost efficient than Cloud code I know notice Cloud code will just like light your credits on fire so what I'm not doing that you should do when you're having this is actually read as it's going and I've just looked at this code already so I can kind of see as it's coming in the stuff that it should be doing because I know what it needs to do I know it needs to be reviewing all these migration files typically you wouldn't have as many these are really small things that came out of the product of doing pure you know Vibe code thing they creat a new client youtil I'm not sure why it's doing this I guess it wants to follow the best practices so I'm just going to say go ahead because I know that it was done wrong in a previous one okay go see it this is something that I've noticed a lot of LMS get wrong like see if it fixes itself they don't wait the cookie which is something that's new in next5 yep the issue is that cookies Return Of Promise cool it knows that good job no it's still not getting it okay it's adding a session updator it's adding a middleware for super base which is recommended you can see they're at $220 now so as it's going up it's also doing cash hits is helpful you'd see like all that stuff at the top left which is really nice all right what did it just do updated middleware to use the update session function for Middle util let's take a look at that see looks like this thing's deprecated but it'll still work I don't know if it picks up on that feel like it already did this what changed doing a DOT cat it's importing the cookie options I'm gonna change this yeah I'm going to change this to edit I'm going to reduce or I'm going to increase the max request to 100 yeah let's do that let's just see what happens but I'm going to be monitoring it so at any point I can hit cancel I mean this is literally the future guys what's also really cool about this is it has browser tools built in so while everyone's hand waving over the second what's it doing okay I made a login action with a server action that makes sense blon's hand waving over got make sure it does the correctly using the search prams for the message passing into login action we just Crea in the previous file which then clean up the whole thing so it's not doing it in line that makes sense that's a best practice got some typescript errors in there yeah so while everyone's hand waving over mcps which are cool this just you don't have to do anything you don't have to run a server it's just kind of doing it for me um and it will just autonomously use browser tools to open up a browser within there so yeah I feel like this is does all of it again this is the second time I'm using it in months but worked first time on something really simple and went end to end from taking a vague description of what the problem was and then solving for it and then doing browser testing in the window with actual like clicks and then logging pulling the logs checking to make sure it worked and then it's task based so it kind of pushes you to it's consolidating all the off migrations this so SI it pushes you to think in terms of tasks instead of what a lot of people do is you know they don't really realize it but they'll like just keep a a context window open forever and then they wonder why it turns to dog crap yeah so okay what is ites seem to do now let's review it while ging so how many files change made 10 file changes no nine really we made middleware changes which I knew needed to happen this mCP to Jason was already there this is when I was trying out mCP for super base which I know you can do in client too I haven't tried it it added an off Route which I want to take a look at because it looks like it is setting up the ability to receive a token hash from an email so if I were to sign up that makes sense yeah I hadn't built sign up I just said hardcoded a admin user but this is adding in support for sign up so when I sign up and I'm the person I wonder how it's going to handle admin but I'm assuming this route is so that it can catch the incoming token hash from the email such that you get the perms to then be able to log in I think the action is for obviously signing up and handling redirects to the right page admin post with CMS says I know it's using the right uh command here or whatever you want to call it got redirects yeah that makes sense and it got all the stuff right from next1 15 which is rare and I did give it the docs but still good the login page yep we removed all this trash that wasn't working like the old school get session stuff because now we have get user and we get session utility in the middleware off check doing it per session now it's doing per user that's better it's using our new client which means we probably need to clean those up but I don't love that it's using this use effect but it's okay just checking if it's an admin don't know how it's going to set if it's let's read through some of this sequel so okay create the role if it doesn't exist yeah admin Ed and viewer user rolles if it doesn't exist yes we need a Rolls table of course it's going to add R ls's because it's trained to do bad even though I hate that they definitely serve a value but when you're making quick changes they can get allow users to view their own roles yep policies is nice that it's thinking of this it's already updated in the guy sets ad for new adment now I don't know how knows if it's an set first user as okay got it so this was how I done it before how I the vibe coder did it before where I knew I was just GNA have one user because there's no one signing up and then you just want to ensure that they are admin so they can't create post and they you a little Banner at the top shows that they're in admin and obiously they get access to stuff You' got a new client yep that should just be copied pasta from the page middleware has an updator for [Music] session this is defecated yeah we need that to get fixed but okay let's just see if it'll if I close the theme that I'm using is really tough to determine what is what do I just close that okay made a nice time stamp so it's later yep solidate now moment of truth I doubt this is gonna work I think it's going to run into a migration issue wants to push it yep and then hopefully you can read this because this RL should have been if it exists or if not exists or something probably didn't have an if not exists in it so it can't overwrite it but you can see it's going through and finding that if exists add a drop okay that should work it re added it okay let's hit this now it's prompting me to hit yes violates a foreign key constraint okay now it's going to need to know to look across into the other stuff well it probably already read those so it probably has context of what it needs to do so it's doing consolidated so I try to read them and understand them and then catch them if it's not doing the right thing you're really like orchestrating right but before I move on I kind of want to see I'm gonna run this and see if it works but I will want to read read it's got another key constraint run that okay says that worked it didn't says it seems they persistent let's try a different approach summarize what we've done cool okay um what still needs to be done there were some issues so let's try this DB reset what this is doing behind the scenes if you're not familiar is it has all these containers running so this is a Docker instance or stack just a faster more elegant solution for this but it's it's basically just resetting this it looks like I still have this schem of migrations peaky I should delete the migrations schema should do and I can do that and that should free up all this crap and then I can rerun it so I'm going to do that not sure how to do that locally I guess I could stick it in the first yeah let's do that so I'm going to take this did do a lot of good things so we need to clean up our local schema migrations super base actually better yet I'm going to do it in the gooey and then I'm G to pull it back down locally so clean it up on the one that's production which is really not I mean there's like no Stakes right it's not like this is got a bunch of users on it it's a freaking block like it's like half a half a person a day so we're gonna open that up use the assistant in super base we're going to say write a SQL statement that deletes the migration history for all tables yeah yeah that's what I want to do Hey Ron Hey yeah okay cool that's not gonna work is in a tables table editor say storage no migrations okay cool see migrations so these are all the records of stuff that's gone on I'm just gonna go like this and then I'm g hit hopefully delete I want to delete I should just be able to write this by hand it's pitiful delete star from schema migration should be it syntax error oh it's because I didn't spell it right duh okay does not exist it's on the write a SQL statement to delete Bas migration because we've done all the work to make it ideally functional okay that's what it was right table dot that's I missed the dot notation so we've done all the head all the hard work be it's basically the AI did it but like gra g go in heree that run it's going to scare us we're going hit yep cool now we go back and this should be empty this cool and then we want to run a pole so this should be a clean State we do pull over right our local stuff so now I want to actually run it against this one which we probably do how would we do this locally how do we do that or our local BB without running a SQL client example I want to do it I CLR with a [Applause] JavaScript because I don't have like a table editor running I need to get creative I guess a reset would do that let's just [Music] try yeah we're gonna we're going to do this this seems better so let's write a little let's create a little file and script like all this crap is done by different AI great so we'll do reset migration. JS boom We paste that in there that already grab all my stuff and then we should just run it with a node I not found what what not I have that unless I got to pull this off screen because I don't want you to see my environment variables yeah that's where it is I just didn't have the next St back duh now we got a syntax thing now let's make this MJS B Keys required um I think it's just an environment things sorry about that just can't have you seeing all the secrets all I need to service different than the a nonan yeah I think it is service roll I got to grab that that's in our settings somewhere go now let's try it like this very we don't have un locally let's just see we're going to do a super Bas tv reset if we solve this issue which we do we're going to take this skip we're going to just feed it into ah yeah let's do it and we're going to take this same promp and I'm going to it here can I need the tasp I wonder I just did that all this jumping around I probably could have just put it there see yeah I can see that I tried to do something new I don't know what I'm going to title this video it's basically like a lesson in what vibe coding can do then how to get out of it by there's something in between right it's like the Lincoln thing I mentioned earlier think is the move this could all be avoided with just some level of planning instead of like eight different ways of doing the same thing see it's not trying to read a file but seems to be having some trouble oh cool it printed out the vs code open tab really want to keep going so we're gonna grab this I get a new file we're going to paste that in there we're going to grab so we're giving it all this contexts which is here's the output when we try to reset the local database we've already heill or r a SQL statement to delete the migrations uh scheme of migration so what we need to do next to the database context so what we've done so far and then I want to put initial problem to solve I'll grab whatever you only put up here so let's take all this put in a new one fresh window we're going to do how many minutes we' been going let's see 45 minutes holy smokes well anyone that uses nextjs typescript react Tailwind super base AKA like 90% of developers they should find this pretty pretty helpful all right bl's proposed plan to fix the data man configurations sure all work properly gather the information seems fine seems like it might be a little redundant no that makes sense yeah because we do want it to delete anything that we don't need so I'll flip it over to act and I'm so tempted to click on this mccp server than op whoa this is cool I'm hoping that didn't get rid of all the stuff that's going on but this could be really awesome where you could call fir crawl which does what I was talking about earlier it's basically a really popular Library I guess not that pop 527 but it'll go and it'll take a URL as an input and then do the Scrapy summarizing thing that I kind of Drew out earlier it's like a doc rocker in a box okay so what is this thing trying to do trying to do something done so it is stating that there's multiple migrations that are trying to create the same objects I knew it yep okay bunch of redundant things cool it's now doing something it's getting dup at entries got it recent migrations deletes it's not being used properly it's going to update that then remove remove the bad ones multiple versions so did analysis updated this we want to compare it no we don't it's updating its plan it's kind of cool a new script did that make it executable yep turn off should be good because it follow all it in the previous session migration issue is clear okay good guide to fix migration issues so it's made its own guide and now it's making a script that'll clean it all up for itself it's basically the janitor all a script to verify off cool read me on how to fix it but I wanted to fix it let close this out I wonder if it's just feeding itself plan so that it will then follow it analyze it yeah but I want you to fix it so it gave me scripts and it gave me docs that didn't do itd um just just follow its instructions who cool what did that do all deletion attempts failed did back this up to the history so that I'll do it it did work so that's funny it's logging I didn't trust it's logging because it it fixed it problem nice that was a cool way of doing it see I would have never known how to do that ever so that's awesome and then let's see what this verify Off Script does okay so it passes as far as yep and then it makes a client and then run command doesn't look like it's me use but verify all those so that's good console log select see if there's any user roles if there's n log it if there are some say there's a table should actually check if the off is good now there's an abmin user so yeah let's let's run that one this is good news this means all this stuff work that oh that's right because we deleted it okay so let's push this up um do super DB push yes oh Garb set right maybe I can either go one by one and fix these or I can go and nuke everything but I'm gonna just see subscri we want to do type if not exists do if not exists add if not exists a statement and this is not the recommended way of doing this like ideally you never got yourself in the situation to begin with but prime example of the vibe code thing so we're going to do that we're going to open up another one for this yeah sure fine that's for the add post logs save we're going to close this because we don't need it and to close all of them actually we're just going to top to bottom and this one we're going to do this and we're going to do that then we're going to open a new one we're just putting a guard in place basically so that none of these fail and we can eliminate that as a reason why something wouldn't be working and the reason it matters like we put this if not exists in there because we had to do some pretty Extreme Measures to fix things up AKA like Nuke the history so when it goes and it tries to recreate this from scratch with like all these migration files that I have locally then the database is like yo I already have all this stuff but by putting in if not exists and it does a check it's like okay it's not trying to like overwrite it or anything it's just one of those semantic things with o um we got what like three left then we're going to run it it's going to be good and I'm going to say toal because I go e just Lally eating a giant die cook right ouch not the best thing one more now when we run a push this should should friendly this is like the magic this is the thing that cleaned it up and that script is the one that deleted through the trash out yes syntax error of course we added a syntax error so subscriber status we'll just pop that in there and needed a wrap it in executable got another one of those subscribers cre all see not exists drop that in there I will say that Cloud's not as good at writing SQL as it is at writing typescript so what I would generally do is I well first of all I won't do any of this but I would be using wins so that you don't have this issue let's go down let's go up to 37 tax oh no I know we're going to rip all the policies out because policies suck that'll fix us so policies poliy there and all seems fine enable HTTP extension basically lets you like I was I wanted to fire me a text message when certain thing happen um this is an edge function that handles that triggers for new signups uh po Imes back dating posts shouldn't have anys ay ay so let's just Shar policy and we want it to use oh that's the back up back up back up back up back up okay so now what again we got nothing okay TR see that does it's funny it's just going to go ping pong e all right I'm going to eat something and then come back and fix this intermission all right after a short break I had an epiphany I needed some food so what we're going to do to UNF this which again should never happen but it does happen is there's this thing called repo mix formally repo pack and what we're going to do is we're going to pack up all the different migration files in here we can Target that by the route so then we can feed it to one file right so it's like basically hey I'm done with the mess that was created let's target this set of files and then put it all in one and then give that combo file to an LM to fix an easier way like actually probably fastest way is I'm just going to make one called master or aitor schema.sql and what I'll do is I'm going to grab all these right so okay that's add a Cascade yeah so turns out I should probably just be using here let's go there try and run it again Tada okay trust super base got to cut Okay so it turns out I just tried a bunch of stuff I'll probably cut it I said I'm not going to cut anything but that would have been the most B thing on the planet to watch so I know I wouldn't watch it because I tried to do a meta prompt for a SQL expert when I probably should have just used the super base assistant so anyways now we have a clean set and we're going to do a super base TV push and that's going to push up remote migrations not found in local migrations directory make sure you I don't want the to be any migration that's the issue so I deleted all those thought that we pull those out so let's go in database migrations oh so some of these came through so what we'll do is we'll scroll up and we're gonna just do a we need to delete these again so because I just don't want them there you know this whole mess was created by using dumb so we're going to come back into the SQL editor we're g to open this up oh we already have it there so let's just run this boom run the query cool now when I push this up we're GNA have one file called a knit and it's going to contain everything it just ran awesome that means we're good to go that took a while we have all these in here I have all the Rosses undone and so last up is I actually need to verify how Klein did this so let's open up a new one we already did verify that it's synced cool now I want to see I'm going to do a a plan and I'm G to ask how does actually for this use case I have a bunch of I think three credits through here so I'm going to say Scout project and explain how an admin get signed up there should only be one admin user I don't allow anyone else to become an admin user you can only become an admin user if your email is me at Parker x.com so that's me just doing rbac or role based authentication check are you sure that's what it means see then I'll do files and folders I think I can do codebase so I want to add code base and that should use sonnet's thinking model and I want to make sure I'm not making stuff up what does what does the term rbac stand for in web development World base Access Control close in the meantime I'm going to push up these changes actually I'm going to run it locally because we have the local setup running we have yeah all this is running locally that's first part of the video that you're going to be watching so we don't see that um doesn't automatically explicitly assigned okay so I could probably just do this in the database that' be the fastest way but let's just make sure that it runs um won't be able to check the datab bit yeah okay so I'll go here make sure that I have no cookies so it should be compiling yep compiling 6 seconds it's kind of slow but it was the first time been a little while so I'm going to go into applications and cookies there should be nothing in here like before I start testing if there was something in here that's how off Works where basically when you go to any website you're going to see a bunch of cookies in it if I came into super base and I right clicked and I go to cookies this is how it works where this thing in here if I clicked on it then you'd have access to my entire account which I don't want to give you but if I wanted to I could click that and then I could take that cookie out and I could actually use that to send requests to do things so that's your ticket to to access so now I'm running this locally I should be able to scroll to the bottom and click on admin and then I should be able to sign up H let's see users always registered got it so let's see my password is the issue okay so I'm technically logged in and I got routed to I'm in 4posts so question is where the heck are the posts it looks like is it doing something something's going up what about if I go into block there any pieces of content in here okay so we can tell that it got fed this stuff what it didn't do is it didn't build oh it did this big old Loop did like 70,000 gets so the good thing is as we got it so let's uh let's just wrap this by fixing this issue so we can see all of our blog posts and we will successfully tested out client for a real use case so I'm going to grab me check a local host 54321 that's for no route 54323 yeah this is how you R locally are view the thing if I go into authentication I should see my user oh it's seated with that that's not right we should pull that out of the SE so let me see I can use this for it so how we need to modify our SQL migration so that the user is created with email and password not GitHub we've removed GitHub so I had some falsy sieg info Al say use the same password yeah it's off cool just checking it out we would want to then I don't know if you can do two instances of time in an editor that's kind of nice that actually should we add new columns yeah we should well all I'm going to do next is I'm going to just go in and then tell it what the password is and then I will run an instance of Klein take the console output so all that stuff that was going on we actually saw this earlier in the video where looking down at the screen where it's like okay on login cookies should be waited before using its value that's probably why it took a second when it was going because it root forc its way through it's not a breaking issue but we want basically when you're using these and this should have been an excellent example of what not to do and then how to fix the kind of vibe code SL slop that's created but you want to use really strict linting so having biome highly recommend that with really strict rules and any other ones like using like the next kind of es lint would be really good too because then you can get the rules that are really really specific and the more contacts that we can give client the better I think this is the money like after this session like I know it was really long but it's uncut it's how it actually is it's how you guys will run into issues how you can deal with them you know it is clear to me that this is the one that has the most control it's a little bit more advanced the fact that I can do plan then act and have it go back into the context I like that I like that it doesn't have to be CLI and I like that I can know what the cost is because when I'm using Cloud code I can rip through like it it'll do a really good job on like the UI side of things but Cloud code did cause a lot of these issues where I just wanted to see what it would do see if it could fix some of the sequel issues that we're running into but because I had it in Yolo mode it just recursively said oh man it's not fixed let's crank out a new one and a new one and a new one when we started the session with Cloud code that caused this I had two or three SQL files by the end of it I had 17 SQL files you didn't even see all of them I had like six different node like JS scripts that I was trying to use like it was all over the place so I don't think it's Cloud coat's fault it is ultimately my fault because I didn't guide it better but that's why I think um I'm just GNA keep making videos like this where this will be the start of a series where I just do an hour of raw coding on something that I already need to do but to kind of build it in public alongside the daily updates so that you guys can see how someone in the field is doing contracted work which is what I need to go do now I need to do some Outreach for that but how someone's actually doing it because I know this is content that I'd want to see like I don't know two three years ago where it's just raw and it's not someone that's been in the field for like 15 years so it should be a little bit more approachable if you guys if you guys have any questions just drop them below I'm more than happy i' be super grateful to get a question or a comment this is a really new channel and if not I'll see you tomorrow thanks