Total marks: 30 | 15 automated checks | 2 marks each
You are given a full-stack web application with a React frontend, a Node.js/Express backend, and a MongoDB database. The repository contains the source code in an undeployed state. Your task is to get the application running on the EC2 instance provisioned for you, in a state that satisfies the grading criteria below.
You may use any tools or workflow you choose. There is no prescribed solution.
When performing this assignment, you will not have access to any LLM or external resources. You must rely on your own knowledge and the official documentation for any tools you use. The links for the official documentation are provided in the course materials and in this document.
Repository: https://github.com/nst-sdc/DevOps-Comprehensive-Assignment
| Layer | Technology | Notes |
|---|---|---|
| Frontend | React 19, Vite | Should be compiled to a static bundle |
| Backend | Node.js, Express | REST API |
| Database | MongoDB | Stores users |
API endpoints:
GET /api/users— returns all users as a JSON arrayPOST /api/users— creates a user; body:{ "name": "...", "email": "..." }
You will receive SSH credentials to an Ubuntu EC2 instance. All work must be performed on that machine. The grader will log into the same machine and run the grading script.
Grading is mostly automated (with some manual checks noted below). The grader runs a script that performs 15 independent checks on the deployed application. Each check is worth 2 marks. There is no partial credit — a check either passes or fails.
10 checks are disclosed below. 5 checks are hidden — they will not be described in advance, but a well-structured deployment will pass them naturally.
docker must be present and executable on the machine.
docker --version
# must succeedThe Docker daemon must be running and accepting commands.
docker info
# must succeed without errorAll available system package upgrades must have been applied. The grader checks for 0 pending upgrades at time of grading.
docker ps must show exactly 2 running containers — one for the application and one for the database.
One of the two running containers must be using a MongoDB image.
The application container must map host's default HTTP port to its internal port.
The application must be accessible at http://localhost on the EC2 instance, and at the IP address of the EC2 instance from a remote machine.
The response body at http://localhost must be the compiled React application. The grader checks for the presence of the root mount point in the HTML.
A development server (npm run dev) will not satisfy this check — the frontend must be built first.
The response to GET /api/users must have the correct Content-Type header indicating JSON and a 200 status code.
The MongoDB should be configured to store its data in such a way that if the container is stopped and removed, the data remains intact and can be accessed when a new container is restarted.
- The frontend source contains a hardcoded API URL (
http://127.0.0.1:5000/api) that will not work once deployed — find it and fix it. - The backend currently only serves the API endpoints. You might want to look into how to make it serve the compiled frontend as well.
- You might need to add environment variables to your containers to configure the application correctly. Local testing with
.envfiles can help with this. - Think carefully about how your containers find each other at runtime. Container names matter.
- Read the Docker documentation on Dockerfile, images, containers, named volumes, networks and bind mounts. You will likely need to use all of these concepts.
- Docker
- Docker CLI reference
- Docker Compose reference
- MongoDB Docker image
- Node.js Docker image
- Express documentation
- React documentation
- Vite documentation
- MDN Express tutorial
- SSH documentation
- Ubuntu package management
- Systemd documentation
- Nginx documentation
- PM2 documentation
- Node.js documentation