In order to function properly, Postgres must know where you database is located. To do this you export the variable PGDATA. To set this variable, cd to your project directory and type the following:
Now that Postgres can figure out where you want to put your database, it can copy some files to that directory that it needs in order to manage any databases that you create there. This is done by executing the command initdb.
There may be a lot of output to the screen. The only thing that you need to concern yourself about at the moment is that part of the output states that you have been successful and can now start the database server.