Skip to content

Commit 6b48290

Browse files
committed
Merge remote-tracking branch 'origin/dev' into dev
2 parents ea50bfe + 96fdc24 commit 6b48290

File tree

3 files changed

+123
-152
lines changed

3 files changed

+123
-152
lines changed

README.md

Lines changed: 123 additions & 152 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# MoviePocket
1+
# MoviePocket Developer documentation
22

33
## Introduction
44

@@ -10,229 +10,200 @@ between users.
1010

1111
## To start develop
1212

13-
## Backend(Java Spring)
14-
15-
### You will need:
16-
17-
- [Java(at least 1.8)](https://www.oracle.com/java/technologies/downloads/), **Spring boot** version at least 2.7.10 and
18-
Spring 5.X bounded with Maven for backend
19-
- Cookie based authentication by [Spring Security](https://spring.io/projects/spring-security) 2.7
20-
- ORM: Hibernate v 5. + JPA
21-
22-
### [ 1 ]
23-
24-
- port 8080
25-
26-
- [MySql](https://www.mysql.com/) for Database
27-
28-
_Note_: to connect to the current DB you need to have UAM ip address as the DB is from UAM mysql server for now. To do
29-
that you need to use vpn(e.g. OpenVPN) and follow
30-
the [tutorial](https://laboratoria.wmi.amu.edu.pl/en/services/vpn/windows/)
31-
32-
WITHOUT IT BACKEND WILL NOT RUN!
33-
34-
## Useful URLs
35-
36-
Frontend and the whole service is run on http://localhost:3000
37-
http://localhost:8080 for backend
38-
39-
REST API documentation is Swagger2 generated and available on {hostname}/swagger-ui.html
40-
41-
Some example api request urls:
42-
43-
- GET http://localhost:8080/user/{username} to find all info about the registered user by username
44-
45-
**Project vision** and **project requirements** documents are available in documents/ section of source
46-
47-
## Deployment
48-
49-
The service, both React and Java run on Linux remote server which Host URL: https://moviepocket.projektstudencki.pl
50-
51-
## Frontend
52-
53-
### You will need on your machine installed:
54-
55-
- [Node.js](https://nodejs.org/en) >= 18.15.0 and **npm** >= 9.5.0 for frontend
56-
57-
### General info
58-
59-
- port 3000
60-
61-
## Android
62-
63-
### You will need on your machine installed:
64-
-
65-
66-
# MoviePocket Documentation
67-
68-
# Project Documentation
69-
7013
1. [Introduction](#introduction)
71-
2. [Backend (Java Spring)](#backend)
72-
- [To start](#you-will-need)
14+
2. [Backend (Java Spring)](#backend-java-spring)
15+
- [You will need](#you-will-need-)
7316
- [API Documentation](#api-documentation)
7417
- [Database Schema](#database-schema)
7518
- [Authentication](#authentication)
7619
- [Error Handling](#error-handling)
77-
3. [Frontend (React.js)](#frontend)
20+
3. [Frontend (React.js)](#frontend-reactjs)
7821
- [Project Structure](#project-structure)
7922
- [Component Documentation](#component-documentation)
80-
- [State Management](#state-management)
81-
- [Routing](#routing)
8223
- [API Integration](#api-integration)
83-
4. [Mobile App (Java Android)](#mobile-app)
84-
- [Architecture](#architecture)
85-
- [Activity and Fragment Documentation](#activity-and-fragment-documentation)
86-
- [Network Requests](#network-requests)
87-
- [Data Persistence](#data-persistence)
24+
4. [Mobile App Android](#mobile-app-android)
25+
- [General](#general)
8826
- [Authentication](#authentication)
8927
- [Deployment](#deployment)
90-
- [Backend Deployment](#backend-deployment)
91-
- [Frontend Deployment](#frontend-deployment)
28+
- [Backend And Frontend Deployment](#backend-and-frontend-deployment)
9229
- [Mobile App Deployment](#mobile-app-deployment)
9330
5. [Contributing](#contributing)
94-
- [Code Style Guidelines](#code-style-guidelines)
9531
- [Version Control](#version-control)
9632
- [Testing](#testing)
9733
- [Changelog](#changelog)
98-
- [Support](#support)
9934
6. [License](#license)
10035

101-
![main_screen](https://github.com/prymakD/MoviePocket/assets/54550596/45864288-ad11-49d9-9b66-5b60c6b427c0)
102-
103-
## Introduction <a name="introduction"></a>
36+
## Introduction
10437

10538
MoviePocket is movie management system that will help you to orginize your movie collection and share it with other
10639
movie lovers. The more percise description of the service you can find in Documentation/ section:)
10740

10841
Explore world of movies with MoviePocket and create your personal unforgettable experience collecting sharing movies
10942
between users.
11043

111-
## Backend (Java Spring) <a name="backend"></a>
112-
113-
### You will need: <a name="you-will-need"></a>
44+
## Backend Java [Spring](https://spring.io/)
45+
### You will need:
11446

11547
- [Java(at least 1.8)](https://www.oracle.com/java/technologies/downloads/), **Spring boot** version at least 2.7.10 and
11648
Spring 5.X bounded with Maven for backend
11749
- Cookie based authentication by [Spring Security](https://spring.io/projects/spring-security) 2.7
11850
- ORM: Hibernate v 5. + JPA
119-
- port used _8080_
51+
- port used for local: _8080_
12052

121-
### API Documentation <a name="api-documentation"></a>
53+
### API Documentation
12254

12355
Info about API endpoints, request/response examples, and any required headers generated by Swageer UI and can be found
124-
by
125-
***{hostname}/swagger-ui.html***
56+
by ```{hostname}/swagger-ui.html ```
12657

127-
### Database Schema <a name="database-schema"></a>
58+
MVP pattern is used.
59+
### Database Schema
12860

129-
MySql is used. DB srcript can be found in Documentation/DB_and_UI_prototypes/DbScript
61+
MySql is used. DB script can be found in [DbScript](Documentation/DB_and_UI_prototypes/DbScript)
13062

13163
DB schema
132-
<img src="Documentation/DB_and_UI_prototypes/DB_MoviePocket.png" />
64+
![DB schema 1](Documentation/DB_and_UI_prototypes/DB_MoviePocket.png)
65+
66+
![DB schema 2](Documentation/DB_and_UI_prototypes/DB_MoviePocket1.png)
13367

134-
### Authentication <a name="authentication"></a>
13568

136-
Explain the authentication mechanism used in the backend, such as OAuth, JWT, etc.
69+
### Authentication
13770

138-
### Error Handling <a name="error-handling"></a>
71+
Cookie based authentication is implemented. Cookie expiration set to -1 and can be changed in [application.properties](src/main/resources/application.properties) file
13972

140-
Document how errors are handled, including error codes, messages, and possible solutions.
73+
### Error Handling
14174

142-
## Frontend (React.js) <a name="frontend"></a>
75+
Most errors are handled by ResponseEntity and Http status codes responses
76+
Main codes used are:
77+
1. ```200 Ok```
78+
2. ```401 Unauthorized```
79+
3. ```403 Forbidden```
80+
4. ```404 Not found```
81+
5. ```500 Server error```
14382

144-
### Project Structure <a name="project-structure"></a>
83+
## Frontend [React.js](https://react.dev/reference/react)
84+
85+
### Project Structure
14586

14687
Describe the project directory structure and organization.
14788

148-
### Component Documentation <a name="component-documentation"></a>
89+
### Component Documentation
14990

15091
Document each React component, including its purpose, props, and usage.
15192

152-
- Component A
153-
- Purpose:
93+
- Component Buttons
94+
- [DislikedMovieButton](..%2FMoviePocket-Frontend%2Fsrc%2Fcomponents%2Fbuttons%2FDislikedMovieButton.js)
95+
- Purpose: The DislikedMovieButton component is a reusable React component designed to represent a button that allows users to dislike a movie. It interacts with the server to check the current disliked state of the movie and enables users to toggle the dislike state by clicking the button.
96+
- Props:
97+
- idMovie (Required, Number): The unique identifier of the movie for which the dislike button is being displayed.
98+
- className (Optional, String): Additional CSS class name(s) that can be provided to customize the styling of the button.
99+
- Usage: the DislikedMovieButton is used within a MovieDetails component, where idMovie is set to the unique identifier of the movie being displayed. The optional className prop is used to customize the styling of the button.
100+
101+
This component utilizes the AuthContext to check if the user is logged in before allowing them to dislike a movie. When the button is clicked, it toggles the dislike state and sends a request to the server to update the dislike status.
102+
- [FavoriteMovieButton](..%2FMoviePocket-Frontend%2Fsrc%2Fcomponents%2Fbuttons%2FFavoriteMovieButton.js)
103+
- Purpose: The FavoriteMovieButton component is a reusable React component designed to represent a button that allows users to mark a movie as a favorite. It interacts with the server to check the current favorite state of the movie and enables users to toggle the favorite state by clicking the button.
104+
- Props:
105+
- idMovie (Required, String): The unique identifier of the movie for which the favorite button is being displayed.
106+
- className (Optional, String): Additional CSS class name(s) that can be provided to customize the styling of the button.
107+
- Usage: the FavoriteMovieButton is used within a MovieDetails component, where idMovie is set to the unique identifier of the movie being displayed. The optional className prop is used to customize the styling of the button.
108+
- [RatingComponent](..%2FMoviePocket-Frontend%2Fsrc%2Fcomponents%2Fbuttons%2FRatingComponent.js)
109+
- Purpose: The RatingComponent is designed to provide a user interface for selecting a rating using star icons. It uses state to track the selected rating and updates the display dynamically.
110+
- Props: rating: A state variable that holds the selected rating. It is initially set to null and gets updated when a star is clicked.
111+
- [ToWatchMovieButton](..%2FMoviePocket-Frontend%2Fsrc%2Fcomponents%2Fbuttons%2FToWatchMovieButton.js)
112+
- Purpose: The ToWatchMovieButton component serves as a button that allows users to add or remove movies from their "To Watch" list. It displays a tooltip and changes its appearance based on whether the movie is in the "To Watch" list or not.
154113
- Props:
155-
- Usage:
156-
- Component B
157-
- ...
158-
159-
### State Management <a name="state-management"></a>
160-
161-
Explain how state is managed in the frontend, whether through local state, Redux, or other state management tools.
162-
163-
### Routing <a name="routing"></a>
164-
165-
Document how routing is implemented in the React app.
166-
167-
### API Integration <a name="api-integration"></a>
168-
169-
Provide details on how the frontend integrates with backend APIs, including example API calls.
170-
171-
## Mobile App (Java Android) <a name="mobile-app"></a>
172-
173-
### Architecture <a name="architecture"></a>
174-
175-
Explain the overall architecture of the Android app, including activities, fragments, and any architectural patterns
176-
used (e.g., MVVM, MVP).
177-
178-
### Activity and Fragment Documentation <a name="activity-and-fragment-documentation"></a>
179-
180-
Document each Android activity and fragment, explaining their roles and interactions.
181-
182-
- Activity A
183-
- Roles:
184-
- Interactions:
185-
- Fragment B
186-
- ...
114+
- toWatch: A state variable that holds whether the movie is in the "To Watch" list. It is initially set to false and gets updated when the user clicks the button.
115+
- isLoggedIn: The component uses the AuthContext to check if the user is logged in.
116+
- [WatchMovieButton.js](..%2FMoviePocket-Frontend%2Fsrc%2Fcomponents%2Fbuttons%2FWatchMovieButton.js)
117+
- Purpose: The WatchMovieButton component serves as a button that allows users to mark a movie as watched. It displays a tooltip and changes its appearance based on whether the movie has been watched or not.
118+
- Props:
119+
- watched: A state variable that holds whether the movie has been watched. It is initially set to false and gets updated when the user clicks the button.
120+
- isHovered: A state variable that holds whether the button is being hovered. It is used to determine the button's appearance during hover.
121+
- isClicked: A state variable that holds whether the button has been clicked. It is used to determine the button's appearance after being clicked.
122+
- Component [Lists](..%2FMoviePocket-Frontend%2Fsrc%2Fcomponents%2Flists)
123+
- [ListOfFilms](..%2FMoviePocket-Frontend%2Fsrc%2Fcomponents%2Flists%2FListOfFilms.js)
124+
- [SingleList](..%2FMoviePocket-Frontend%2Fsrc%2Fcomponents%2Flists%2FSingleList.js)
125+
- [UserLikedList](..%2FMoviePocket-Frontend%2Fsrc%2Fcomponents%2Flists%2FUserLikedList.js)
126+
- Component [navbar](..%2FMoviePocket-Frontend%2Fsrc%2Fcomponents%2Fnavbar)
127+
- [logoBar](..%2FMoviePocket-Frontend%2Fsrc%2Fcomponents%2Fnavbar%2FlogoBar)
128+
- [logOutComponent](..%2FMoviePocket-Frontend%2Fsrc%2Fcomponents%2Fnavbar%2FlogOutComponent)
129+
- [navBar](..%2FMoviePocket-Frontend%2Fsrc%2Fcomponents%2Fnavbar%2FnavBar)
130+
- [navBrand](..%2FMoviePocket-Frontend%2Fsrc%2Fcomponents%2Fnavbar%2FnavBrand)
131+
- [navList](..%2FMoviePocket-Frontend%2Fsrc%2Fcomponents%2Fnavbar%2FnavList)
132+
- [searchComponent](..%2FMoviePocket-Frontend%2Fsrc%2Fcomponents%2Fnavbar%2FsearchComponent)
133+
- [userBarComponent](..%2FMoviePocket-Frontend%2Fsrc%2Fcomponents%2Fnavbar%2FuserBarComponent)
134+
- Component [pagination](..%2FMoviePocket-Frontend%2Fsrc%2Fcomponents%2Fpagination)
135+
- [Pagination](..%2FMoviePocket-Frontend%2Fsrc%2Fcomponents%2Fpagination%2FPagination.js)
136+
- Component [poster](..%2FMoviePocket-Frontend%2Fsrc%2Fcomponents%2Fposter)
137+
- [MoviePoster](..%2FMoviePocket-Frontend%2Fsrc%2Fcomponents%2Fposter%2FMoviePoster.js)
138+
- [Poster](..%2FMoviePocket-Frontend%2Fsrc%2Fcomponents%2Fposter%2FPoster.js)
139+
- Component [review](..%2FMoviePocket-Frontend%2Fsrc%2Fcomponents%2Freview)
140+
- [CreateReviewForm.js](..%2FMoviePocket-Frontend%2Fsrc%2Fcomponents%2Freview%2FCreateReviewForm.js)
141+
- [LikeReviewButton.js](..%2FMoviePocket-Frontend%2Fsrc%2Fcomponents%2Freview%2FLikeReviewButton.js)
142+
- [ReviewDeleteButton.js](..%2FMoviePocket-Frontend%2Fsrc%2Fcomponents%2Freview%2FReviewDeleteButton.js)
143+
- [SingleReview.js](..%2FMoviePocket-Frontend%2Fsrc%2Fcomponents%2Freview%2FSingleReview.js)
144+
- Component [spinners](..%2FMoviePocket-Frontend%2Fsrc%2Fcomponents%2Fspinners)
145+
- [Spinner](..%2FMoviePocket-Frontend%2Fsrc%2Fcomponents%2Fspinners%2FSpinner.js)
146+
- Component [top](..%2FMoviePocket-Frontend%2Fsrc%2Fcomponents%2Ftop)
147+
- [Top](..%2FMoviePocket-Frontend%2Fsrc%2Fcomponents%2Ftop%2FTop.js)
148+
- Component [Layout](..%2FMoviePocket-Frontend%2Fsrc%2Fcomponents%2FLayout.js)
187149

188-
### Network Requests <a name="network-requests"></a>
150+
### API Integration
189151

190-
Describe how the app handles network requests, including API calls and handling responses.
152+
Service is using external [TMDB APi](https://developer.themoviedb.org/reference/intro/getting-started) for several operations such as poster and movie info fetching etc.
191153

192-
### Data Persistence <a name="data-persistence"></a>
154+
## Mobile App [Android](https://developer.android.com/)
193155

194-
Document how data is persisted locally on the mobile device.
156+
### General
195157

196-
### Authentication <a name="authentication"></a>
158+
Android 10+ should be used for running
197159

198-
Explain the authentication flow on the mobile app.
160+
App uses mainly MVC pattern and uses both backend api endpoints and TMDB API.
199161

200-
### Deployment <a name="deployment"></a>
162+
### Authentication
201163

202-
#### Backend Deployment <a name="backend-deployment"></a>
164+
Authentication flow is depends on Backend part as it uses backend api see [Backend (Java Spring)](#backend-java-spring)
203165

204-
Provide instructions on how to deploy the Java Spring backend.
166+
### Deployment
205167

206-
#### Frontend Deployment <a name="frontend-deployment"></a>
168+
#### Backend and Frontend Deployment
207169

208-
Explain the process of deploying the React.js frontend.
170+
Both front and back end are deployed on remote linux server provided by [UAM WMI](https://wmi.amu.edu.pl/en)
209171

210-
#### Mobile App Deployment <a name="mobile-app-deployment"></a>
172+
Server information and connection credentials can be found [Here](Documentation%2FDeploy%2FNowa_maszyna_wirtualna_Helpdesk_WMI_Biuro_Obs%3Fugi_Klienta.pdf)
173+
#### Mobile App Deployment
211174

212-
Provide guidelines for packaging and distributing the Android mobile app.
175+
Android app is deployed to [Google Play](https://play.google.com/store/apps?hl=en&gl=US&pli=1)
213176

214-
## Contributing <a name="contributing"></a>
177+
## Contributing
215178

216-
### Code Style Guidelines <a name="code-style-guidelines"></a>
179+
### Version Control
217180

218-
Specify the coding style guidelines for backend, frontend, and mobile app development.
181+
Backend: https://github.com/prymakD/MoviePocket
219182

220-
### Version Control <a name="version-control"></a>
183+
Frontend: https://github.com/EkintoQ/MoviePocket-Frontend
221184

222-
Explain the version control practices followed (e.g., Git workflow).
185+
Android: https://github.com/AntonPazniak/MoviePocketAndroid/tree/master
223186

224-
### Testing <a name="testing"></a>
187+
### Testing
225188

226189
Document the testing strategy for backend, frontend, and mobile app components.
227190

228-
### Changelog <a name="changelog"></a>
229-
230-
Maintain a changelog to track changes and updates to the project.
191+
### Changelog
231192

232-
### Support <a name="support"></a>
193+
v. 1.0.0
233194

234-
Provide contact information for obtaining support or reporting issues.
195+
## License
235196

236-
## License <a name="license"></a>
197+
[Proprietary license](https://en.wikipedia.org/wiki/Proprietary_software)
237198

238-
Specify the project's license.
199+
Please add header to created files
200+
```
201+
/**
202+
* Copyright (C) {MoviePocket} - All Rights Reserved
203+
*
204+
* This source code is protected under international copyright law. All rights
205+
* reserved and protected by the copyright holders.
206+
* This file is confidential and only available to authorized individuals with the
207+
* permission of the copyright holders. If you encounter this file and do not have
208+
* permission, please contact the copyright holders and delete this file.
209+
*/ ```

0 commit comments

Comments
 (0)