DEV Community

Cover image for Week 2 – Core Setup, TDD, and Starting Auth
himanshu negi
himanshu negi

Posted on

Week 2 – Core Setup, TDD, and Starting Auth

This week I continued building my project and focused on getting some important foundations in place.

Core Setup

For this week, I focused on setting up the core section of my project. This part of the app will handle things that are needed across different components like exceptions, utils, and pagination. The main reason I wanted to get this right from the start is because, in one of my previous projects, I handled exceptions differently in the backend and frontend, and it created a lot of confusion and chaos. So this time, I decided to keep everything consistent from the very beginning.

Learning TDD

While researching more about Django, I also learned about Test Driven Development (TDD) and realized how useful it can be. Usually, I would write tests after the project is already working, but I noticed that it can lead to biased testing where you only test what you see. This makes it easy to miss edge cases. Writing tests first gives a clear goal and makes planning the structure much easier.

My thoughts on unit testing so far are that they can be really helpful, especially on larger projects. Once you create them, they keep checking the same things throughout development and can help catch bugs early.

Starting Authentication

I also started working on authentication since I already decided to use Clerk. I read through the Clerk SDK documentation, which is very well written. I found a simple video on Clerk and Django integration that helped me understand the setup better.

I also decided to use an abstract base class for my user model. It might be overkill, but I liked the idea of including only the fields I need. During this, I also learned more in depth about mixins and JWT.

GitHub Link

If you want to check the project, here’s the GitHub link:
https://github.com/negihimanshu015/Tenguin

This week was mostly foundation work, but I’m happy with the progress. I’ll continue building and share more updates next week.


Photo by Markus Spiske on Unsplash

Top comments (0)