- create a database and name it
shopping
for the dev via the sqlCREATE DATABASE shopping;
- create a database and name it
shopping_test
for the testingCREATE DATABASE shopping_test
-
create user and name him
shopping_user
you want but don't forget to put it in the .env file via the sqlCREATE USER shopping_user WITH PASSWORD 'password123'
-
grant all access to that user via the sql
GRANT ALL PRIVILEGES ON DATABASE shopping TO shopping_user
-
grant all access to that user via the sql
GRANT ALL PRIVILEGES ON DATABASE shopping_test TO shopping_user
ENV=dev
db_host=localhost
db_name=shopping
db_test=shopping_test
db_user=shopping_user
db_password=password123
BCRYPT_PASSWORD=##
SAULT_SHOTS=10
TOKEN=##
{
"dev": {
"driver": "pg",
"host": {"ENV": "db_host"},
"database": {"ENV": "db_name"},
"port": {"ENV": "port"},
"user": {"ENV": "db_user"},
"password": {"ENV": "db_password"}
},
"test": {
"driver": "pg",
"host": {"ENV": "db_host"},
"database": {"ENV": "db_test"},
"port": {"ENV": "port"},
"user": {"ENV": "db_user"},
"password": {"ENV": "db_password"}
}
}
npm install
to install all dependenciesnpm run db:up
to set up the database and get access the appnpm run build
to build the app
-
database port
5432
-
app port
3000
npm run start
to start the app
npm run test
to test the app