How people walk in natural conditions often reveals key insights into health, quality of life and independence. However, topological properties of the environment in which walking takes place should be taken into account for accurate and reliable gait assessments. Here, to begin to tackle this problem a novel smartphone-based gait assessment framework is introduced, and the implementation and performance analysis of two of its data processing modules are described. The first module employs a fuzzy rough nearest neighbour classifier for automatic labelling of walking environments. Tested on a publicly available dataset, the fuzzy classifier reached up to 82% classification accuracy outperforming other state-of-the-art classical machine learning methods and matching deep neural networks reported in the literature. The second module employs a novel algorithm to detect steps and extract temporal gait parameters (such as stride time, double support time and step variability) from heel strike and toe off time points. Tested on a new dataset collected for this study, the algorithm successfully detected more than 97% of the steps and estimated gait parameters with high accuracy and precision matching with the performance levels achieved in controlled laboratory trials.