From c6bc89ee2c9d9e776713abf954b1413770e24ddb Mon Sep 17 00:00:00 2001 From: Kfir Dayan Date: Wed, 26 Apr 2023 21:01:49 +0300 Subject: [PATCH] README --- README.md | 50 +++++++++++++++----------------------------------- package.json | 3 ++- 2 files changed, 17 insertions(+), 36 deletions(-) diff --git a/README.md b/README.md index 9169135..648dc44 100644 --- a/README.md +++ b/README.md @@ -1,41 +1,21 @@ +# DropIt Example Project # -examples - +Delivery System using Nodejs [Typescript], Express, axios, knex, pg (not implemented yet), in-memory caching. -POST localhost:3000/resolve-address - { - "searchTerm": "38%20Upper%20Montagu%20Street%2C%20London%20W1H%201LJ%2C%20United%20Kingdom" - } - - - -install pg MacOS - - Install Homebrew - - /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)" - - Install Postgres - - brew install postgresql +## Installation - Start Postgres - - brew services start postgresql - - Postgres CLI - - psql postgres + ### Git ### + clone the project and run `npm install` to install all the dependencies. -init POSTGRES Database - - CREATE DATABASE drop_shopping; + ### typescript - ### + run `tsc` to compile the typescript files to javascript. + or + run `npm run build` to compile the typescript files to javascript. -create tables - - CREATE TABLE deliveries ( - id SERIAL PRIMARY KEY, - user_id INTEGER NOT NULL, - slot_id INTEGER NOT NULL, - delivery_date DATE NOT NULL, - address TEXT NOT NULL, - status VARCHAR(10) NOT NULL -); + ### Server ### + run `npm run dev` to start the server in development mode. - -knex for migration files - npx knex migrate:make create_addresses_table - npx knex migrate:latest --env development - npx knex migrate:rollback --env development \ No newline at end of file + ### Database ### + run `npm run migrate` to create the database tables. + run `npm run seed` to seed the database with some data. + \ No newline at end of file diff --git a/package.json b/package.json index 0f1e292..66772a0 100644 --- a/package.json +++ b/package.json @@ -5,7 +5,8 @@ "main": "index.js", "scripts": { "test": "echo \"Error: no test specified\" && exit 1", - "dev": "nodemon dist/index.js" + "dev": "nodemon dist/index.js", + "build": "npx tsc" }, "keywords": [], "author": "",