  We study and relate categories of modules, comodules and contramodules over a
representation of a small category taking values in (co)algebras, in a manner
similar to modules over a ringed space. As a result, we obtain a categorical
framework which incorporates all the adjoint functors between these categories
in a natural manner. Various classical properties of coalgebras and their
morphisms arise naturally within this theory. We also consider cartesian
objects in each of these categories, which may be viewed as counterparts of
quasi-coherent sheaves over a scheme. We study their categorical properties
using cardinality arguments. Our focus is on generators for these categories
and on Grothendieck categories, because the latter may be treated as
replacements for noncommutative spaces.
