Developing a Server-Side Web App for Movie Details

Website

Overview

This is the server-side of a movie web application, responsible for managing data and handling user requests. The app provides users with detailed information about various movies, their directors, and genres, offering a rich browsing experience. Users can sign up and log in, securely managing their profiles and updating their personal information.


They can also create and maintain a personalized list of favorite movies, tailored to their preferences. The server ensures secure data handling, efficient performance, and smooth integration with the client-side interface. This design ensures a reliable, user-friendly platform for movie enthusiasts.

Role

Platform

Duration

Technology

Tools

Developer

Desktop

Node.js, Express, MongoDB, Passport  Mongoose,Bcrypt,Morgan,bodyparser, CORS  Express validator, JsonWebToken

3 months

VS Code, Atlas, Heroku, Postman

#Steps

Developing Process

The development process for the movie-api involved building the server-side of a movie application using Node.js, Express, and MongoDB. Initially, I set up the Node.js environment and integrated Express to handle routing and server functionalities. The MongoDB database was used to store movie, user, and director data, and Mongoose was utilized to model the database schema and handle database queries. I created several REST API endpoints to manage movies, genres, directors, and user data with HTTP methods (GET, POST, PUT, and DELETE) for CRUD operations. JSON Web Token (JWT) was used for secure user authentication, while bcrypt was integrated for password hashing. The application also features a CORS middleware for handling cross-origin requests and express-validator to validate incoming data. After coding the API endpoints, I thoroughly tested them using Postman to ensure correct functionality. For deployment, I used Heroku to host the API and MongoDB Atlas for the cloud database. The app allows users to sign up, log in, and manage their favorite movies, while the API handles requests like retrieving movie and user data, updating profiles, and adding/removing movies from favorite lists.

#Steps

Next

  • Implement JWT-based authentication and authorization to make sure only authenticated users can update or delete their data, like user info and favorite movies.

  • Improve error handling with more specific, meaningful messages to make debugging easier and enhance the user experience.

  • Allow users to update their profile pictures and manage a more detailed profile, including a history of recently watched movies.

  • Monitor performance and optimize MongoDB queries by adding indexes on frequently queried fields, such as movie titles or genres.

#Learning

Takeaways

  • I learned how to create a fully functional server-side API using Node.js and Express, applying CRUD operations (Create, Read, Update, Delete) to interact with a MongoDB database.

  • I gained experience implementing user authentication and authorization using JWT to ensure secure access to the app's features, such as updating or deleting user data and favorite movies.

  • I improved my skills in MongoDB by designing the schema for movies, directors, genres, and users, and learned how to integrate Mongoose for data modeling and simplifying interactions with the database.

  • I also gained knowledge of securing user data by using bcrypt for password hashing and JWT for creating secure authentication tokens.

  • I mastered Postman for testing and documenting the API, ensuring that the endpoints work correctly and return accurate data for all requested operations. Lastly,

  • I successfully deployed the API on Heroku for public access and used MongoDB Atlas for database hosting, gaining valuable hands-on experience with cloud platforms.