The 21-year-old spent last season on loan with Blue Square Bet Premier side Wrexham but missed out on their Wembley trips for the FA Trophy final and play-off final because of a hamstring injury.
Alfei had a year left on his contract but the club were keen to extend that and he is now hoping to emulate another youngster Ben Davies, who took his chance to become a Premier League regular this season.
"I'm absolutely delighted," Alfei said. "It's good to know the club has faith in me and there is nowhere I would rather be than Swansea.
"The loan spell at Wrexham was great for me. It's a good club and I really believe I learnt a lot there this season. It's made me a better player.
"Obviously it's been difficult at times for me this season because of the injury, especially after missing out on their two trips to Wembley - what are the odds of that happening?
"But that's all part of my development and I wouldn't rule out going on loan somewhere again next season. I think that's probably what I need to keep progressing before hopefully returning to push hard for a place in the first team.
"I think Ben Davies has proved to all the youngsters what is possible. I'm sure he didn't expect to play regularly in the first team this season, but he took his chance when it came along and did really well. I know Ben's example doesn't happen too often, but you never know, especially when it comes to injuries."