Open Source & Free

16. The 'New Post' Form

Module 13: Creating a Facebook Clone The post composer is where the Facebook clone stops being a read-mostly app and becomes participatory. Even in this first simplified version, that changes the feel of the whole product. The form is intentionally scoped to text-first posting, and that is the right call. Images, video, and richer media behavior can come later. The important step here is establishing the composer as its own screen with clear identity, visibility controls, and a way to preview different post styles. ...

Codename One

17. Spring Boot Server Architecture and the User Entity

Module 13: Creating a Facebook Clone Up to this point the Facebook clone has been living on a mock server boundary. This lesson starts building the real backend behind that boundary, and it does so in the right order: architecture first, then the first entity. ...

Codename One

18. Media Entity

Module 13: Creating a Facebook Clone A social app quickly runs into the question of where media should live. This lesson answers that by introducing a dedicated media entity instead of burying file data inside unrelated objects. That is the right first step regardless of whether the actual bytes stay in the database forever. Separating media into its own entity means the application can reason about uploads, ownership, visibility, and purpose independently from the records that reference them. ...

Codename One

19. Post and Comment Entities

Module 13: Creating a Facebook Clone Once users and media exist on the server, posts and comments are the next unavoidable step. These are the entities that turn the app from a profile system into a real social product. The lesson follows a sound pattern by keeping the server-side models close to the client-side ones while still allowing the server versions to carry extra persistence and relationship detail. That overlap is a feature, not a flaw. Both sides are describing the same social concepts. ...

Codename One

20. Notification, Newsfeed and ShadowUser Entities

Module 13: Creating a Facebook Clone This lesson is where the server model becomes recognizably social. Notifications are the obvious missing piece, but the more interesting work is the introduction of two server-only concepts: a materialized newsfeed entity and the shadow-user model behind “people you may know.” ...

Codename One

21. Service Layer and UserService

Module 13: Creating a Facebook Clone The entity layer stores information. The service layer is where the application starts making decisions. That distinction matters, and this lesson is the first place in the Facebook backend where the system begins to feel like more than a database with endpoints attached to it. ...

Codename One

22. UserService Part II

Module 13: Creating a Facebook Clone If the first half of UserService is about identity, the second half is about relationships. This is where the service starts earning its place as the social core of the app rather than just the entry point for account creation. ...

Codename One

23. NotificationService and MediaService

Module 13: Creating a Facebook Clone These two services are simpler than UserService, but they matter because they isolate two concerns that would otherwise spread across the rest of the backend: event delivery and file handling. NotificationService is small on purpose. Right now it persists notifications and serves paged results back to the client. That may not look dramatic, but the separation is valuable because notifications are exactly the kind of feature that tends to accumulate extra delivery mechanisms over time. By giving them their own service now, the app already has the right place to add push, WebSocket fanout, or other delivery channels later. ...

Codename One

24. PostService

Module 13: Creating a Facebook Clone PostService is where the social app starts acting like a social app instead of a collection of account features. This service owns the operations that make the feed move: creating posts, inserting them into newsfeeds, adding comments, and tracking likes. ...

Codename One

25. WebService Layer and UserWebService

Module 13: Creating a Facebook Clone Once the service layer exists, the web-service layer should be boring. That is not a criticism. It is a sign that the architecture is doing its job. This lesson demonstrates that well. UserWebService is mostly a translation layer. It defines URLs, request shapes, headers, and response behavior, then hands the real work off to the service classes underneath. That is exactly what controllers should look like in a healthy backend. ...

Codename One