- Update
db/config.json
with the correct database names for Development and Test databases.
-
Copy
env.sample
to.env
-
Prepare the databases
NODE_ENV=development npm run db:create NODE_ENV=development npm run db:migrate NODE_ENV=test npm run db:create NODE_ENV=test npm run db:migrate
-
Prepare the seed data for development
NODE_ENV=development npm run db:seed
-
You can update the content of
public/index.html
Some things to note:
- Use "Git bash" to run the commands above.
- After copying
.env
file, open it up and update theDB_USER
andDB_PASSWORD
to what you have set for your Postgres root user in Windows.
-
Remove all previous postgresql users/accounts , if uninstalled pg delete all undeleted folders and restart computer To install:
-
Right click on installer, run as admin
-
Create a separate folder for data directory. ** data directory must be different form app directory
-
Go to command prompt and try to start server e.g.
"C:\Program Files\PostgreSQL\12\bin\pg_ctl" -D "C:\Program Files\PostgreSQL\11\data" start (postgresql app directory ) (data directory) -
For first time installation this will be prompt--> set superuser as postgres: e.g. "C:\Program Files\PostgreSQL\12\bin\initdb" -U postgres -D "C:\Postgres data" (postgresql app directory) (data directory)
-
Command to start server will be generated in command prompt after step 5.
It should look like this: e.g. ^"C^:^/Program^ Files^/PostgreSQL^/12^/bin^/pg^_ctl^" -D ^"C^:^\Postgres^ data^" -l logfile start
- Copy and paste to start server
-
Right click on Windows button and run Powershell(admin) command prompt Run the following commands
-
npm install --global --production windows-build-tools if error- pls edit env variable PATH with %SystemRoot%/system32/WindowsPowerShell/v1.0
-
Restart computer
-
npm install node-gyp
-
npm install bcrypt
or
- npm install bcryptjs