Giter VIP home page Giter VIP logo

enesuraz / cine-search Goto Github PK

View Code? Open in Web Editor NEW
0.0 1.0 0.0 681 KB

A comprehensive repository containing the frontend and backend components of the CineSearch application. It includes HTML, CSS, and JavaScript files for the frontend, along with Node.js files for the backend implementation. Additionally, Dockerfiles are provided for easy deployment of the entire application stack using Docker

Home Page: https://cine-search-ft7i.onrender.com

Dockerfile 0.74% JavaScript 66.47% HTML 7.97% SCSS 24.82%
apikey-authentication docker dockerfile event-subscriber mvc-pattern

cine-search's Introduction

CineSearch is a comprehensive film search and management platform that allows users to search for films, add them to watchlists, and navigate through a collection of movies. It covers frontend and backend aspects utilizing Object-Oriented Programming (OOP), the Event Subscriber Pattern, and the Model-View-Controller (MVC) pattern for efficient and organized development.If you want to test application visit CineSearch

Features

  • Search by Actors or Genre: Users can search for films based on actors' names or genre names, providing a flexible and - intuitive search experience.
  • Add Film: Allows users to add new films to the database, including detailed information such as title, release date, runtime, genre, actors, plot, poster URL, IMDb rating, and IMDb ID.
  • Add and Remove Watchlist: Enables users to add films to their watchlist for easy access and manage their watchlist by removing films as needed.
  • Page Navigation for Preview: Provides seamless page navigation for previewing film details and navigating between different sections of the application.
  • Object-Oriented Programming (OOP): Utilizes OOP principles to structure and organize code, enhancing code readability and maintainability.
  • Event Subscriber Pattern: Implements the event subscriber pattern to handle communication between different components of the frontend, ensuring loose coupling and flexibility.
  • MVC Pattern: Adheres to the Model-View-Controller (MVC) pattern for separating concerns and maintaining a clear structure in the frontend architecture.
  • Generate API Keys: Provide a mechanism for users to generate unique API keys upon registration or account creation.

API Endpoints

Register User

  • Endpoint: api/v1/register
  • Method: POST
  • Description: Register a new user with a unique username and email address.

Get All Films

  • Endpoint: api/v1/films/?api_key=api_key
  • Method: GET
  • Description: Retrieve a list of all available films stored in the database.

Add Film

  • Endpoint: api/v1/films/?api_key=api_key
  • Method: POST
  • Description: Add a new film to the database with detailed information including title, release date, runtime, year, genre, actors, plot, poster URL, IMDb rating, and IMDb ID.

Get Film by ID

  • Endpoint: api/v1/films/:id/?api_key=api_key
  • Method: GET
  • Description: Retrieve details of a specific film by providing its unique identifier.

Search Films

  • Endpoint: api/v1/films/?q=query&api_key=api_key
  • Method: GET
  • Description: Search for films by providing a query string containing an actor's name or a genre name. Returns a list of films matching the search criteria.

API Usage

To use the CineSearch API endpoints:

  1. Make requests to the desired endpoint using the appropriate HTTP method and parameters.

  2. Review the response to see the returned film data or confirmation message.

All Requests

Here are all requests you can make using the CineSearch API endpoints:

POST api/v1/register
Content-Type: application/json

{
    "username": "example_user",
    "email": "[email protected]"
}

GET api/v1/films/?api_key=YOUR_API_KEY

POST api/v1/films/?api_key=YOUR_API_KEY
Content-Type: application/json

{
    "title": "Example Film",
    "year": 2023,
    "runtime": 120,
    "released": new Date(),
    "genre": ["Action", "Adventure"],
    "actors": ["Actor 1", "Actor 2"],
    "plot": "This is an example plot.",
    "poster": "https://example.com/poster.jpg",
    "imdbRating": 7.5,
    "imdbID": "tt1234567"
}

GET api/v1/films/123456/?api_key=YOUR_API_KEY

GET api/v1/films/?api_key=YOUR_API_KEY&q="Actor or genre name"

Getting Started

  1. Clone this repository to your local machine:
git clone https://github.com/enesuraz/cine-search.git
  1. Navigate to the cloned repository:
cd cine-search
  1. Navigate to the backend and create config.env in backend directory and type those values:
NODE_ENV=production
MONGO_SERVER=YOUR_MONGO_SERVER
PORT=PORT_YOU_WANT_APPLICATION_RUNNING

Note

If you want to run in development mode, firstly change NODE_ENV=development,then:

  • Firstly install all neccessary packages typing "npm run install" when in main directory
  • Navigate frontend/src/js/utils/config.js file and change url "http://localhost:YOUR_PORT/api/v1/films"
  • Type "npm run dev" in the main directory
  • Open browser and type url which given by parcel
  1. Type belowed command in your terminal when you are in backend directory
npm run watch
  1. Open postman or like postman application post request api/v1/register endpoint (look api usage!)

  2. Get the returned api_key value and navigate frontend directory

  3. Open config.js file in src/js/utils folder and replace api_key

  4. Navigate cine-search top-level directory in your terminal and type belowed command

docker build . --build-arg port=PORT_YOUR_SPECIFID_IN_BACKEND -t TAGNAME_YOUR_WANT
  1. Type belowed command for creating container
docker run -it -p APPLICATION_RUNNING_PORT:PORT_YOUR_SPECIFIED TAGNAME

Note

If you don't want to docker, follow up these steps

  • Firstly install all neccessary packages typing "npm run install" when in main directory
  • Navigate frontend in your terminal and type "npm run deploy"
  • Then jump into 10. step
  1. After all of that open your browser and go to belowed url
http://localhost:APPLICATION_RUNNING_PORT/

Contact

For any inquiries or feedback, please contact [email protected].

cine-search's People

Contributors

enesuraz avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.