{"id":51014930,"url":"https://github.com/nicknaskida/design-patterns-final-project","last_synced_at":"2026-06-21T09:01:36.751Z","repository":{"id":361338257,"uuid":"1245693627","full_name":"NickNaskida/design-patterns-final-project","owner":"NickNaskida","description":null,"archived":false,"fork":false,"pushed_at":"2026-06-19T11:08:51.000Z","size":59,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2026-06-19T13:10:12.605Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Python","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/NickNaskida.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,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2026-05-21T13:15:28.000Z","updated_at":"2026-06-19T11:08:54.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/NickNaskida/design-patterns-final-project","commit_stats":null,"previous_names":["nicknaskida/design-patterns-final-project"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/NickNaskida/design-patterns-final-project","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/NickNaskida%2Fdesign-patterns-final-project","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/NickNaskida%2Fdesign-patterns-final-project/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/NickNaskida%2Fdesign-patterns-final-project/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/NickNaskida%2Fdesign-patterns-final-project/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/NickNaskida","download_url":"https://codeload.github.com/NickNaskida/design-patterns-final-project/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/NickNaskida%2Fdesign-patterns-final-project/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":34603583,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-06-21T02:00:05.568Z","response_time":54,"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":[],"created_at":"2026-06-21T09:01:31.552Z","updated_at":"2026-06-21T09:01:36.740Z","avatar_url":"https://github.com/NickNaskida.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Movie Ratings\n\nDjango app for a design patterns course project. Stores movies in SQLite and lists them on a simple HTML page.\n\n## What you need first\n\n- **Python 3.10 or newer** (3.12 is fine)\n- A terminal (Terminal on Mac, PowerShell or Command Prompt on Windows)\n- This project folder on your machine\n\nCheck Python:\n\n```bash\npython3 --version\n```\n\nIf that fails on Windows, try:\n\n```bash\npy --version\n```\n\n---\n\n## Project setup (step by step)\n\nDo everything from the **project root** — the folder that contains `manage.py`.\n\n### 1. Open the project folder\n\n```bash\ncd path/to/design-patterns-final-project\n```\n\nReplace `path/to/` with wherever you cloned or unzipped the repo.\n\n### 2. Create a virtual environment\n\nThis keeps project packages separate from the rest of your system.\n\n**Mac / Linux:**\n\n```bash\npython3 -m venv .venv\nsource .venv/bin/activate\n```\n\n**Windows (Command Prompt or PowerShell):**\n\n```bash\npython -m venv .venv\n.venv\\Scripts\\activate\n```\n\nYou should see `(.venv)` at the start of your terminal line. That means the venv is active.\n\nIf you close the terminal later, run the `activate` command again before working on the project.\n\n### 3. Install dependencies\n\n```bash\npip install -r requirements.txt\n```\n\nWait until it finishes without errors.\n\n### 4. Create the database and sample data\n\n```bash\npython scripts/setup_database.py\n```\n\nThis does two things:\n\n1. **Migrations** — creates `db.sqlite3` and the tables Django needs (including `Movie`)\n2. **Seed** — adds five sample movies\n\nYou should see migration output, then something like `added 5 movies`.\n\nIf you already have movies in the database, you might see `nothing to add (db not empty?)` instead. That is normal.\n\n**Manual alternative** (same result):\n\n```bash\npython manage.py migrate\npython manage.py seed_movies\n```\n\n### 5. Start the server\n\n```bash\npython manage.py runserver\n```\n\nLeave this terminal window open while you use the app.\n\nOpen a browser and go to:\n\n**http://127.0.0.1:8000/**\n\nYou should see a table of movies (title, director, year, genre, rating).\n\nTo stop the server: press `Ctrl+C` in that terminal.\n\n### Who can do what\n\nSo basically anyone can look at the movie list and rate stuff if they're logged in. But adding, editing, or deleting movies is staff-only, you won't even see those buttons unless you're a staff user. Regular people just sign up through the register page like normal. For a staff account (the one that can manage movies), run `python manage.py createsuperuser` and follow the prompts, Django marks that user as staff automatically. Log in with that account and you'll get the add/edit/delete options. Log in with a normal registered user and you won't, which is what we want.\n\n---\n\n## Starting over (fresh database)\n\nIf something is broken or you want empty tables again:\n\n```bash\nrm db.sqlite3\npython scripts/setup_database.py\npython manage.py runserver\n```\n\nOn Windows PowerShell:\n\n```powershell\nRemove-Item db.sqlite3\npython scripts/setup_database.py\npython manage.py runserver\n```\n\n---\n\n## Common problems\n\n| Problem | What to try |\n|---------|-------------|\n| `python3: command not found` | Use `python` instead of `python3` |\n| `No module named django` | Activate `.venv`, then run `pip install -r requirements.txt` again |\n| Port already in use | Run `python manage.py runserver 8001` and open http://127.0.0.1:8001/ |\n| Page shows no movies | Run `python manage.py seed_movies` or `python scripts/setup_database.py` |\n| Changed `models.py` | Run `python manage.py makemigrations` then `python manage.py migrate` |\n\n---\n\n## Commands\n\n| Command | Description |\n|---------|-------------|\n| `python scripts/setup_database.py` | Migrate and seed (easiest first-time setup) |\n| `python manage.py migrate` | Apply migrations only |\n| `python manage.py makemigrations` | Create new migration files after model changes |\n| `python manage.py seed_movies` | Add sample movies (skips if DB already has movies) |\n| `python manage.py runserver` | Start the dev server |\n| `python manage.py createsuperuser` | Optional — for Django admin at `/admin/` |\n\n---\n\n## Layout\n\n```\nmovieratings/     project settings and urls\nmovies/\n  models.py\n  migrations/     0001_initial.py (Movie)\n  views.py\n  patterns/       repository, factory\n  services/       movie_service\n  templates/\n  management/commands/seed_movies.py\nscripts/setup_database.py\n```\n\n---\n\n## Patterns\n\n- **MVT** — `Movie` model, `movie_list` view, HTML template\n- **Repository** — `movies/patterns/repository.py` (`MovieRepository`, `DjangoMovieRepository`)\n- **Factory** — `movies/patterns/factory.py` (`MovieDataFactory` for seed data)\n- **Service layer** — `movies/services/movie_service.py` used by views and seed command\n\n---\n\n## References\n\n- [Django docs](https://docs.djangoproject.com/en/stable/)\n- [SQLite](https://www.sqlite.org/docs.html)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnicknaskida%2Fdesign-patterns-final-project","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fnicknaskida%2Fdesign-patterns-final-project","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnicknaskida%2Fdesign-patterns-final-project/lists"}