Skip to content

Latest commit

 

History

History
46 lines (29 loc) · 3.03 KB

02-Choosing the stack.md

File metadata and controls

46 lines (29 loc) · 3.03 KB

Choosing the stack

In this chapter we're gonna decide what tools we need to build our application and try to answer why we need those tools.

Choosing the tools

It should be clear from the series title that as a main language we'll be using Clojure. But besides the language itself we need a database to save our users trips. We need something to help us with project scaffolding because it may take tremendous amount of time and you may even lose all the interest in developing the app itself. And also we need a bunch of libraries to help us with authentication and authorization, routing, view rendering and state managament.

Scaffolding

To not spend too much time on a project set up we'll use Luminus. It's a mini framework that can give us a fully working environment for development and testing with just one command.

Database

Our app is relatively small and simple and we don't have any special needs so we can probably use postgreSQL, MongoDB or any other popular solution. But why not using something more clojurish so we'll choose Datomic. As a query language it uses Datalog which is kinda a mix of logic programming and edn (a data format, similar to json in javascript world)

Routing

To distinguish between reqests from the client we need a routing library. Reitit is a default one used by Luminus. So we'll stick with it.

Authentication

Authentication and authorization are big and complicated topics by themselvels. And you need a good cryptography background to implement it from scratch. So in our project will use Buddy library to abstract all those complex details.

View rendering

Rerendering an application when its state changes used to be a big problem before React. It abstracted everything related to when and how you should change your DOM. When the state of your app changes all the necessary components will be rerendered automagically. To use it in Clojure world we can choose Reagent which is just a wrapper on top of React.

State management

Our app should be built out of components and those components should be able to get data from outside and also communicate to each other. So will use re-frame to connect all the components into one live system.

We didn't go into too much details about each tool now. Because we'll get back to each of them in later chapters. But if you're not familiar with some of them It may be useful to have a quick glance at their docs.