From 5ea9c562c59dcab72285af4831ca1caffd25613f Mon Sep 17 00:00:00 2001 From: Ronja Fagerdahl Date: Tue, 3 Jun 2025 21:54:24 +0200 Subject: [PATCH 1/3] (documentation) Updated README and added MIT License --- LICENSE | 21 +++++++ README.md | 170 ++++++++++++++++++++++++++++++++++++++++++++++++------ 2 files changed, 172 insertions(+), 19 deletions(-) create mode 100644 LICENSE diff --git a/LICENSE b/LICENSE new file mode 100644 index 0000000..493470d --- /dev/null +++ b/LICENSE @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) 2025 Alexander, Robert, Dennis, Ronja, Patrik, Calle, Jimmy + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the โ€œSoftwareโ€), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED โ€œAS ISโ€, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. diff --git a/README.md b/README.md index 18e3c6d..fdddfd8 100644 --- a/README.md +++ b/README.md @@ -1,34 +1,166 @@ -# Branch Protection Rules for "main" +# ๐ŸŽฎ KINO-NextJS -## Rules in Place +![CI](https://github.com/AlexCode-dot/KINO-NextJS/actions/workflows/ci.yml/badge.svg) -### 1. Pull Requests Required +A fullstack Next.js application for movie enthusiasts โ€“ featuring dynamic routing, server-side rendering, MongoDB integration, and a clean, component-based UI. Built with care, discipline, and a love for code and great cinema. -- All changes to "main" must go through a pull request. -- Direct pushes to "main" are blocked. +--- + +## ๐Ÿš€ Live Demo + +๐Ÿ‘‰ [kino-nextjs.vercel.app](https://kino-nextjs.vercel.app) + +--- + +## ๐Ÿ› ๏ธ Tech Stack -### 2. Minimum 1 Approval +> This project leverages a modern fullstack setup optimized for performance, collaboration, and scalability. -- A pull request needs at least 1 approval from another team member before it can be merged. +### Frontend -### 3. Tests Must Pass +- **Next.js 15.3.1** โ€“ Running the latest major version with full App Router support +- **React 19** โ€“ With support for concurrent features and `use()` +- **SCSS Modules** โ€“ Scoped, maintainable styling per component +- **fetch API** โ€“ Handles data fetching from backend and external APIs -- Pull requests will only be mergeable if the "Tests CI" workflow passes. -- Make sure your branch passes "npm test" before requesting a review. +### Backend -### 4. Force Pushes Blocked +- **Next.js API Routes** โ€“ Backend logic under `app/api` +- **MongoDB Atlas** โ€“ Cloud-hosted NoSQL database for movies & bookings +- **Mongoose** โ€“ ODM for schema modeling (`Movie`, `Screening`, etc.) +- **OMDb API** โ€“ External source for movie metadata -- Force pushing to "main" is disabled to protect commit history. +### Testing -### 5. Deletions Blocked +- **Jest** โ€“ Unit testing framework with custom mocks +- **jest.unstable_mockModule** โ€“ For mocking ES module imports +- **formdata-node** โ€“ Simulates `formData()` in a Node.js test environment -- The "main" branch cannot be deleted accidentally. +### Tooling & Configuration + +- **Turbopack** โ€“ Next-gen bundler replacing Webpack for blazing fast dev builds +- **ESM (ECMAScript Modules)** โ€“ Clean import/export syntax +- **cross-env** โ€“ Environment variable support across platforms +- **Module Aliases (`@`)** โ€“ Shortcuts for cleaner imports (`@/lib/...`) + +--- + +## โœจ Modern Highlights + +- Built with **Next.js 15+ App Router** +- Using **Turbopack** for ultra-fast local development +- Full support for **React 19** and future-proof features +- Modular architecture using **Server Components** and **Server Actions** +- Supports **Partial Pre-Rendering** for mixed static/dynamic content +- Clean file structure under `/app/` --- -### Tips for Working with These Rules +## ๐Ÿ” Branch Protection Rules for `main` + +### โœ… Enforced Rules + +1. **Pull Requests Only** + + - No direct commits to `main`. All changes must go through PRs. + +2. **Minimum 1 Approval** + + - A PR must be approved by at least one other team member before merging. + +3. **CI Tests Must Pass** + + - PRs are only mergeable if the `Tests CI` workflow passes (`npm test`). + +4. **No Force Pushes** + + - Force pushing to `main` is completely disabled. + +5. **Deletion Protection** + + - The `main` branch cannot be deleted. + +--- + +## ๐Ÿ”„ Workflow & Collaboration + +1. Create a new feature branch off `main` +2. Commit your changes and push to remote +3. Open a pull request (PR) +4. Ensure all tests pass and CI is green +5. Request a review from another developer +6. Merge only when approved + +--- + +## ๐Ÿ“… Project Structure + +```bash +โ”œโ”€โ”€ lib/ +โ”‚ โ””โ”€โ”€ db.js +โ”œโ”€โ”€ app/ +โ”‚ โ”œโ”€โ”€ about/ +โ”‚ โ”‚ โ””โ”€โ”€ page.jsx +โ”‚ โ”œโ”€โ”€ movies/ +โ”‚ โ”‚ โ””โ”€โ”€ [id]/ +โ”‚ โ”‚ โ””โ”€โ”€ page.jsx +โ”‚ โ”œโ”€โ”€ login/ +โ”‚ โ”‚ โ””โ”€โ”€ page.jsx +โ”‚ โ”œโ”€โ”€ admin/ +โ”‚ โ”‚ โ””โ”€โ”€ page.jsx +โ”‚ โ”œโ”€โ”€ layout.jsx +โ”‚ โ””โ”€โ”€ page.jsx +โ”œโ”€โ”€ components/ +โ”‚ โ”œโ”€โ”€ NavMenu.jsx +โ”‚ โ””โ”€โ”€ MovieCard.jsx +โ”œโ”€โ”€ public/ +โ”‚ โ””โ”€โ”€ images/ +โ”œโ”€โ”€ styles/ +โ”‚ โ”œโ”€โ”€ main.scss +โ”‚ โ””โ”€โ”€ NavMenu.module.scss +โ”œโ”€โ”€ .env +โ”œโ”€โ”€ jest.config.js +โ”œโ”€โ”€ package.json +โ””โ”€โ”€ README.md +``` + +--- + +## ๐Ÿ‘ฅ Team + +| Name | Role | +| --------- | ------------------- | +| Alexander | Fullstack Developer | +| Robert | Fullstack Developer | +| Dennis | Fullstack Developer | +| Ronja | Fullstack Developer | +| Patrik | Fullstack Developer | +| Calle | Fullstack Developer | +| Jimmy | Fullstack Developer | + +--- + +## ๐Ÿ“Œ Setup & Installation + +```bash +git clone https://github.com/your-username/kino-nextjs.git +cd kino-nextjs +npm install +npm run dev +``` + +--- + +## ๐ŸŒ Deployment + +This project is deployed using [Vercel](https://vercel.com/). Any push to `main` triggers an automatic deployment. + +๐Ÿ”— Live link: [kino-nextjs.vercel.app](https://kino-nextjs.vercel.app) + +--- + +## ๐Ÿ“„ License + +This project is licensed under the MIT License โ€“ see the [LICENSE](./LICENSE) file for details. -- Always create a feature branch from "main" before starting work. -- Push your changes and open a pull request when ready. -- Tag someone for review. -- If your PR falls behind "main", you may need to "git merge main" into your branch. +> This means you're free to use, modify, and distribute the code โ€“ even commercially โ€“ as long as you include the original copyright notice. From 87e87dc66e154990423818583646d1e9dfe81868 Mon Sep 17 00:00:00 2001 From: Ronja Fagerdahl Date: Thu, 5 Jun 2025 17:44:57 +0200 Subject: [PATCH 2/3] Added correct live demo link --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index fdddfd8..9aaba74 100644 --- a/README.md +++ b/README.md @@ -8,7 +8,7 @@ A fullstack Next.js application for movie enthusiasts โ€“ featuring dynamic rout ## ๐Ÿš€ Live Demo -๐Ÿ‘‰ [kino-nextjs.vercel.app](https://kino-nextjs.vercel.app) +๐Ÿ‘‰ (https://kvikkjokk-nextjs.ekedala-services.se/) --- From abc11ecd56b1cbaf9d9746890c02331163fff1c1 Mon Sep 17 00:00:00 2001 From: Ronja Fagerdahl Date: Thu, 5 Jun 2025 21:49:02 +0200 Subject: [PATCH 3/3] Update README.md Fixed a miss --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 4d35c4c..7f07513 100644 --- a/README.md +++ b/README.md @@ -71,7 +71,7 @@ A fullstack Next.js application for movie enthusiasts โ€“ featuring dynamic rout - **Next.js 15.3.1** โ€“ Running the latest major version with full App Router support - **React 19** โ€“ With support for concurrent features and `use()` -- **SCSS Modules** โ€“ Scoped, maintainable styling per component +- **Sass** โ€“ With scss modules- Scoped, maintainable styling per component - **fetch API** โ€“ Handles data fetching from backend and external APIs ### Backend