Skip to content

Backend Research

atakemin edited this page May 14, 2025 · 1 revision

API FRAMEWORKS RESEARCH (see the related issue)

1. Django REST

Key Features:

  • Built-in authentication (OAuth2, JWT) and permission handling.
  • Built-in API browsing
  • Integrates tightly with Django ORM
  • Automatic API documentation generation tools

Pros:

  • Quick set up and fast development cycles
  • Ease of use for CRUD-heavy operations
  • Simplified database design due to ORM

Cons:

  • Tightly coupled to Django.

Sample Code:

from rest_framework.views import APIView
from rest_framework.response import Response

class HelloWorld(APIView):
    def get(self, request):
        return Response({"message": "Hello, world!"})

2. Spring Boot

Key Features:

  • Auto-configuration: Attemps to automatically configure the application based on dependencies.
  • Excellent dependency management
  • Built-in metrics, and health checks.

Pros:

  • Highly scalable for large enterprise applications
  • Strong type safety (due to Java)
  • Excellent tooling support (IDEs)

Cons:

  • Verbose compared to Python
  • More boilerplate and configuration.

Sample Code:

@RestController
public class HelloController {
    @GetMapping("/hello")
    public String hello() {
        return "Hello, world!";
    }
}

Final Decision on API Framework

We have used Django due to its simplicity and lightweight setup. It also have great support for PostgreSQL, offering seamless integration through its ORM.

DATABASE RESEARCH (see the related issue)

The report on MySQL vs PostgreSQL

  • Both MySQL and PostgreSQL are implementations of SQL. Syntactically, they are almost identical. Despite this, many consider PostgreSQL to be a more advanced database than MySQL — while MySQL is easier, has a lower barrier to entry, and greater levels of adoption. ( GPT does not agree with this, here is its answer when I ask him about the ease of these platforms: 'Not really. Both are about equally easy (or hard) to learn at the beginner level. The real difference comes later, as your app grows and you need more from your database.' )

  • PostgreSQL is an object-based relational database rather than just a relational database, and many of its advanced features relate to this. However, many developers and analysts will never need these advanced features.

  • MySQL is a purely relational database. PostgreSQL, on the other hand, is an object-relational database. This means that in PostgreSQL, you can store data as objects with properties. Objects are a common data type in many programming languages like Java and .NET. Objects support paradigms like parent-child relationships and inheritance. ( I believe this could be crucial for us.)

  • MySQL is more suitable for beginners and has a shorter learning curve. It takes less time to build a new database project from scratch. It’s simple to set up MySQL as a standalone product or bundle it with other web development technologies like the LAMP stack.

  • Since you're learning, planning for growth, and might deal with some evolving data structures (e.g., tracking challenges and logs), PostgreSQL gives you more flexibility and room to grow without complexity.

Resources

Udemy Blog

Amazon Blog

ChatGPT

Final Decision on Database

We have decided to go with PostgreSQL due to its integration with other frameworks and its OOP properties.

TESTING TOOLS RESEARCH (see the related issue)

This project uses a modern and robust testing stack to ensure the quality and reliability of the Django REST API. Below is a summary of the testing tools integrated or recommended for use.


🔹 Core Testing Tools

A powerful, expressive, and widely adopted test runner for Python. Offers clean syntax, powerful fixtures, and a rich plugin ecosystem.

Enables smooth integration of pytest with Django projects. Handles test databases, Django settings, and ORM access seamlessly.

Includes:

  • APITestCase: Extends Django's TestCase with API-specific assertions.
  • APIClient: A client that simulates HTTP requests to DRF views, including full routing, authentication, and middleware support.

pytest-drf (optional)

Provides test layering and structural organization for DRF views, serializers, and endpoints in pytest style. Useful for large codebases.


🔹 Test Data Factories

A fixtures replacement tool that generates valid model instances using factory patterns. Works with Django ORM and Faker.

Integrates factory_boy with pytest, turning factories into fixtures (user, post, etc.) for clean and reusable test data.


🔹 Mocking & Stubbing Tools

Mocks out calls made via the requests library, enabling you to test API integrations without hitting real external services.

Built-in Python library for patching and mocking objects, functions, or methods. Useful for isolating logic and mocking internal dependencies.


🔹 Code Coverage

Provides test coverage reports when running pytest. Supports terminal, HTML, XML, and fail-under thresholds.

pytest --cov=your_app --cov-report=term-missing

Final Decision on Test Tool

We have decided to use pytest.

Labs

Team Members

Weekly Reports

Ahmet Okta
Barathan Aslan
Berke Kartal
Mehmet Çağlar Kurt
Mehmet Emin Atak
Muhammet Berkay Keskin
Mustafa Taha Söylemez
Nilsu Tüysüz
Selman Akman
Ömer Faruk Bayram

Meetings

Milestones

Templates

Research on Git

Projects

Project Resources

Software Design Diagrams

Documentation(Manuals & Research Doc)

CMPE352 Archive

Projects

Project Resources

Software Design Diagrams

Documentation(Manuals & Research Doc)



Documentation(Individual Contributions and/or Milestone Report)

Individual Contributions

Meeting Notes

Clone this wiki locally