{"id":21012335,"url":"https://github.com/codebanesr/anywhr-backend","last_synced_at":"2026-01-02T03:32:23.323Z","repository":{"id":44021014,"uuid":"230130728","full_name":"codebanesr/anywhr-backend","owner":"codebanesr","description":"Find your travel destinations, from famous movie spot","archived":false,"fork":false,"pushed_at":"2023-03-03T11:24:25.000Z","size":6683,"stargazers_count":0,"open_issues_count":3,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-01-20T11:29:28.318Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"TSQL","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/codebanesr.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null}},"created_at":"2019-12-25T16:58:21.000Z","updated_at":"2019-12-29T09:59:11.000Z","dependencies_parsed_at":"2023-07-27T07:46:11.058Z","dependency_job_id":null,"html_url":"https://github.com/codebanesr/anywhr-backend","commit_stats":null,"previous_names":["codebanesr/anywhr-backend"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/codebanesr%2Fanywhr-backend","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/codebanesr%2Fanywhr-backend/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/codebanesr%2Fanywhr-backend/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/codebanesr%2Fanywhr-backend/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/codebanesr","download_url":"https://codeload.github.com/codebanesr/anywhr-backend/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243437965,"owners_count":20290864,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-19T09:36:19.862Z","updated_at":"2026-01-02T03:32:18.275Z","avatar_url":"https://github.com/codebanesr.png","language":"TSQL","readme":"\n# anywhr-backend\nFind your travel destinations, from famous movie spot\n\n# Documentation Coverage for frontend \nhttp://3.1.20.178:3000/documentation\n\n#### Entry point\n` app.js is the entry point of the application, however when running in production run bin/www`\n\n#### Features\n\u003eImplemented real time search functionality using rxjs's debounce, distinct until changed operator\n\u003eon angular form's input element, which exposes an event that is fired everytime value of input box \n\u003echanges\n\u003e![Alt text](./git_images/Screenshot\u0026#32;2019-12-29\u0026#32;at\u0026#32;2.37.47\u0026#32;AM.png?raw=true \"Real Time Search\")\n\n\u003e Movie Location and definition from wiki pages\n\u003e On clicking any one of the locations, the app will look for that title on wikipedia and populate\n\u003e results on the grey area\n\u003e![Alt text](./git_images/Screenshot\u0026#32;2019-12-29\u0026#32;at\u0026#32;2.38.18\u0026#32;AM.png \"Movie Location Scroller\")\n\n\u003ePagination implementation in angular\n\u003e![Alt text](./git_images/Screenshot\u0026#32;2019-12-29\u0026#32;at\u0026#32;2.38.31\u0026#32;AM.png?raw=true \"Pagination\")\n\n\n\nExample\n` http://3.1.20.178:3000/movie?title=180 `\n\n### Running locally\n`git clone https://github.com/shanurrahman/anywhr-backend.git`\n`cd anywhr-backend`\n`npm install`\n`browse localhost:3000`\n\n### To improve upon the frontend\n`cd ..`\n`git clone https://github.com/shanurrahman/anywhr-frontend.git`\n`npm run compodoc`\n`ng build --prod`\n\nNow run your backend server\n`cd ../anywhr-backend \u0026\u0026 npm start`\ngoto : localhost:3000\n\nNote:\n* For this process to run both anywhr-frontend and backend should be in the same folder\n\n### Using Docker\nFrom the root directory\n`docker build --tag=\"anywhr:anywhr\" ./`\ndocker image ls =\u003e find the id of your image and do a `docker run -d --restart=always -p 3000:3000 image_name:version`\nIn our case it is going to be `docker run -d --restart=always -p 3000:3000 \u003cimage_id\u003e`\ngoto `localhost:3000`\n\n* you can also use the image id if tag was not created\n\n\u003e Building an image from dockerfile\n\u003e![Alt text](./git_images/docker/starting\u0026#32;a\u0026#32;container.png \"Dockerdoc\")\n\n\u003e Running docker container from that image\n\u003e![Alt text](./git_images/docker/Screenshot\u0026#32;2019-12-29\u0026#32;at\u0026#32;3.05.49\u0026#32;PM.png \"Dockerdoc\")\n\u003e![Alt text](./git_images/docker/Screenshot\u0026#32;2019-12-29\u0026#32;at\u0026#32;3.04.58\u0026#32;PM.png \"Dockerdoc\")\n\u003e![Alt text](./git_images/docker/Screenshot\u0026#32;2019-12-29\u0026#32;at\u0026#32;3.05.49\u0026#32;PM.png \"Dockerdoc\")\n\n\n\n\n### Production build instructions\nupdate the .env file, your db credentials, put NODE_ENV=development to enable full logging\n* You may use this docker image inside a docker stack and use it with production but that will require\n* docker and docker compose installation first, for an app of this size I would not actually recommend \n* going with that approach, Here I am using pm2 and pm2-logrotate for the same purpose\n  \n\n##### npm install\n\n##### Install pm2 globally\n```\n$ pm2 stop     \u003capp_name|namespace|id|'all'|json_conf\u003e\n$ pm2 restart  \u003capp_name|namespace|id|'all'|json_conf\u003e\n$ pm2 delete   \u003capp_name|namespace|id|'all'|json_conf\u003e\n```\n`$ sudo pm2 start bin/www`\n\n##### Install pm2 logrotate, prevents memory leak issues on the server\n`pm2 install pm2-logrotate`\n\n\n### Notes to the reviewer [Handling memory leaks in postgres]\n\u003e For one line postgres statements that dont require a transaction block we can simply use pg pools \n\u003e that way we dont have to deal with closing the database queries\n\u003e More on it here\n\u003e https://node-postgres.com/api/pool\n\n\n\n#### Database tables\n```\ncreate table movie\n(\n\ttitle varchar(256) not null\n\t\tconstraint movie_pkey\n\t\t\tprimary key,\n\trelease_year varchar(128),\n\tfun_facts varchar(339),\n\tproduction_company varchar(256) default 'N/A'::character varying,\n\tdistributor varchar(256),\n\tdirector varchar(79),\n\twriter varchar(49),\n\tactor_1 varchar,\n\tactor_2 varchar,\n\tactor_3 varchar\n);\n```\n\n\n```\ncreate table movie_location\n(\n\ttitle varchar(45) not null,\n\tlocations varchar(110)\n);\n\n```\n\n\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcodebanesr%2Fanywhr-backend","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcodebanesr%2Fanywhr-backend","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcodebanesr%2Fanywhr-backend/lists"}