├── .gitignore ├── public ├── images │ ├── imdb.png │ ├── meta.png │ ├── rotten.png │ └── background.png └── css │ └── style.css ├── views ├── partials │ ├── footer.ejs │ └── header.ejs ├── error.ejs ├── homepage.ejs └── movieInfo.ejs ├── Readme.md ├── package.json └── app.js /.gitignore: -------------------------------------------------------------------------------- 1 | node_modules 2 | Procfile 3 | -------------------------------------------------------------------------------- /public/images/imdb.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/itsarvindhere/MoviesInfo/HEAD/public/images/imdb.png -------------------------------------------------------------------------------- /public/images/meta.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/itsarvindhere/MoviesInfo/HEAD/public/images/meta.png -------------------------------------------------------------------------------- /public/images/rotten.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/itsarvindhere/MoviesInfo/HEAD/public/images/rotten.png -------------------------------------------------------------------------------- /public/images/background.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/itsarvindhere/MoviesInfo/HEAD/public/images/background.png -------------------------------------------------------------------------------- /views/partials/footer.ejs: -------------------------------------------------------------------------------- 1 | 6 | 7 | -------------------------------------------------------------------------------- /Readme.md: -------------------------------------------------------------------------------- 1 | # MoviesInfo 2 | Get Information about any Movie with a Single Click! 3 | 4 | ## Getting Started 5 | 6 | This Simple website was created using Node.js, Express.js and EJS (Embedded JS Templates). To get the Movies Data, OMDB Api was used. 7 | 8 | You can see the live website here - https://moviesinfo-wpm0.onrender.com/ 9 | -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "movies", 3 | "version": "1.0.0", 4 | "description": "", 5 | "main": "app.js", 6 | "scripts": { 7 | "test": "echo \"Error: no test specified\" && exit 1" 8 | }, 9 | "author": "", 10 | "license": "ISC", 11 | "dependencies": { 12 | "axios": "^0.19.2", 13 | "body-parser": "^1.19.0", 14 | "ejs": "^3.1.3", 15 | "express": "^4.17.1" 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /views/error.ejs: -------------------------------------------------------------------------------- 1 | <%- include ("partials/header") %> 2 | 3 |
4 | 5 |
6 |

OOPSIE!!

7 |

Sorry! We don't have Information About this Movie.

8 | 9 |
10 | 11 |
12 | 13 |
14 |
15 | 16 | 17 | 18 | <%- include ("partials/footer") %> -------------------------------------------------------------------------------- /views/homepage.ejs: -------------------------------------------------------------------------------- 1 | <%- include ("partials/header") %> 2 | 3 |
4 | 5 |
6 |

MoviesInfo

7 |

A Simple Website on which you can get details of a Movie by typing its name in the Search Box below.

