- Each subfolder represents a logical subsection and contains code examples pertaining to the same subject. Those subfolders' names start with numbers,
- Inside of numbered subfolders, are unnumbered folders whose names represent subject of an interview question,
- Each of those, contains either expressjs and nestjs examples separately, or has one working application sourcecode.
- All code examples are runnable
- All code examples were prepared to be run either on their own using
node <filename.js>, in standalone Docker containers or via docker-compose - Run
pnpm ioryarnornpm iin the root directory first - This repo uses a Makefile to make it easy to run any code example. The Makefile performs logic behind the scenes to "just run" the example correctly
- The only Makefile command you should be using is either the
upordowncommand. You need to passCODE_PATHargument into it with relative path of the folder with example you want to run - So a full command to run a code example needs to look like this:
make up CODE_PATH=11-app-construction/controller/controller-express
- when done with running an example you can use an analogous script to stop it:
make down CODE_PATH=11-app-construction/controller/controller-express
- Single package.json, tsconfig, yarn.lock, Dockerfile files - few times less files for the entire repo
- Single node_modules for adjusting and expanding examples - much smaller size of the entire repo when used
- Isolation of examples and thus bigger independence in modifying them
- Single package.json means every Dockerimage installs more dependencies than needed
- The act of starting the example will take longer (for Docker to do its thing) - this is offset by not having to manually navigate to example's folder, installing dependencies etc.
- It is not a monorepo so running tasks via Make scripts could be a little clunky
- use ENTRYPOINT ["tail", "-f", "/dev/null"] in dockerfile to keep the container alive indefinitely to inspect it in case of issues
- Node version >= 18
- make
MAC:
brew install make
WINDOWS: Install Git for Windows & use included Git Bash
WSL2:sudo apt-get install make - Docker (including docker-compose)