1 of 63

Frontend and Backend

{their roles and boundaries between them}

2 of 63

Introduction

01

3 of 63

About me

Johnny Seyd

years of experience in web technologies�(30 years of coding, 16 years management)��� 18 years father� 14 years consultant� 12 years entrepreneur� 8 years speaker/lector

4 years startup founder

  • hundreds of projects
  • from tiny websites
  • to huge enterprise projects
  • from large scaleup
  • to VC funded startup

4 of 63

Backend

02

5 of 63

6 of 63

7 of 63

BE as API

8 of 63

9 of 63

10 of 63

Who is the BE developer here?

11 of 63

Responsibilities of the API

System and data are manipulated only via API!

  • offers all functionalities via endpoints
  • manages the data and files
  • handles authentication & authorization
  • integrates with external services or APIs
  • responsible for database

12 of 63

What you won’t find on the backend?

“The backend is for introverts!”

  • visual design, layout, CSS, responsive design, animations
  • parallel events or waiting for user interface events
  • observables and other concepts from FE
  • UX topics, UX testing, trying more approaches at once
  • cross-browser issues & accessibility
  • long debates with the customer about functionality

13 of 63

What you can LOVE on the backend?

  • deterministic and predictable
  • straightforward program flow (“synchronous” operations)
  • focus on logic over presentation
  • focusing on algorithms and data structures
  • emphasis on performance and optimization
  • isolated functionalities - each endpoint works separately
  • easy to code review and to test

14 of 63

Frontend

03

15 of 63

16 of 63

17 of 63

18 of 63

19 of 63

20 of 63

21 of 63

FE as Web App

22 of 63

FE as Web App

23 of 63

Who is the FE developer here?

24 of 63

Responsibilities of the FE

The user sees and evaluates only the frontend!

  • to enable the use of BE functionalities (for people)
  • to be intuitive (no documentation needed)
  • to help achieve the goal (UX, responsive design, accessibility)
  • to extend the reach (PC, smartphone, refrigerator, …)
  • not to discourage and not to piss off
  • to sell the product/service

25 of 63

What you won’t find on the frontend?

“The frontend is for extroverts!”

  • database queries and data indexing and data performance
  • encryption of sensitive data
  • authentication and authorization responsibility
  • security compliance, GDPR regulatory, audit / logging
  • memory and CPU management
  • stress testing, scaling, monitoring, …

26 of 63

What you can LOVE on the frontend?

  • visible progress (instant gratification)
  • rapid prototyping and development (even without the API)
  • creating visual design (non-programming in CSS)
  • dynamic and interactive content
  • focus on user experience (UX evaluation, infinite options)
  • non-monotone work (wide variety of frameworks and tools)
  • satisfaction from user engagement (feedback, visible impact)
  • constant evolution (career flexibility)

27 of 63

04

The Boundary Between

28 of 63

Who is the Full-stack developer here?

29 of 63

Why to separate FE & BE?

  • separation of concerns
  • independent development and deployment
  • reusability of backend services
  • FE-agnostic backend / BE-agnostic frontend
  • easier testing, easier performance optimization
  • team specialization
  • less complex

30 of 63

Where is the boundary?

FE

BE

?

31 of 63

Where is the boundary?

FE

BE

API

32 of 63

Where is the boundary?

FE

BE

API

33 of 63

Where is the boundary?

FE

BE

API

code / system

code / system

doc / specification

34 of 63

What can be a bad idea

05

35 of 63

Backend-Centric API Development

  • isolated backend design, inconsistent API design
  • lack of requirement gathering, code-first mentality
  • mismatch between FE and BE expectations
  • inefficient data transfer
  • increased integration time of FE, integration issues
  • frequent changes and instability
  • overengineering, increased development time
  • API specification is auto-generated from the code

36 of 63

Frontend-Centric API Development

  • GraphQL
  • Firebase
  • improper data structure design
  • security risks
  • scalability problems
  • vendor lock
  • learning curve / crosses the line of FE responsibility

