Basic Structure of an Academic Text
All academic texts consist of three parts; introduction, main thesis, and conclusion. The figure below shows examples of what each part may contain (in computer science), but the exact contents of each part has to be decided from case to case. An example is the discussion which, if it is short, can be placed in the conclusion but if it is more substantial and closely connected to the results fits better in the main thesis.
Note that abstract and appendices are not part of the main text. This means, e.g., that the main text cannot assume that the reader is familiar with the abstract. The main text can refer to appendices for more details, but can not rely on appendices to convey the intended message.