Code Monkey home page Code Monkey logo

diligent_assessment's Introduction

diligent_assessment

This is my submission to a competition to work at Diligent as a Senior Software Engineer.

Try it out live! Deployed here: https://diligent-assessment.schwarzkopfb.codes
Task description: https://github.com/dil-ajanek/tech_assessment/blob/main/README.md

Overview

Application structure

This repository consists of 3 main folders and some configuration and manifest files.

  • prisma dir contains the database schema and initial "migration" sql file for a PostgreSQL datastore - used by the backend.
  • public is the classic "wwwroot", containing static assets served directly and a special index.html which is used as a template for the final client html.
  • in src there are two subdirectories: client and server containing the source files for the frontend and the backend respectively.

The client is based on React with TypeScript, Bootstrap and Sass for styling - bundled by webpack.

The server is also written in TypeScript on top of Koa because that's a quite powerful, light-weight web framework with amazing performance and flexibility.

Database

The project is backed by PostgreSQL. Prisma ORM is chosen because of it's compatibility with AWS Aurora and the easy, reliable management of migrations as well as its superior development experience with Node.js.

Screen Shot 2024-05-30 at 12 53 17 PM

Getting started

First install the dependencies listed in package.json:

$ npm install

Then build both the server and the client code:

$ npm run build

this will emit the transpiled and bundled client and server code into the dist folder.

To be able to connect to The Movie Database, you'll need an access token for their API and also a PostgreSQL database should be available somewhere. You have to set DATABASE_URL and TMDB_API_READ_ACCESS_TOKEN in the shell you're going to run the application.

Once the build step is done, and the configuration is ready, you can start it up by executing:

$ npm start

A minimal but useful development logger is also included.

You can override the default port 3000 with the PORT environment variable. But if all the above steps succeeded, now your server is ready to accept connections at http://0.0.0.0:3000/.

If you're planning to actively develop the project there is also

$ npm run dev

which starts up incremental compilers with watchers, so you can try out your work locally right after saving file changes in the project.

Due to the standard structure of the project, it's directly deployable to Cloud providers like Heroku and easily adjustable to Serverless hosting providers to be able to cost efficiently run it on the edge.

Scalability and performance were the main architectural approaches, as you can experience it yourself on the live deployment - that's powered by a single Heroku Eco Dyno only but is quite responsive and fast.

I tried to a bit over-comment the source to help the reviewer go through it faster.

Hope you'll like it! ๐Ÿคž โœŒ๏ธ

License

MIT

diligent_assessment's People

Contributors

schwarzkopfb avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.