37 of 63

No King - Agree Among Yourselves

  • waiting for an impulse from the other side
  • inefficient and useless work
  • FE is waiting for complete API endpoints
  • BE is then waiting for the feedback
  • unannounced changes breaking changes of API
  • low morale and frustration
  • incomplete documentation (after all, it's in the JIRA task)
  • very low productivity, frequent changes and instability

38 of 63

What Works for Me

05

39 of 63

The Most Important Documentation

  • requirements documentation
  • functional documentation
  • system architecture
  • data models and database schemas
  • component, sequence and state diagrams
  • UI designs / screen prototypes

40 of 63

The Most Important Documentation

  • requirements documentation
  • functional documentation
  • system architecture
  • data models and database schemas
  • component, sequence and state diagrams
  • UI designs / screen prototypes
  • API documentation

41 of 63

The Most Important Documentation

  • requirements documentation
  • functional documentation
  • system architecture
  • data models and database schemas
  • component, sequence and state diagrams
  • UI designs / screen prototypes
  • API documentation (+ entity diagram)

42 of 63

Spec prepared by an Analyst

  • who has experience with systems analysis
  • who can talk to the business, to stakeholders, to FE and BE
  • who has experience with well-known standards
  • who can act quickly
  • who understands what is important and what can be changed or added later
  • who can involve other parties (or/and create tasks)

43 of 63

The Design-First Approach

Writing REST API documentation in advance.

Also known as the "design-first" approach - �helps ensure that all stakeholders have a clear understanding of the API's functionality before development begins. This approach can lead to better-designed APIs, fewer misunderstandings, and a more streamlined development process.

44 of 63

What a good API spec should contain

  • list of all endpoints (name, method, url / resource hierarchy)
  • target audience (public, authorized, roles, subroles, owners)
  • description, restrictions, constrains
  • input parameters (request: headers, path, query, payload)
  • output (response: status code, output structure, error states)
  • non-functional requirements - performance, security, encryption, compliance, logs, delete strategy… �(instructions for programmer)
  • versioning / deprecations / changes

45 of 63

Examples

request

{

response

{

{

JSON body�structure

46 of 63

Examples

47 of 63

Communication

Frontend�Developer

Backend�Developer

Analyst

(owner of the spec)

48 of 63

Why is Swagger not enough?

  • I have to code the spec in advance
  • if not, I have to update the code spec (comments) �after each spec doc change
  • I cannot discuss or suggest the changes
  • I am not the owner of the API spec
  • long time to publish changes
  • weak collaboration and sharing
  • missing instructions for BE developer

49 of 63

Useful tools and libraries

50 of 63

Mock Service Worker

/package/msw

  • Seamless: Application's code and �tests unaware of whether something �is mocked or not.
  • Deviation-free: Augment an existing API, or design it as you go when there is none and you can prototype before the real API is developed.

Frontend

51 of 63

ZOD +

  • real-time validation of�every API response
  • if something doesn’t match,�break the flow and �report to the Sentry
  • infer the static TypeScript types

/package/zod

Frontend

52 of 63

TSOA

  • rely on TypeScript type �annotations to generate �API metadata if possible
  • minimize boilerplate
  • auto-generate Swagger �documentation

/package/tsoa

Backend

53 of 63

What AI tools .. �are you using?

54 of 63

Powered by AI

???

Frontend�Developer

Backend�Developer

Analyst

(for writing the spec)

55 of 63

Summary

06

56 of 63

API Specification�is the most important document

57 of 63

Design-First Approach�with an experienced analyst

58 of 63

Understand the Other Side�don't overstep boundaries but try to help

59 of 63

Involve Useful Tools�that enable collaborative work and sharing

60 of 63

Try to get AI on Board�as soon as possible �and under any circumstances

61 of 63

FE and BE are both important�one needs the other, �cooperation is necessary

62 of 63

Q&A

07

63 of 63

THANK YOU