I understand that in classical mechanics, a system with $N$ degrees of freedom is modeled by an $N$ dimensional Manifold called the configuration space. We then look at the tangent and cotangent bundles which is the stage for the dynamics of the system. We then define the Lagrangian and the Hamiltonian which are smooth maps from tangent and cotangent bundle respectively and then we can derive the equations of motion of this system.
I'm trying to draw an analogy for field theory but I don't know how because it seems to me the approach changes somewhat in field theories (unless of course I'm horribly confused).
Fields are typically defined as smooth sections over spacetime and fields of course have infinite degrees of freedom so I suppose that the configuration space for fields ought to be thought of as an infinite dimensional Manifold. Now I'm assuming you can still construct tangent and cotangent bundles to infinite dimensional manifolds so are the Lagrangian and the Hamiltonian still defined similarly?
Now my question is whether I'm thinking along the right lines here? If so I'm wondering what exactly is the relationship between the spacetime manifold (over which the fields are defined) and the configuration space for fields. For instance if we consider the electromagnetic field which is a $(2,0)$ antisymmetric tensor field, is the configuration space the space of all $(2,0)$ antisymmetric tensor fields over spacetime?
I would really appreciate an elaborate explanation because I feel like I'm horribly confused here.