'What you munching?' is a web application built using Angular 10 (Front End), Node.Js (Back End) & Postgresql (Database). โจ
Application collects favourite food along with a link to a description or recipe and stores it in a database. The data is then retrieved and displayed realtime.
-
NPM installed : NPMjs site
-
Angular CLI installed :
npm install -g @angular/cli
-
Postgresql : Postgresql site (Alternative: other sql databases)
The below configuration is written based on Postgresql. For other sql databases tweek as necessary.
-
Setup database on a postgresql server.
-
Create a table 'munchit' on the database using the below the script :
CREATE TABLE public.munchit
(
username text COLLATE pg_catalog."default",
location text COLLATE pg_catalog."default",
favouritefood text COLLATE pg_catalog."default",
foodlink text COLLATE pg_catalog."default",
id integer NOT NULL DEFAULT nextval('munchit_id_seq'::regclass),
CONSTRAINT munchit_pkey PRIMARY KEY (id)
)
-
Open db.sql at (\what-you-munching\backend\src\db.js) in a code editor.
-
Modify default database configuration below :
var db = {
user: 'postgres', //as configured on database
host: 'localhost', //if running on local
database: 'what-you-munching', //database name configured on server
password: '12345678', //as configured on database
port: 5432, //port database server is listening to as per server configuration
};
-
Open Command Prompt & navigate to solution folder. (\what-you-munching\backend)
-
Run command :
npm start
(This will start node backend that listens to port 3000 )
-
Open another Command Prompt & navigate to solution folder. (\what-you-munching)
-
Run command :
npm install
(This should install all the dependancies) -
Run command :
ng serve -o
(This will launch a new tab on browser with the active application : http://localhost:4200/)