An ecosystem is a community of organisms interacting with each other and their environment. It includes biotic components like plants, animals and biotic abiotic components like weather, soil and climate. Energy and matter are exchanged within the ecosystem. Producers like plants use solar energy to produce food through photosynthesis. Consumers eat producers or other organisms. Decomposers break down dead organisms, recycling nutrients for producers. Energy flows through the ecosystem via food chains and webs from producers to different trophic levels of consumers and decomposers.