Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Development #5

Open
wants to merge 12 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
228 changes: 228 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,2 +1,230 @@
[![Open in Visual Studio Code](https://classroom.github.com/assets/open-in-vscode-718a45dd9cf7e7f842a935f5ebbe5719a5e09af4491e668f4dbf3b35d5cca122.svg)](https://classroom.github.com/online_ide?assignment_repo_id=13208385&assignment_repo_type=AssignmentRepo)

# Individual Project Phase 2

## Get All Users

**Endpoint**: `/users`

**Method**: `GET`

**Description**: Get a list of all users.

**Response**:

- **Status Code**: 200 OK
- **Body**:

```json
[
{
"id": 1,
"username": "john_doe",
"email": "john.doe@example.com"
},
{
"id": 2,
"username": "jane_doe",
"email": "jane.doe@example.com"
}
...
]

```

## Get Top Rated Movies

**Endpoint**: `/movies/top-rated`

**Method**: `GET`

**Description**: Get a list of top-rated movies.

**Query Parameters**:

- `page` (optional): Page number (default: 1)
- `pageSize` (optional): Number of movies per page (default: 20)

**Response**:

- **Status Code**: 200 OK
- **Body**:

```json
[
{
"id": 123,
"title": "Inception",
"rating": 9.3
},
{
"id": 456,
"title": "The Shawshank Redemption",
"rating": 9.2
},
...
]
```

## Get Detailed Movie

**Endpoint**: `/movies/{id}`

**Method**: `GET`

**Description**:

```json
{
"id": 123,
"title": "Inception",
"overview": "A mind-bending sci-fi thriller...",
"releaseDate": "2010-07-16",
"genres": ["Action", "Sci-Fi"],
"rating": 9.3
...
}
```

**Path Parameters**:

- `{id}`: Movie ID

**Response**:

- **Status Code**: 200 OK
- **Body**: Detailed information about the movie.

## Create Rating

**Endpoint**: `/ratings`

**Method**: `POST`

**Description**: Create a new movie rating.

**Request Body**:

- `userId`: User ID
- `rating`: Rating value
- `imdbid`: IMDb ID of the movie

**Response**:

- **Status Code**: 201 Created
- **Body**:

```json
{
"id": 789,
"userId": 1,
"rating": 4.5,
"imdbid": "tt1234567"
}
```

## Get All Ratings

**Endpoint**: `/ratings`

**Method**: `GET`

**Description**: Get a list of all movie ratings.

**Response**:

- **Status Code**: 200 OK
- **Body**:

```json
[
{
"id": 789,
"userId": 1,
"rating": 4.5,
"imdbid": "tt1234567"
},
{
"id": 890,
"userId": 2,
"rating": 3.8,
"imdbid": "tt2345678"
},
...
]
```

## Get Rating by ID

**Endpoint**: `/ratings/{id}`

**Method**: `GET`

**Description**: Get a specific movie rating by ID.

**Path Parameters**:

- `{id}`: Rating ID

**Response**:

- **Status Code**: 200 OK
- **Body**:

```json
{
"id": 789,
"userId": 1,
"rating": 4.5,
"imdbid": "tt1234567"
}
```

## Update Rating

**Endpoint**: `/ratings/{id}`

**Method**: `PUT`

**Description**: Update a movie rating.

**Path Parameters**:

- `{id}`: Rating ID

**Request Body**: Updated rating information.

**Response**:

- **Status Code**: 200 OK
- **Body**:

```json
{
"message": "Rating updated successfully"
}
```

## Delete Rating

**Endpoint**: `/ratings/{id}`

**Method**: `DELETE`

**Description**: Delete a movie rating by ID.

**Path Parameters**:

- `{id}`: Rating ID

**Response**: {}

- **Status Code**: 204 No Content

```

```

```

```
20 changes: 20 additions & 0 deletions imdb-IP-HCK65/.eslintrc.cjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
module.exports = {
root: true,
env: { browser: true, es2020: true },
extends: [
'eslint:recommended',
'plugin:react/recommended',
'plugin:react/jsx-runtime',
'plugin:react-hooks/recommended',
],
ignorePatterns: ['dist', '.eslintrc.cjs'],
parserOptions: { ecmaVersion: 'latest', sourceType: 'module' },
settings: { react: { version: '18.2' } },
plugins: ['react-refresh'],
rules: {
'react-refresh/only-export-components': [
'warn',
{ allowConstantExport: true },
],
},
}
4 changes: 4 additions & 0 deletions imdb-IP-HCK65/.firebase/hosting.ZGlzdA.cache
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
vite.svg,1701757595147,59ec4b6085a0cb1bf712a5e48dd5f35b08e34830d49c2026c18241be04e05d5a
index.html,1703220927879,8edf5b870cad59a30f593ef0134953843ad7c69fda8194e8fd8afd238f35088e
assets/index-7gktyjIJ.css,1703220927878,66d5c12892d98a85f1f92b3668c5184e912354f4af17cee9bf22bcf48cffe097
assets/index-t9Mwi1ed.js,1703220927879,a6dec4fb60312b0f93fe455325d0122901361357dc336b83c8e9cbd8b4030226
5 changes: 5 additions & 0 deletions imdb-IP-HCK65/.firebaserc
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"projects": {
"default": "ip-project-muhammad-mahdi"
}
}
24 changes: 24 additions & 0 deletions imdb-IP-HCK65/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
# Logs
logs
*.log
npm-debug.log*
yarn-debug.log*
yarn-error.log*
pnpm-debug.log*
lerna-debug.log*

node_modules
dist
dist-ssr
*.local

# Editor directories and files
.vscode/*
!.vscode/extensions.json
.idea
.DS_Store
*.suo
*.ntvs*
*.njsproj
*.sln
*.sw?
8 changes: 8 additions & 0 deletions imdb-IP-HCK65/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# React + Vite

This template provides a minimal setup to get React working in Vite with HMR and some ESLint rules.

Currently, two official plugins are available:

- [@vitejs/plugin-react](https://github.com/vitejs/vite-plugin-react/blob/main/packages/plugin-react/README.md) uses [Babel](https://babeljs.io/) for Fast Refresh
- [@vitejs/plugin-react-swc](https://github.com/vitejs/vite-plugin-react-swc) uses [SWC](https://swc.rs/) for Fast Refresh
16 changes: 16 additions & 0 deletions imdb-IP-HCK65/firebase.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
{
"hosting": {
"public": "dist",
"ignore": [
"firebase.json",
"**/.*",
"**/node_modules/**"
],
"rewrites": [
{
"source": "**",
"destination": "/index.html"
}
]
}
}
34 changes: 34 additions & 0 deletions imdb-IP-HCK65/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<link rel="icon" type="image/svg+xml" href="/vite.svg" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Vite + React</title>
<!-- Font Awesome -->
<link
href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.0.0/css/all.min.css"
rel="stylesheet"
/>
<!-- Google Fonts -->
<link
href="https://fonts.googleapis.com/css?family=Roboto:300,400,500,700&display=swap"
rel="stylesheet"
/>
<!-- MDB -->
<link
href="https://cdnjs.cloudflare.com/ajax/libs/mdb-ui-kit/7.1.0/mdb.min.css"
rel="stylesheet"
/>
<script src="https://accounts.google.com/gsi/client" async></script>
<script
type="text/javascript"
src="https://app.sandbox.midtrans.com/snap/snap.js"
data-client-key="SET_YOUR_CLIENT_KEY_HERE"
></script>
</head>
<body>
<div id="root"></div>
<script type="module" src="/src/main.jsx"></script>
</body>
</html>
Loading