Skip to content

Design choices

Roni Juntunen edited this page Dec 14, 2019 · 1 revision

Design choices

Main layout

I decided to separate backend and frontend completely from each other because I think it's that way cleaner. There is no risk for backend code to interfere with react code with this setup and it is easy to use react product mode. Minus side of these setup is that I had to fight with CORS-policies quite a lot and I'm still not completely satisfied with the end results.

I decided to use Docker and Docker compose with this application since I thought it would be quite complicated to set this application app without any automation. Docker compose seemed good option since its native tool and I didn't need any extra complicated setups.

Backend

I think my backend design choices are pretty normal. Maybe only interesting choice is SQL over mongodb.

Database

I decided to use Mysql because I didn't see any reason to use no sql based DBMS in this application and I personally like strict rules of the SQL. I encountered problems only once with this option and it related to Emojis. For some ridiculous reason Emojis can't be stored by default to the SQL database. Fortunately problem was easy to fix.

Mysql2

I decided to use Mysql2 since I think it was most up to date SQL library and I had problems authenticating with old library. I don't have any bad words from this library it worked well.

bcrypt

I decided to use bcrypt because it was easy to use and supported everything out of the box like salting. This library worked pretty well in its own field.

Unit tests

I decided to do unit test for this project since I first started with the backend and wanted to make sure everything is working correctly before moving to frontend. I decided to use Mocha and Chai since they seemed to be popular options.

Python

Actually first I thought I would do REST-testing with Python, because language is more familiar to me. That is why data generation to the database is done with Python. At the end I decided to do tests instead with Javascript.

Apidoc

Apidoc was natural choice for me because I have been using Apidoc generated documentations a lot and always been very happy use them. Now I finally find out how those documents are really made.

Frontend

React was a natural choice for me as a frontend platform since its currently most advanced frontend platform.

Redux

Redux was suggested controller solution on the course so I decided to use it. I'm not completely happy the way it works because some things are done in a too difficult fashion but I think Redux helped to make my code cleaner. Next time I would still like to test something new like MobX.

Material UI

I wanted to use material design language since it's modern and fresh. Because Material UI provided me all the tools for this design language I decided to use it. I still have a little mixed feelings of using Material UI. I think outcome with the library was pretty good looking but library was maybe a little bit too bloated for my taste. Some simple things took way too many lines of JSX.

Infinite scroller

This was easy pick. Infinite scroller is very popular library and it was easy to use and worked well. This was great choice.

Remarkable

I didn't have enough time to implement proper image Api but I really wanted images to my page so I decided to use Remarkable. I liked the library pretty much but I'm a bit worried is it safe to let users inject images from any page. I think there might be possibility for cross site attacks so I would like to add proper image support and disable that functionality of the Remarkable.

Clone this wiki locally