I Know that Fourier transform states that any non-periodic function could be described as summation of sines and cosines by saying that $$F(w)=\int_{-\infty }^{\infty }f(x)e^{^{-iwt}}dt$$
And this was derived from Fourier series by saying that any non-periodic function is a periodic one provided that the period goes to infinity, and by saying that you can say that any function could be described as a bunch of sines and cosines and that's why we transform our function to the frequency domain
But I did know recently that the Fourier transform is a projection of our function on the orthogonal basis which is $e^{^{-iwt}}$ and by saying that you mean that we show that the frequency inside our function by projecting it on another basis function
So by that we say that we can represent the frequency inside our function by projecting it or by saying that is a Fourier series which has an infinite period
My question is: which one of these ways is the correct one to think about Fourier transform?
First of all, let us make a distinction between Fourier transform and Fourier series. The former, the Fourier transform, is what is written in the question: $$ F(\omega) = \int_{-\infty}^{\infty} f(x) e^{-i \omega t} \mathrm{d} t $$ The anti-transform expresses the function $f(x)$ as an integral, roughly, summing sines and cosines with a continuous distribution of frequencies: $$ f(t) = N \int_{-\infty}^{\infty} F(\omega) e^{i \omega t} \mathrm{d} t $$ (here $N$ is a normalization factor). This $f(x)$ is not periodic at all.
The latter, the Fourier series, is the sum of sinusoidals and cosinusoidals with frequencies that are multiple of a given frequency. Something like this: $$ f(t) = \sum_n a_n e^{i \omega_0 n t} $$ Here the frequencies are multiples of $\omega_0$. The resulting $f(t)$ is periodic, with period $2\pi/\omega_0$.
For sure, the second is wrong. If the function is periodic, we can express it in Fourier series. If we are interested in a function on an interval, we can pretend that it is periodic, by repeating it. If the function is defined on the whole real axis, then we must use the Fourier transform. In both cases, we are projecting the function (our vector) on an orthonormal basis.
Very roughly, we can imagine that the sum in the Fourier series approaches an integral when the step between frequencies vanishes. This happens when $\omega_0$ tends to 0, which means that the period tends to infinite. In this limit, we can very roughly say that the Fourier series approaches an integral, so it becomes similar to a Fourier antitransform... But this is more science fiction than mathematics.