Magic box, objects inside visible only through hole I'm on Blender 2.8 and I want to create a special shader, which is harder than I thought.

I want to create a box, which contains more objects inside. The front face is a hole where we can see the inside. But I want the outside faces to be transparent, and make every objects inside transparents as well when the camera is in this axis.

On the pictures, the grey box is my main box where I want the transparent outside, opaque inside shader. The blue box is an object inside (that I actually see so my shader is not working) and the red one is kind of a background object. 

So I want the red box not visible when seen through the inside of the main box and I want the blue box only visible through the hole of the main box but the red box still visible cause it's not an inside object of the main box.



Hope everything's clear, it's kind of a concept here.

Thanks for your help,

SHDWRCK
For the magic box, the material of the front face is a simple principled shader (the default one) and the material of the side faces is a simple transparent shader.

The material of the other cubes is the same (or at least they both have this structure), like shown in the picture:



(You probably want to disable the little cube's shadow)

So you get this:



if you want to make the internal faces opaque, your sides need to be solid (you can do it with a solidify modifier)



the outer sides are completely transparent, the front is a simple principled shader, in the internal faces you need to use this material:



If you want the red cube to be visible, just make it a simple principled shader.

Here is the final result:



NOTE: if you can still see a dark shadow of the blu cube through the lateral sides, you need to increase the transparency light bounces 



NOTE 2: I think you should work a bit on the shadows and decide which objects should cast shadows and which shouldn't (for example right now the front face creates a shadow on the inner faces)