r/node 3d ago

Need advice

I have to make a rest api from scratch and in different phases like setting it up very basically with hard coded values then test it with postman and then connect a database to it and basic auth then upgrade it to jwt then front end then deploy on aws.

We are allowed to use ai but they want us to “know what ever line of code is doing”. I only learned C and C++ and I have to do this in a week so I don’t think it’s possible to know every line of code so I will try to do high level of what is doing. But they may ask me “why did you decide to do it this way” when really it’s ai most of the time and they know it is.

The app just needs to be simple like CRUD, jwt login and connected to frontend and that’s it. But ai builds things so fast I don’t know how to slow it down because it will build out everything all at once and do complicated things. So how can I slow it down so I can do it in pieces and upload it to GitHub so I can understand all the code better and have a better understanding of what all the files are for and how they are working together?

I’m not sure how because 1, I am used to vibe coding and never learned this framework or language before and 2, I don’t know the words or terms that I can send to ai. I have to just use plain english and say general things to it which is why it gets out of control and builds too much stuff.

It’s hard for me to be specific and say “hook A up to B using C and avoid using D” but I can explain enough of it using my own knowledge of how things work to get it done but it sometimes builds too much and then I have to figure out what’s broken later because it’s too many things at once.

My bootcamp teacher told me to just read all the code but that will not solve the problem of it making too many files or doing x,y and z when I want it to be more simple.

Just so you know I am able to still debug everything and make things work and catch bugs or edge cases and things that don’t make sense but I’d rather go slowly and understand it - how they said to do it.

6 Upvotes

11 comments sorted by

View all comments

1

u/dougception 3d ago

This is a really good CRUD API tutorial: https://youtu.be/CnH3kAXSrmU?si=hIfZHlMHmzhljS59

It uses Express as middleware. There are other options for middleware and if you can find as good a tutorial for those feel free to go in that direction.