{"id":23395916,"url":"https://github.com/ghindea/imdb-database-simulator","last_synced_at":"2026-04-28T08:02:47.500Z","repository":{"id":222901723,"uuid":"733368044","full_name":"Ghindea/IMDb-Database-Simulator","owner":"Ghindea","description":"Java program that simulates some of the functionalities of IMDb","archived":false,"fork":false,"pushed_at":"2024-02-17T00:40:12.000Z","size":146,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-04-02T12:40:00.144Z","etag":null,"topics":["design-patterns","json","oop"],"latest_commit_sha":null,"homepage":"","language":"Java","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/Ghindea.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,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2023-12-19T07:05:17.000Z","updated_at":"2024-02-16T21:10:51.000Z","dependencies_parsed_at":null,"dependency_job_id":"a207fc2c-290c-44ab-967d-4c00e6ab8a06","html_url":"https://github.com/Ghindea/IMDb-Database-Simulator","commit_stats":null,"previous_names":["ghindea/imdb-database-simulator"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/Ghindea/IMDb-Database-Simulator","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Ghindea%2FIMDb-Database-Simulator","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Ghindea%2FIMDb-Database-Simulator/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Ghindea%2FIMDb-Database-Simulator/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Ghindea%2FIMDb-Database-Simulator/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Ghindea","download_url":"https://codeload.github.com/Ghindea/IMDb-Database-Simulator/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Ghindea%2FIMDb-Database-Simulator/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32371673,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-27T20:07:02.737Z","status":"online","status_checked_at":"2026-04-28T02:00:07.250Z","response_time":56,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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":["design-patterns","json","oop"],"created_at":"2024-12-22T07:19:27.356Z","updated_at":"2026-04-28T08:02:47.483Z","avatar_url":"https://github.com/Ghindea.png","language":"Java","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003cdiv align=\"center\"\u003e\n\n    ▀████▀████▄     ▄███▀███▀▀▀██▄ ▀███▀▀▀██▄   \n      ██   ████    ████   ██    ▀██▄ ██    ██    \n      ██   █ ██   ▄█ ██   ██     ▀██ ██    ██    \n      ██   █  ██  █▀ ██   ██      ██ ██▀▀▀█▄▄    \n      ██   █  ██▄█▀  ██   ██     ▄██ ██    ▀█    \n      ██   █  ▀██▀   ██   ██    ▄██▀ ██    ▄█    \n    ▄████▄███▄ ▀▀  ▄████▄████████▀ ▄████████    \n\n\u003c/div\u003e\n\n# **IMDB database simulator**\nby [Daniel Ghindea](https://github.com/Ghindea)\n### Dependencies\nThis program uses JSON.simple toolkit to save database elements in JSON files. To compile code in IntelliJ add JSON.simple dependency as it follows:\n\n    File \u003e Project Structure... \u003e Modules \u003e Dependencies \u003e + \u003e JARs or Directories \u003e json-simple-1.1.1.jar (located in project root)\n\n### Description\nThis Java program simulates simple functionalities of IMDb in a CLI environment, using OOP concepts, JSON files and Design Pattern principles. \n\n### Upcoming update\nGUI environment created with SWING package is on its way.\n\n### How it works\n- Tester.java is the class that contains `main()` method. Run it to launch program.\n- `IMDB` is the main class of the program. It is a singleton class that contains arrays that store `Production`, `User`, `Actor` objects. It also has 'run()' method that runs the program.\n- `Login`, `Parser` and `Actions` classes implement methods that perform the functionalities of the program\n- `UserFactory` and `ProductionFactory` are classes that define how different user and production types are created by following factory pattern principle.\n- `Observable` is a class used to implement observer pattern for different objects that suffers state changes : `Request`, `Actor`, `Production`\n\n### Program flow\n1. **Parsing files to memory**\n\n   - In order to keep data consistency from one run of the program to another, the database elements are saved in JSON files.\n   - At the beggining of every run `Parser.parseDatabaseToMemory()` method loads saved data into memory, every object type being added to its corresponding array list located in `IMDB`\n2. **Solving discrepancies**\n\n   - Since there are chances to have actors with performances or performances with actors that don't have a corresponding IMDb page, system automatically creates empty pages for them and sends edit requests to `Staff` members for those pages.\n   - To implement notifications functionality every `Observable` object requires a list of observers that is constructed accordingly to their relation with the subject.\n   \n3. **Logging in**\n\n   - To know which functionalities are available for a user it has to be logged in the platform. After the credentials are given, `Login.start()` method searches the user base and returns the `User` instance that matches the credentials.\n\n4. **Running the aplication**\n\n   - Depending on the account type of the logged user different commands are available (see below table).\n   - A menu with the available commands is displayed and an index is requested to select a command.\n   - Most of these functionalities are based on a loop system, meaning that the user will be able to make these actions until 'exit' or 'done' commands are given.\n\n5. **Running actions**\n\n   - `Actions` class contains static methods that implement all the required functionalities and static String members used for CLI display.\n\n6. **Logging out**\n\n   - When 'log out' command is given the main loop is breaked and the user has the option to log in again or to close the aplication.\n\n7. **Parsing memory to files**\n\n   - To save changes, before the program is finished, all elements of the database are parsed back into the original JSONs with `Parser.parseDatabaseToJSONs()` method.\n\n---\n\n| Option                      | Regular | Contributor | Admin |\n|-----------------------------|---------|----------|-----|\n| View all productions        | X       | X        | X   |\n| View all actors             | X       | X        | X   |\n| View all notifications      | X       | X        | X   |\n| Find in database            | X       | X        | X   |\n| Add page to favorites       | X       | X        | X   |\n| Push/Pull a request         | X       | X        |     |\n| Create/Delete a page        |         |          | X   |\n| View requests               |         | X        | X   |\n| Add a rating for production | X       |          |     |\n| Add/Delete user             |         |          | X   |\n| Log out                     | X       | X        | X   |\n\n---\n### Bibliography\n- [JSON parsing](https://www.geeksforgeeks.org/parse-json-java/)\n- [DP concepts](https://www.geeksforgeeks.org/java-design-patterns/?ref=lbp)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fghindea%2Fimdb-database-simulator","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fghindea%2Fimdb-database-simulator","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fghindea%2Fimdb-database-simulator/lists"}