Which comes first, basis vectors or coordinates? In a book on general relativity I find this sentence:

Transformation rules of one-forms
Let us consider an open set $\mathbf{U}$ of the manifold
$\mathbf{M}$, and choose a coordinate system $\{x^i\}$.
We have seen that this defines a coordinate basis for vectors,
$\{\vec{e}_{(i)}\} \equiv \left\{\frac{\partial}{\partial x^i}\right\}$
and the dual coordinate basis for one-forms
$\{\tilde{\omega}^{(i)}\}_{i=1,...,n}$.
If we make a coordinate transformation ...

I am struggling to understand it (and to understand all the rest actually) since it appears that in general relativity we first assume coordinates exist and then derive properties of bases. But in usual geometry we go the other way around! What are we doing here? Can we just assign random tuples of numbers to points on a manifold (not too random of course, at least biijectively and continuously) and then derive the basis in the tangent and cotangent spaces from this arbitrary assignment? Am I right in understanding that we are actually doing this?
 A: 
it appears that in general relativity we first assume coordinates exist and then derive properties of bases. But in usual geometry we go the other way around!

The issue is actually slightly different than merely "which comes first". The issue is that coordinates are defined on the manifold while basis vectors are defined in the tangent space. So conceptually there is no first or second* between them.
However, before you are introduced to (pseudo) Riemannian geometry the distinction between the manifold and the tangent space is often neglected. You were dealing with a simple flat manifold where parallel transport is unique and the manifold is isomorphic to the tangent space. In that context you could blur the line considerably and get away with it.
*There is one obvious exception between the general "no first or second" statement. Obviously, coordinates must be defined first before you can define specifically the coordinate basis.
A: I'd start with coordinates to describe the space, both in geometry and relativity (that can be interpreted as geometry of time-space), so that you can write a point in space as a function of the coordinates $q^i$, $\mathbf{r}(q^i)$.
Now, the position in space is a function of the coordinates as independent variables, and it's quite natural to define the natural basis induced by the coordinates $\{ q^i \}_i$ as $\{ \mathbf{b}_i \}_i$ with
$ \mathbf{b}_i = \dfrac{\partial \mathbf{r}}{\partial q^i}$.
Vectors of the natural basis are not unit vectors or orthogonal vectors in general. From here, it's useful to define:

*

*the metric tensor, whose covariant components are the dot product of the vectors of the basis,
$g_{ij} = \mathbf{b}_i \cdot \mathbf{b}_j$,


*the reciprocal basis $\{ \mathbf{b}^i \}_i$, s.t.
$\mathbf{b}_i = g_{ij} \ \mathbf{b}^j$


*the contravariant components of the metric tensor,
$\mathbf{b}^i = g^{ij} \ \mathbf{b}_j$.
With these bases, you can write a vector field using contravariant or covariant components
$\mathbf{v} = v^i \mathbf{b}_i = v_i \mathbf{b}^i$,
where it's not hard to prove that
$v^i = \mathbf{v} \cdot \mathbf{b}^i \qquad v_i = \mathbf{v} \cdot \mathbf{b}_i$
$v^i = g^{ij} v_j \qquad v_i = g_{ij} v^j$
$\mathbf{b}^i = g^{ij} \mathbf{b}_j \qquad \mathbf{b}_i = g_{ij} \mathbf{b}^j$
Take a look here at interactive hand-written notes (link in light-blue):

*

*introduction to tensor calculus: https://basics.altervista.org/test/Math/tensor_calculus/main.html

*introduction to differential geometry: https://basics.altervista.org/test/Math/differential_geometry/main.html
A: You can do either one.

*

*Any choice of coordinates $x^i$  on a neighborhood $U\subseteq M$ induces a basis $\frac{\partial}{\partial x^i}$ for the tangent space $T_pM$ at each point $p\in U$.


*Given a basis $\hat e_i$ of a tangent space $T_pM$, we can define a coordinate system in some (possibly small) neighborhood of $p$ by extending the basis at $p$ to entire vector fields, and then "following" the integral curves of those fields.
The former approach is immediate - $x^i \mapsto \frac{\partial}{\partial x^i}$.  The latter is more involved, primarily because the extension from the basis vectors $\hat e_i$ at $p$ to basis vector fields $X_i$ defined on all of $U$ is highly non-unique, so a non-canonical choice needs to be made.
For example, if the manifold in question is $\mathbb R^2$ and we consider the basis
$$\hat e_1 = \pmatrix{1\\0} \qquad \hat e_2 = \pmatrix{0\\1}$$
at the point $p=(1,0)\in \mathbb R^2$, then we could equally well extend this basis to create the standard cartesian coordinate system, the polar coordinate system, or a hyperbolic coordinate system.
You may object to this by saying that the cartesian coordinate system is the most natural, but the only general sense in which this is true is that the corresponding basis vector fields are obtained by parallel transporting the vectors $\hat e_i$ to each point in space. This is the generalization of "copying and pasting" the vectors at each point of $\mathbb R^2$ which can be applied to manifolds which possess intrinsic curvature.
So in your familiar Euclidean geometry, it may seem just as easy to define vectors and then coordinates, but this is true only in the special case of a Euclidean manifold - which is precisely what we're trying to generalize by studying differential geometry. In the more general case, it is far simpler to define basis vectors from coordinates, so this is what we do in the beginning. Note, however, that things like Riemann normal coordinates are an important example of us starting from basis vectors to define a coordinate system.
