Skip to content

Radishoux/joule-interview-main

Repository files navigation

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

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published