  We study the triplet vertex operator algebra $\mathcal{W}(p)$ of central
charge $1-\frac{6(p-1)^2}{p}$, $p \geq 2$. We show that $\trip$ is
$C_2$-cofinite but irrational since it admits indecomposable and logarithmic
modules. Furthermore, we prove that $\trip$ is of finite-representation type
and we provide an explicit construction and classification of all irreducible
$\mathcal{W}(p)$-modules and describe block decomposition of the category of
ordinary $\trip$-modules. All this is done through an extensive use of Zhu's
associative algebra together with explicit methods based on vertex operators
and the theory of automorphic forms. Moreover, we obtain an upper bound for
${\rm dim}(A(\mathcal{W}(p)))$. Finally, for $p$ prime, we completely describe
the structure of $A(\trip)$. The methods of this paper are easily extendable to
other $\mathcal{W}$-algebras and superalgebras.