8 | 9 |
10 |
11 | 12 | 13 |
14 |
15 |
16 | 17 |
18 | 19 |
20 |
21 |
22 |
23 | 24 | <%- include ("partials/footer") %> -------------------------------------------------------------------------------- /views/partials/header.ejs: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | MovieInfo - Get Information About any Movie 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 17 | 18 | -------------------------------------------------------------------------------- /public/css/style.css: -------------------------------------------------------------------------------- 1 | body { 2 | font-family: "poppins"; 3 | } 4 | 5 | .title{ 6 | text-align: center; 7 | 8 | } 9 | 10 | .title h1 { 11 | font-weight: 700; 12 | 13 | } 14 | 15 | 16 | .container-fluid { 17 | max-width: 80%; 18 | } 19 | .home { 20 | color: white; 21 | background-image: linear-gradient(to right,rgb(0, 0, 0, .9), rgb(0, 0, 0, .9)), url(/images/background.png); 22 | background-size: cover; 23 | background-position: center; 24 | } 25 | 26 | footer { 27 | text-align: center; 28 | } 29 | 30 | .card-title { 31 | font-weight: 700; 32 | text-align: center; 33 | font-size: 4rem; 34 | } 35 | 36 | .movie-card { 37 | padding: 2rem; 38 | } 39 | 40 | 41 | .rating-text { 42 | font-size: 2rem; 43 | } 44 | 45 | .rating-card { 46 | margin-bottom: 1rem; 47 | } 48 | 49 | .movie-plot { 50 | margin-bottom: 2rem; 51 | } 52 | 53 | .rating-image { 54 | height: 50px; 55 | 56 | } 57 | 58 | @media (max-width: 1317px) { 59 | 60 | .card-title { 61 | 62 | font-size: 2rem; 63 | } 64 | 65 | .rating-image { 66 | height: 35px; 67 | 68 | } 69 | 70 | } 71 | 72 | -------------------------------------------------------------------------------- /app.js: -------------------------------------------------------------------------------- 1 | const express = require("express"); 2 | const bodyParser = require("body-parser"); 3 | const https = require("https"); 4 | const axios = require("axios"); 5 | 6 | 7 | const app = express(); 8 | 9 | app.use(bodyParser.urlencoded({extended : true})); 10 | app.use(express.static('public')); 11 | app.set('view engine', 'ejs'); 12 | 13 | 14 | app.get("/", function(req,res){ 15 | 16 | 17 | res.render('homepage'); 18 | }); 19 | 20 | app.post("/", function(req,res){ 21 | const movieName = req.body.movieName; 22 | const url = "https://www.omdbapi.com/?apikey=86f9dde7&t="+movieName; 23 | axios.get(url).then(response => { 24 | 25 | if(response.data.Response === "True"){ 26 | res.render('movieInfo', { 27 | movieTitle : response.data.Title, 28 | moviePlot : response.data.Plot, 29 | moviePoster : response.data.Poster, 30 | imdbRating : typeof response.data.Ratings[0] === 'undefined'? "-/-" :response.data.Ratings[0].Value , 31 | rottenRating : typeof response.data.Ratings[1] === 'undefined'? "-/-" :response.data.Ratings[1].Value , 32 | metacriticRating: typeof response.data.Ratings[2] === 'undefined'? "-/-" :response.data.Ratings[2].Value , 33 | genre : response.data.Genre, 34 | director : response.data.Director, 35 | language : response.data.Language, 36 | awards : response.data.Awards, 37 | rated : response.data.Rated 38 | }); 39 | } else{ 40 | res.render('error'); 41 | } 42 | 43 | 44 | }) 45 | 46 | }); 47 | 48 | app.post("/back", function(req,res){ 49 | res.redirect("/"); 50 | }) 51 | 52 | app.listen(process.env.PORT || 3000, function(){ 53 | console.log("Server Started at Port 3000"); 54 | }); -------------------------------------------------------------------------------- /views/movieInfo.ejs: -------------------------------------------------------------------------------- 1 | <%- include ("partials/header") %> 2 |
3 | 4 |
5 | 6 |
7 | 8 | 9 |
10 |
11 |
12 | <%= movieTitle %> 13 |
14 | 15 | 16 |
17 |
18 |
<%= movieTitle %>
19 |

<%= moviePlot %>

20 | 21 | 22 |
    23 |
  • Genre — <%=genre%>
  • 24 |
  • Director — <%=director%>
  • 25 |
  • Language — <%=language%>
  • 26 |
  • Awards — <%=awards%>
  • 27 |
  • Rated — <%=rated%>
  • 28 |
29 | 30 | 31 | 32 |
33 |
34 |
35 |
36 |
IMDB
37 |

<%=imdbRating%>

38 |
39 |
40 |
41 |
42 |
43 |
44 |
IMDB
45 |

<%=rottenRating%>

46 |
47 |
48 |
49 | 50 |
51 |
52 |
53 |
IMDB
54 |

<%=metacriticRating%>

55 |
56 |
57 |
58 |
59 | 60 | 61 |
62 |
63 | 64 | 65 | 66 |
67 |
68 | 69 |
70 | 71 | 72 | 73 | 74 | 75 | <%- include ("partials/footer") %> 76 | --------------------------------------------------------------------------------