#want to make admin panel for my online book store - template backend,
Run App on local machine:
Install local dependencies:
yarn install
Adjust local db:
1. Install postgres:
-
MacOS:
brew install postgres
-
Ubuntu:
sudo apt updatesudo apt install postgresql postgresql-contrib
2. Create db and admin user:
-
Before run and test connection, make sure you have created a database as described in the above configuration. You can use the
psqlcommand to create a user and database.psql postgres --u postgres
-
Next, type this command for creating a new user with password then give access for creating the database.
postgres-# CREATE ROLE admin WITH LOGIN PASSWORD 'admin_pass';postgres-# ALTER ROLE admin CREATEDB;
-
Quit
psqlthen log in again using the new user that previously created.postgres-# \qpsql postgres -U admin
-
Type this command to creating a new database.
postgres=> CREATE DATABASE db_want_to_make_admin_panel_for_my_online_book_store_;
-
Then give that new user privileges to the new database then quit the
psql.postgres=> GRANT ALL PRIVILEGES ON DATABASE db_want_to_make_admin_panel_for_my_online_book_store_ TO admin;postgres=> \q
Api Documentation (Swagger)
http://localhost:8080/api-docs (local host)
Setup database tables or update after schema change
yarn db:migrate
Seed the initial data (admin accounts, relevant for the first setup):
yarn db:seed
Start build:
yarn start