Hitler was a Battalion runner in the Bavarian 'List' Infantry Regiment. He was present with the regiment in the battle of Fromelles (1916) and the 3rd Battle of Ypres (1917).
The NSDAP's rise to power was probably due to the KPD's (Communist Party of Germany) vehement tendency towards revolution without actually making any progress to improve workers' rights and conditions, since they were a Marxist-Leninist party created in 1918 and formed from the Spartacus League by Rosa Luxemburg and Karl Liebknecht, after the separation from the SPD (Social Democratic Party of Germany).
So workers turned to the NSDAP, who proposed more pragmatic reforms to improve their rights without starting any revolution. Not to mention the KPD was radically hostile towards other parties, especially towards fascism which was a real threat in Europe in the 1920s; hence, to them, you were a fascist OR you were a communist, so this radical approach rendered negotiation between the political parties impossible.
Afterwards, Hitler rose to power in January 1933; he was nominated Chancellor by Hindenburg - President of the Republic of Weimar. In March 1933, he obtained the power and triggered a fire at the Reichstag and blamed it on the Communists, which eventually led to the repression of Socialism and Communism in Germany. Concentration camps were first opened for political opponents.