This project is a Templete for CRUD App Using Following Technologies :-
- Postgres Database
- NodeJs Server
- Express FrameWork
- Powered typesScript Langauge
$ npm install
POSTGRES_HOST=localhost
POSTGRES_DB=postgres
POSTGRES_TEST_DB=postgres
POSTGRES_USER=postgres
POSTGRES_PASSWORD=12345
ENV=dev
-
First Download docker & install needed images
-
Setting Up PostgresSQL with this commands :-
$ docker run \
--name postgres \
-e POSTGRES_PASSWORD=yourpassword \
-p 5432:5432 \
-d postgres
- then start the CLI with this command :-
$ docker exec -ti -u postgres postgres psql
- in your project directory init this command to migrate db
$ db-migrate up
this will migrate database to start however in the testing migration donw automatically...
$ nodemon src/server.ts
OR
$ tsc-watch --esModuleInterop src/server.ts --outDir ./dist --onSuccess \"node ./dist/server.js\"
$ npx tsc
$ ENV=test db-migrate --env test up && tsc && jasmine && db-migrate --env test down && npm run clean
OR
$ npx tsc && jasmine