How to place the author's affiliation in a specific place

I am writing an article and I would like to place the affiliation of the authors right after them and before the abstract, just like in the image. I would like to maintain the footnote's style, but with the text placed before the abstract instead of at the bottom of the page. How could I do that in a article document class?

You can use the authblk package this way:

\documentclass{article}
\usepackage{authblk}
\usepackage{lipsum}

\title{My title}
\author[1]{John Doe}
\author[1,2]{Erika Musterman}
\affil[1]{Somewhere}
\affil[2]{Over the rainbow}

\date{}

\renewcommand\Affilfont{\itshape\small}

\begin{document}
\maketitle

\begin{abstract}
\lipsum[1]
\end{abstract}
\end{document}


Disclaimer: all credits to Harish Kumar, thanks to its answer here.