Quest System Containerization

Phase: Ended

Registration Deadline: February 11, 2024

Submission Deadline: February 18, 2024

Prizes

3000 EGP

1 Place

1000 EGP

2 Place

Overview

In order to give a seamless testing and development experience, we want to dockerize and create a simple docker-compose file to allow anyone to launch and test the code-quests platform on their machine without having to install anything but docker.

System Architecture

Given the following system architecture, we need to dockerize 2 services

Dockerize the backend and frontend

  1. Code-Quests Backend Node Application

Automatically builds the dockerfile with the backend code and runs it using node command. (no web server needed)

https://github.com/code-quests/code-quests  

  1. Code-Quests-Web React Application, served with nginx or any lightweight web server

Automatically builds the dockerfile with the frontend code and serve it using nginx 

https://github.com/code-quests/code-quests-web  

  1. The frontend must utilize a multistage docker build to make it small in size, build using a node image, then run using an nginx image.
    Refer to multi-stage build here
    https://docs.docker.com/build/building/multi-stage/ 

Docker compose

To allow any developer to build, and test the application without downloading any dependencies, build a docker compose that will run the whole system on docker.


Your docker compose should include the following services:

  1. Mailhog to act as an SMTP server with a dashboard to view the emails
    https://hub.docker.com/r/mailhog/mailhog 

  2. Postgresql Database
    Pre-initialized with an empty code-quests-db and a user so the application can connect to it

  3. Code-Quests backend (built directly using the dockerfile, do not upload to dockerhub!) check the build specification here: https://docs.docker.com/compose/compose-file/build/ 

  4. Code-Quests-web frontend app, (built directly using the dockerfile, do not upload to dockerhub!)  

Note:
send us your github username on the quest whatsapp group so we can give you access to the repositories above.

You will be able to fork privately the repos in order to test the github actions.

CI/CD Pipeline for Backend and Frontend repos

Build a github actions pipeline that will execute the following:

  1. Install dependencies (npm ci)

  2. Lint and Test (npm run lint && npm run test) if provided in the packages.json

  3. Build the code (npm run build)

  4. Upload the generated ./dist (or ./build) folder to an FTP server using credentials in Github repo secrets

  5. Do not declare the secrets or the FTP server credentials or paths directly in the script, instead use them as variables.

Note: we will provide FTP server for testing privately

Acceptance Criteria

  1. Upload a Video showing the compose file building and the frontend and backend being served correctly.

  2. No hard-coded parameters, everything uses environment variables.

  3. Your submission should include the following:

    1. The video requested above

    2. A README.md explaining how the files work

    3. Dockerfiles for both frontend and backend

    4. Docker-compose.yaml

    5. Github action yaml files for both repos.

Making the world a better place through competitive crowdsourcing programming.