This paper proposes an architecture of locality electricity market (LEM) for peer-to-peer (P2P) energy trading among a group of residential prosumers (consumers and producers) with renewable energy resources, smart meters, information and communication technologies, and home energy management systems in a smart residential locality. Prosumers may sell(buy) their excess generation(demand) in LEM at a profitable prices compared to the utility prices in P2P fashion. In order to manage the trading in LEM, a common portal named as locality electricity trading system (LETS) is introduced. The purpose of LETS is to prepare a trading agreement between the participants by fixing a price for every deal based on the quoted price and dayahead power trading schedule given by the participants. An enhanced intelligent residential energy management system (EIREMS) is proposed at the prosumers' premises to enable their participation in the day-ahead energy trading process and in real-time scheduling of schedulable loads and battery for reducing the electricity bill with due consideration to the operational constraints and LETS agreement. The performances of proposed LETS and EIREMS are validated through a few case studies on a locality with ten prosumers. The proposed methodology endorses marginal economic benefit for all the participants. © 2020 Institution of Engineering and Technology. All rights reserved.