Find your travel destinations, from famous movie spot
http://3.1.20.178:3000/documentation
app.js is the entry point of the application, however when running in production run bin/www
Implemented real time search functionality using rxjs's debounce, distinct until changed operator on angular form's input element, which exposes an event that is fired everytime value of input box changes
Movie Location and definition from wiki pages On clicking any one of the locations, the app will look for that title on wikipedia and populate results on the grey area
Example
http://3.1.20.178:3000/movie?title=180
git clone https://github.com/shanurrahman/anywhr-backend.git
cd anywhr-backend
npm install
browse localhost:3000
cd ..
git clone https://github.com/shanurrahman/anywhr-frontend.git
npm run compodoc
ng build --prod
Now run your backend server
cd ../anywhr-backend && npm start
goto : localhost:3000
Note:
- For this process to run both anywhr-frontend and backend should be in the same folder
From the root directory
docker build --tag="anywhr:anywhr" ./
docker image ls => find the id of your image and do a docker run -d --restart=always -p 3000:3000 image_name:version
In our case it is going to be docker run -d --restart=always -p 3000:3000 <image_id>
goto localhost:3000
- you can also use the image id if tag was not created
update the .env file, your db credentials, put NODE_ENV=development to enable full logging
- You may use this docker image inside a docker stack and use it with production but that will require
- docker and docker compose installation first, for an app of this size I would not actually recommend
- going with that approach, Here I am using pm2 and pm2-logrotate for the same purpose
$ pm2 stop <app_name|namespace|id|'all'|json_conf>
$ pm2 restart <app_name|namespace|id|'all'|json_conf>
$ pm2 delete <app_name|namespace|id|'all'|json_conf>
$ sudo pm2 start bin/www
pm2 install pm2-logrotate
For one line postgres statements that dont require a transaction block we can simply use pg pools that way we dont have to deal with closing the database queries More on it here https://node-postgres.com/api/pool
create table movie
(
title varchar(256) not null
constraint movie_pkey
primary key,
release_year varchar(128),
fun_facts varchar(339),
production_company varchar(256) default 'N/A'::character varying,
distributor varchar(256),
director varchar(79),
writer varchar(49),
actor_1 varchar,
actor_2 varchar,
actor_3 varchar
);
create table movie_location
(
title varchar(45) not null,
locations varchar(110)
);





