Giter Site home page Giter Site logo

yamdb's Introduction

YAMDB Application

This Readme is a WIP

The "Yet Another Movie Database" is an application made to showcase my ability to learn new libraries/tools.

Requirements

Installation

Assuming you have the usage of the Symfony CLI, Composer and Git VCS:

**In your CLI: ** use the git command to clone the YAMDB repo:

git clone https://github.com/dajukz/YAMDB.git

This should have created a folder YAMDB, you can check this using
ls -al
After this you can pull from origin:

cd YAMDB/
git pull origin main

Now you are ready to start the server and go to the webpage on your browser once the server has been started!

Usage

First Start:

On your first start you will have to do 4 things:

  • Let ddev create all images and Container
  • Install all composer packages
  • Install all npm modules
  • Populate the database (will take a while, +-20min)
ddev start
ddev composer install
ddev npm i

Once those are successful you can start by filling in your .env file:
cp .env .env.local
Then you can fill in your .env.local file with your own personal data
These need to be filled in:

  • DATABASE_URL
  • TMDB_TOKEN

For me the DATABASE_URL constant looked like this: mysql://{user}:{password}@YAMDB-db:3306/app?serverVersion=8.0.33&charset=utf8mb4
and {user} and {password} need to be replaced by the database user and its respective password.

The TMDB_TOKEN is a Bearer token you can get when you have an account from TMDB API.

After filling in these in your .env.local you can start populating the database:

ddev ssh
php bin/console doctrine:fixtures:load

Extra

You can access the application in your browser at the URL given by ddev or by running in your CLI:

ddev launch

DB population Explanation

Because the population of the database happens by fetching a ton of data from an API the command doing this has a built-in limiter to make sure it doesn't get blocked by the rate-limiter of TMDB API. Because of this it might take a while to load the fixture.

While the fixture is running you will be able to see the logs at /var/log/dev.log So if there is any issue it will appear there. You will also be able to see the progress of the command.

If the command takes too long for your liking, you can always go change the iterations in /src/DataFixtures/AppFixtures.php. You can do this by changing the iterator $i on line 38 from 5 to something lower. Keep in mind though that the command only flushes (and inserts into db) every 100 iterations, so per 2000 movies roughly.

yamdb's People

Contributors

dajukz 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.