june23's avatar

Is my e-commerce backend api mid level work or senior level work?

I was on LinkedIn the other day, and posted my project from Github and asked for a code review. Someone left a comment saying, "I'd say it leans mid level to me... add scoped auth, tests, and rate limits.", now it's great, but I started to wonder did he mean if I add what he asked me (scoped auth, tests, rate limiting) it would elevate from junior to mid or if I add what he asked me (scoped auth, tests, rate limiting) would it elevate from mid to senior level work, so basically, if I add what he told me to add, would that make it mid level work or senior level work, I'm confused. Here is my Github project https://github.com/programmer92-ctrl/e-commerce-laravel-backend-api. I tried asking for clarification from the person who told me to begin with, but he never responded back. So now I am asking here. Please can anyone help me?

1 like
18 replies
martinbean's avatar

@june23 Why do you keep asking questions like this? There isn’t some magic code you can write that will instantly make you “mid” or “senior”. It’s a natural progression.

1 like
june23's avatar

@martinbean I'll keep that in mind. But I was asking for a code review is all, just wanting to see what level I am at.

1 like
jlrdw's avatar

When having to ask, it wouldn't be senior yet.

1 like
june23's avatar

@jlrdw Okay that's good to know! Thank you for your feedback. So then is it considered junior level work or mid level work if it isn't senior level work yet?

1 like
ian_h's avatar

Being Junior/Mid/Senior or higher isn't just about code that's written.. there's a whole landscape that should be considered also.

It's all about experience, real world experience. What happens when the shit hits the fan? How do you deal with things in this scenario? How would you go about debugging an issue in production that might not show up in Staging or local, for example?

Writing code is the easy part.. especially in this day and age where there's so much reference available (be that good or bad), but there's no way you can post a single, very simple API and expect to be rated as mid or senior. I've worked with people in the past who have been writing PHP (and other languages) for a decade.. yet I would class them more a "veteran" than a "senior"... likewise, I've also worked with people who have only been in the real world for a couple of years and have shown far more seniority in regards to being an engineer with their code, ethics, overall knowledge and understanding of more than just the lines they wrote.

It's why there are interview questions which accompany a tech test (normally, anyway) for a job... it's not all about the code you submit whether you'd be considered for a particular position within an engineering team.

2 likes
june23's avatar

@ian_h How would I make it more complex? What is missing? I'm not sure, what you mean. Can you explain?

Is it missing things like Security (MISP + The Hive + Apache Metron), Monitoring software like New Relic or Datadog, Circuit breakers, Bulk heads, Timeouts, Back Pressure, Cache, Queues, an Architecture like SOA or Microservices or N-Tier, Cloud computing IaC like AWS CloudFormation IAM, Load Balancers, Auto-Scaling, CI/CD like Jenkins Bamboo Circle CI, Ansible Chef Puppet, SonarQube, Code coverage tools, Static Code Analysis tools, Docker, Kubernetes Apache Mesos Docker Swarm, JMeter, NFR's, Unit Tests, IPS/IDS like Snort, etc... the list can go and on

I am trying to understand why my API is "simple". I am trying to understand, do you mean my "business logic" is simple?

ian_h's avatar

Wow! I was going to write some smart answer... but I think the simplest response to that is:

There rests the case for the defense, m'lord.

1 like
june23's avatar

@ian_h So is all of the above correct? If I add what I stated in my last reply, will that make it more complex?

ian_h's avatar

Yup.. good plan and very thorough list. Applying that list to your API will certainly show future employers that you're senior(+) and worth the big bucks!

Good luck with your career 🙂

2 likes
Tray2's avatar

I think you need to take a look at your api routes file.

There are a few mistakes in it, I will not tell you which lines but I will give you hints.

  1. Why do you have a /user route, and if you need it, why is it outside the auth:sanctum group?
  2. Be aware that routed with wildcards will match more than what you expect. Route::get('posts/{posts} also matches Route::get('posts/all'} so the second one need to be before the on with the wildcard.
  3. You should only use the restful verbs in your controllers index, show, 'create, store, update, and destroy.
  4. You should name your routes as well, that way it's easier to reference them. Route::get('posts', [PostController::class, 'index')->name('posts.index');
  5. You should remove unused imports like Cart and Request
  6. There seems to be missing a few routes for showing the login, register forms, and forgotten password.

And you should get into the practice of writing tests.

2 likes
june23's avatar

@tray2 Okay I will fix the api routes file. Thank you for your feedback!

vincent15000's avatar

It's not with a simple code that I could say you are a junior, mid or senior dev.

It's related to your experience and also how you organize and architecture a whole project and not only the code itself.

What I have seen in your code (not read all the code) :

  • the validation rules shoult be in a form request and not in the controller
  • you don't check if the authenticated user is authorized to do each action in the controller (create, store, edit, update, delete), that means that any authenticated user is able to delete any model even if he isn't authorized to
  • you could use API resources for the responses in your controllers
  • you could use implicit model binding to retrieve the model in the update and delete functions
  • you don't return any HTTP code with your API responses
  • you don't have written any test to check if your code is ok
  • your code is not homogeneous, sometimes you are using form requests, for example sometimes your are using validation directly in the controller
  • ...

Some of these items should'nt be forgotten by a mid and senior dev, especially as it concerns security / authorization to access datas.

If you have any question, don't hesitate.

V

1 like

Please or to participate in this conversation.