Simple Web application built for the Propellerhead Technical Test.
Since this is something I'm building on my own time I've opted to use:
- Clojure
- My favourite programming language
- Cursive
- An IntelliJ plugin for Clojure development (Made in NZ)
- Luminus
- A Clojure web framework I've been meaning to try
- H2 Database Engine
- A Java embedded database that I haven't used before
- Java 11
- The current version
- The Marvel Developer API
- Because comic book characters are more fun than synthetic data
You will need Leiningen 2.0 or above installed.
I developed this using Java 11.
Copy dev-config.example.edn
to dev-config.edn
.
This file contains config overrides - secrets that generally
should not go in source control.
If you want to download the Marvel character data you'll need your
own API key from the Marvel Developer Portal. You should add this to your dev-config.edn
To start a web server for the application, run:
lein run
Then open a web browser to http://localhost:3000/
src/clj/propellerhead_technical/db_import/
- One off Marvel character import code. Run from a REPL.
resources/sql/queries.sql
- HugSQL formatted sql queries .
src/clj/propellerhead_technical/routes
- Page routes. Effectively controllers in an MVC sense.
resources/html/
- Html templates. Rendered using Selmer.
Some things that would be nice to have that I didn't implement.
As it is now, anyone can do anything to any record. There's no notion of users or logging in. The site isn't encrypted. There's very little validation of user input.
I've stored the dev database in git. It's small, so it's not that big of a deal, but it's not best practice.
I've stored status as a string, but I would prefer the DB to be better normalised and to store a status_id and have a status table with status_id and description.
Use Lucene to index all the character descriptions. Would have allowed for better search, though would have to be maintained. Clucy is the library I would have used.
Making the pages a little bit more responsive by using ajax queries from client side javascript would have been good. A REST api with a swagger front end, combined with clojure spec definitions for the entities involved would have been nice.
A Single Page Application using React, Re-Frame, and ClojureScript would have been pretty great. I decided against it due to the complexity and time.
Copyright © 2019 Arthur Boyer
Data provided by Marvel. © 2014 Marvel