Giter VIP home page Giter VIP logo

joule-interview-main's Introduction

Joule Interview

This repository aims to emulate a blog post application. It is imperfect on purpose; we'd like your comments on it!
Please see the exercise as if you joined a team that created this repository, which is now used like this in production. What would you do with it?

We would advise spending between 60 and 120 minutes on this exercise and try answering the following questions:

  • What good practices do you see that you would reuse on other NestJS projects?
  • What would you refactor in the code to improve its quality?
  • What would you bring to improve the CI/CD (in order to reduce the number of bugs in prod)?
  • What would you do to improve the DevX?
  • What would you do to improve the security of the application?
  • If you had to add a Commenting feature on articles, how would you do it? (Do not hesitate to write code!)

Installation & Setup

npm install

Prisma & DB

Database

To start the database, you can use Docker

docker compose up database

Migrations

Apply migrations to the database with the following command

npm run migrate

Seed

You can then populate the database with the seeds we created!

npm run seed

Running the App

Once you have set up the database and applied the migrations

npm run start

Login

To log in on the app in the dev environment, you can call the login endpoint with the credentials found in the prisma/seed.ts file, and then use the accessToken provided as a Bearer Token. With Swagger, you can use this token to log in.

Test

# unit tests
npm run test

# e2e tests
npm run test:e2e

Prisma

Generate New Migrations

When changing the data model, you should run the following command to generate and apply the associated migration

npm run migrate -- --name "<NAME>"

GitFlow

The main branch is protected. A Merge request has to be approved before it is merged into main. It is then automatically deployed with our CI/CD. We build the image of the application on a registry. From there, a Portainer service receives a notification and deploys the new version of the image.

Docker

docker compose up

Drone

We use Drone for our CI/CD. We have two pipelines, one running at every new commit on a pull_request, and one whenever there is a push on dev or main branch

joule-interview-main's People

Contributors

radishoux 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.