Unblocked #3

The code needs to be refactored. It’s a bit offensive to look at right now which is part why the project stalled. Splitting things up will help. For now, it’s not possible to create posts because boards do not exist yet.

Board creation entails a board owner (user creation), and board settings (board admin, customization).

Templates were made. A Board contains a Threadlist which contains Threads (One to Many relationship of an OPCell and zero or more Post(s), all of which are just regular Posts). None of the backend behind the templates has been done. The template contents can be modified easily at render time, but there are no database structures to query right now.

The general thread render process will be:

  1. render Board
    • render Thread(s)
      • render OPCell
      • render Post(s)

Obviously there can only be one OPCell per Thread so there are 1:1 relationship between Threads an Original Posts.

Simply, it looks like this:

@GET
@Path("{board}")
@Produces(MediaType.TEXT_HTML)
public TemplateInstance board(@PathParam("board") String board) {

    return Templates.board(new Head(), new TopNav(), new BoardHeader(), new News(), new LatestImages(), new LatestsPosts(), new BottomNav(), board, new PostingForm(), new ThreadList(), new PostCell());}

Currently all those individual New Objects are just static templates. The parameter {board} is captured in the GET request which should be used to locate the board in the database and is functionally the starting point of a SSR request. From there we would retrieve and render things like the BoardHeader, News, and ThreadList. As you can see, right now these things are just hardcoded with no parameters. The TemplateInstance method returns immediately. Information will need to be retrieved based on the {board} and then passed as method arguments to the class constructors, where the templating engine can then access the constructed Object for rendering.

If it is not obvious, the first step should be to check if the board name provided exists.

So, board creation needs to be mocked up.

Then we can check if the board exists, and if it does, get information about it, otherwise 404.

Right now no matter what board URL you visit, it appears to “just work” as there is no real logic yet.