Until recently you could create an .env file but replit has changed this and the freecodecamp instructions have not been updated yet.
So what you have to do is click on the lock icon where secrets are stored. There you can fill in key value pairs like PORT = 3000. This replaces the .env file.
There have been other posts about this subject:(mine:))