Mockups are widely used to elicit and validate user requirements in web applications, and several intuitive tools have been developed in recent years, actively involving the end user in the requirements solicitation process. However, most current web development approaches and tools discard mockups after the information-gathering process, abandoning the opportunity to exploit underlying information in them for autogenerating functional web applications. To overcome this limitation, we have devised a method for deriving the database schema and the logic of the web application from the information contained within mockups. In particular, the method gathers clues on how to organize the data and the control flow of the web application by analyzing the structure and relationships of the widgets in the mockup. Based on the proposed method, we have implemented a tool supporting the generation of web applications abiding by the model-view-controller architectural pattern. The tool has been evaluated by involving several end users in the development of web applications for different domains. KEYWORDS business information systems, database, end-user development, human-computer interaction, mockups, web application modeling Softw Pract Exper. 2018;48:945-973.wileyonlinelibrary.com/journal/spe