Proof of concept - Thewessen/tic-tac-toe_ruby_backend GitHub Wiki

Creating this app has two purposes:

  1. Showing my skills for a job interview, using Emberjs and Ruby on Rails.
  2. Learning Ruby on Rails and Emberjs (in that order).

I'm pretty comfortable using JavaScript. And have some experience using Angular, Reactjs and Vue. But never worked with Emberjs. My judgement, viewing the tutorial, learning Emberjs shouldn't be that hard.

Ruby on Rails, on the other hand, seems a little bit harder to learn. I'm glad I recently discovered Laravel framework (my first MVC framework) using PHP. It makes reading the tutorial much easier. Luckely Ruby looks a bit like (cleaner) PHP. So hopefully the learning curve isn't that steep.

For showing my skills, I guess they also want to see what I can do with JavaScript and Emberjs. So I'll try divide commitments to the front- and backend as much as I can.

Proof of concept

The frontend should contain a simple tic-tac-toe game, and all the logic that it needs. If I have more time, I'll dig into caching the state, so the app can be used offline as whell. Though, for utilizing Ruby on Rails, it should store the state of the game in the backend.

The backend should store the state of any game. But a back-end with one table containing one row isn't that much fun. So let's say it stores a great amount of games: finished games and games in progress. Maybe in the frontend, we can utilize this data to create a scoreboard, or any other 'stats' page. Or you can load a specific unfinished game.

I really want to dig into the Ruby on Rails. Also, the instruction for the app states something about multiplayer capabillities. Maybe I can create some sort of user login, and set some foreign key's on the games table refering two users playing that game... All proof of concept though.

Some other idea I had was utilizing this wiki as extra data for the app. Viewing this as a creation blog. I know git uses GraphQL as a querying language. I guess Ruby on Rails has some way of fetching data from some other source other then directly linked databases. Let's see what I can make of it.

Planning

  1. Creating one table on the backend (games) with a unique id, and a boardstate column.
  2. Fetch this data in the frontend.
  3. Create some styling for the board, viewing the state of the game.
  4. Creating some logic playing the game.
  5. Storing the (unfinished) game in the backend.
  6. Creating some backend logic for updating the game change.

If this could be done just today, I would be happy. But considering all steps involve some learning, two days should be more realistic.

After finishing finish the initial planning, I realized I had one more day left before the app needed to be done. After learning more about Emberjs I really wanted too utilize Emberjs's relationships, because this also involves some backend logic.

Extra steps:

  1. Creating a many to many relationship between nicknames and games in the backend.
  2. Displaying all the available nicknames in the frontend.
  3. Using this relationship in the frontend, by creating the relationship after a new game is created.
  4. Saving the relationship in the backend.
⚠️ **GitHub.com Fallback** ⚠️