Skip to content

Commit 88eb7de

Browse files
authored
Merge pull request #725 from Thenlie/develop
v1.11.0
2 parents d43bbf5 + 2da8488 commit 88eb7de

File tree

104 files changed

+3296
-8063
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

104 files changed

+3296
-8063
lines changed

.env.template

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
1-
Create .env file and add these environment variables:
1+
# Create .env file and add these environment variables.
2+
# Use `npm run db-spart-env` to auto-generate the supabase keys.
3+
# Get Movie DB key by creating a free account on https://www.themoviedb.org/
24

35
VITE_SUPABASE_URL=
46
VITE_SUPABASE_ANON_KEY=

.github/workflows/ci.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,9 @@ jobs:
1111
runs-on: ubuntu-latest
1212
steps:
1313
- uses: actions/checkout@v4
14-
- uses: actions/setup-node@v3
14+
- uses: actions/setup-node@v4
1515
with:
16-
node-version: 18
16+
node-version: 20
1717
- name: Install modules
1818
run: npm ci
1919
- name: Run typescript compiler

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,5 +22,6 @@ dist-ssr
2222
*.njsproj
2323
*.sln
2424
*.sw?
25+
tmp
2526

2627
storybook-static

.tool-versions

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
nodejs 18.17.0
1+
nodejs 20.9.0

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ Come join a growing community of cinephile's! [https://streamability.vercel.app/
1111

1212
## Contributing 👥
1313

14-
Streamability is very open to contributions! If you have a feature request or bug report, please open an [issue](https://github.com/Thenlie/Streamability/issues) with the applicable tag. If you would like to create a feature yourself, [fork](https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/working-with-forks/about-forks) the repository and add in your changes. Then submit a [pull request](https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/proposing-changes-to-your-work-with-pull-requests/about-pull-requests) which will be reviewed and eventually merged if it meets all contribution requirements. You can find out more about these requirements in the [contribution guidelines](https://github.com/Thenlie/Streamability/blob/main/docs/contribution-guidelines.md).
14+
Streamability is very open to contributions! If you have a feature request or bug report, please open an [issue](https://github.com/Thenlie/Streamability/issues) with the applicable tag. If you would like to create a feature yourself, [fork](https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/working-with-forks/about-forks) the repository and add in your changes. Then submit a [pull request](https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/proposing-changes-to-your-work-with-pull-requests/about-pull-requests) which will be reviewed and eventually merged if it meets all contribution requirements. You can find out more about these requirements in the [contribution guidelines](./docs/contribution-guidelines.md). Also check out the [getting started](./docs/getting-started.md) docs for everything you need to know to get the project running locally.
1515

1616
## Questions?
1717

TODO.md

Lines changed: 4 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,13 @@
11
### TODOs
22
| Filename | line # | TODO |
33
|:------|:------:|:------|
4-
| [src/__tests__/routes.tsx](src/__tests__/routes.tsx#L22) | 22 | #427 Import routes from main.tsx instead of using this |
54
| [src/components/Navigation.tsx](src/components/Navigation.tsx#L88) | 88 | Error handling if any |
65
| [src/components/Navigation.tsx](src/components/Navigation.tsx#L93) | 93 | #162 Use MUI ThemeProvider |
7-
| [src/components/Navigation.tsx](src/components/Navigation.tsx#L242) | 242 | Add a transition when search is expanded or collapsed |
8-
| [src/screens/DiscoverScreen.tsx](src/screens/DiscoverScreen.tsx#L62) | 62 | #613 |
6+
| [src/components/Navigation.tsx](src/components/Navigation.tsx#L155) | 155 | Fix deprecated prop |
7+
| [src/components/Navigation.tsx](src/components/Navigation.tsx#L241) | 241 | Add a transition when search is expanded or collapsed |
8+
| [src/screens/DiscoverScreen.tsx](src/screens/DiscoverScreen.tsx#L61) | 61 | #613 Dynamic date range |
99
| [src/screens/PageNotFoundScreen.tsx](src/screens/PageNotFoundScreen.tsx#L25) | 25 | Implement better error handling |
1010
| [src/screens/PageNotFoundScreen.tsx](src/screens/PageNotFoundScreen.tsx#L26) | 26 | Handle thrown responses with 'isRouteErrorResponse' |
11-
| [src/screens/ShowDetailsScreen.tsx](src/screens/ShowDetailsScreen.tsx#L155) | 155 | #438 Handle case when no details are ever returned |
1211
| [src/supabase/profiles.ts](src/supabase/profiles.ts#L253) | 253 | #587 Ensure country code is valid |
13-
| [src/__tests__/components/component.test.tsx](src/__tests__/components/component.test.tsx#L8) | 8 | #427 Re-enable tests when UI stable |
14-
| [src/__tests__/screens/authScreen.test.tsx](src/__tests__/screens/authScreen.test.tsx#L9) | 9 | #427 Re-enable tests when UI stable |
15-
| [src/__tests__/screens/movieScreen.test.tsx](src/__tests__/screens/movieScreen.test.tsx#L31) | 31 | #427 Re-enable tests when UI stable |
16-
| [src/__tests__/screens/navigation.test.tsx](src/__tests__/screens/navigation.test.tsx#L10) | 10 | #427 Re-enable tests when UI stable |
1712
| [src/screens/auth/LoginScreen.tsx](src/screens/auth/LoginScreen.tsx#L86) | 86 | We could try to get the AuthApiError type and use 'cause' instead |
18-
| [src/screens/dashboard/DashboardGalleryScreen.tsx](src/screens/dashboard/DashboardGalleryScreen.tsx#L26) | 26 | If profile does not return after a few seconds, |
19-
| [src/screens/dashboard/DashboardGalleryScreen.tsx](src/screens/dashboard/DashboardGalleryScreen.tsx#L57) | 57 | #610 Create empty state |
20-
| [src/__tests__/screens/assets/showData.ts](src/__tests__/screens/assets/showData.ts#L260) | 260 | Fill out rest of data, this does not have all details |
13+
| [src/screens/dashboard/DashboardGalleryScreen.tsx](src/screens/dashboard/DashboardGalleryScreen.tsx#L27) | 27 | If profile does not return after a few seconds, |

docs/contribution-guidelines.md

Lines changed: 21 additions & 89 deletions
Original file line numberDiff line numberDiff line change
@@ -1,131 +1,63 @@
11
# Contributing 👥
22

3-
Streamability is very open to contributions! If you have a feature request or bug report, please open an [issue](https://github.com/Thenlie/Streamability/issues) with the applicable tag. If you would like to create a feature yourself, [fork](https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/working-with-forks/about-forks) the repository and add in your changes. Then submit a [pull request](https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/proposing-changes-to-your-work-with-pull-requests/about-pull-requests) which will be reviewed and eventually merged if it meets all contribution requirements. You can find out more about these requirements in the [contribution guidelines](https://github.com/Thenlie/Streamability/blob/main/docs/contribution-guidelines.md).
3+
Streamability is very open to contributions! If you have a feature request or bug report, please open an [issue](https://github.com/Thenlie/Streamability/issues) with the applicable tag. If you would like to create a feature yourself, [fork](https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/working-with-forks/about-forks) the repository and add in your changes. Then submit a [pull request](https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/proposing-changes-to-your-work-with-pull-requests/about-pull-requests) which will be reviewed and eventually merged if it meets all contribution requirements.
44

55
---
66

7-
# Branching Strategy 🌲
7+
## Branching Strategy 🌲
88

99
When creating branches, be sure to use the proper naming convention. Each item should by hyphen separated and lowercase.
1010

11-
1. Issue number. If no issue, `NA-0`
12-
2. Issue type. If no issue, pick the most suitable type.
13-
3. Description.
11+
1. Issue number. If no issue, `0`
12+
2. Description.
1413

1514
Example:
16-
```
17-
13-feat-show-card
18-
```
19-
20-
You should branch off of the `develop` branch, not `main` as this is where all PRs will point. Be sure your branch is up to date before submitting PRs by running `git rebase develop` while checked out to your branch. You can read more about this below.
21-
22-
---
23-
24-
# Git Workflow 🧬
25-
26-
Streamability V2 is attempting to have a linear commit history on `main` as well as `develop`. You can read more about the benefits of linear commit histories [here](https://www.bitsnbites.eu/a-tidy-linear-git-history/#:~:text=A%20linear%20history%20is%20simply,branches%20with%20independent%20commit%20histories.).
27-
28-
Creating and pushing a new feature branch is quite simple. Follow the steps below:
29-
30-
1. Checkout to `develop` and pull the most recent changes.
31-
```s
32-
git pull origin develop
33-
```
34-
35-
2. Create a new feature branch using the proper naming convention.
36-
```s
37-
git checkout -b <"issue-num"-"issue-type"-"branch-name">
38-
```
39-
> NOTE: If you do not have an issue number or type, `NA-0`, should be used instead followed by the branch name.
40-
>
41-
> The branch name is whatever the developer thinks fits best but should be descriptive, lowercase, and hyphen separated.
42-
43-
3. Add your changes to the branch and create a new commit. The commit should contain a descriptive message of the changes or additions you have made. It is also a good idea to run an es-lint check first.
44-
```s
45-
npm run lint
46-
git add -A
47-
git commit -m "descriptive message"
48-
```
49-
> One common issue when learning to work with linear histories is avoiding merge commits. As an example, if you are on `feature` and another developer merges a pull request to `develop`, using the command `git merge develop` will create a merge commit on the feature branch log. Assuming the code added to develop is unrelated to the feature,this is an unnecessary commit on the feature branch. To avoid this, `git rebase develop` should be used instead.
50-
51-
4. Push your branch to the remote repository
52-
```s
53-
git push origin branch-name
54-
```
55-
> NOTE: This assumes you named the remote `origin`.
5615

57-
5. If you need to make changes to your code after the PR review, you can do so and add, then commit as normal. After you have done this use an interactive rebase to squash the commits into as few as possible. You will then need to force push your branch back to the remote.
58-
```s
59-
git rebase -i HEAD~2
60-
...
61-
git push -f origin branch-name
16+
```txt
17+
123-update-readme
6218
```
63-
> NOTE: `HEAD~2` would pick the current HEAD and on commit previous for the rebase. Change this number as needed depending on the number of commits you have. You can read more about rebasing [here](https://www.atlassian.com/git/tutorials/rewriting-history/git-rebase).
64-
65-
## Work-in-Progress Commits
6619

67-
If you would like to make commits without running the full test suite, you can do so with the following command:
68-
```s
69-
git commit -m "msg" --no-verify
70-
```
71-
You can also set an environment flag in you shell to do this. Here is a helpful script for quickly creating WIP commits:
72-
```s
73-
export NO_VERIFY=1 && git add -A && git commit -m "CI Skipped. --WIP--" && export NO_VERIFY=
74-
```
20+
You should branch off of the `develop` branch, not `main` as this is where all PRs will point. Be sure your branch is up to date before submitting PRs by running `git rebase develop` while checked out to your branch.
7521

7622
---
7723

78-
# Code Quality 🧼
24+
## Code Quality 🧼
7925

80-
## ES Lint
26+
### ES Lint & Prettier
8127

82-
In order to make it easier for lots of people to contribute to the project, we want to maintain a high standard of code. To help achieve this, [ES Lint](https://eslint.org/) has been set up in the project. It has also been added to an automation that will run on each PR. Your PR will be blocked if the lint check fails, so be sure not run lint check locally before pushing. To do this, use the commands below.
28+
To make it easier for many people to contribute to the project, we want to maintain a high standard of code. To help achieve this, [ES Lint](https://eslint.org/) has been set up in the project. It has also been added to an automation that will run on each commit and PR. To run the lint checks manually, use the commands below. [Prettier](https://prettier.io/) is also being used as an ES Lint rule.
8329

8430
Run lint check, returns errors and warnings:
85-
```s
31+
32+
```sh
8633
npm run lint
8734
```
35+
8836
Run lint check and fix any errors it can:
89-
```s
37+
38+
```sh
9039
npm run lint-fix
9140
```
9241

93-
ES Lint will throw warnings for implicit use of the `any` type. This should be avoided whenever possible, but can also be ignored with an es-lint flag when absolutely necessary.
42+
ES Lint will throw errors for the use of the `any` type. This should be avoided whenever possible, but can also be ignored with an es-lint-ignore comment when absolutely necessary.
9443

9544
Should you encounter an area where es-lint and prettier conflict, ignore prettier first.
9645

97-
## TypeScript
46+
If you notice that your editor makes changes that the commands above do not, only use the changes made by the commands. You may need to disable format-on-save if you local config conflicts with repositories.
47+
48+
### TypeScript
9849

9950
The easiest way to check for typescript issues is to run the command `npm run watch`. This will run the TypeScript compiler in watch mode so errors and warning will automatically update on save. If you would like to just run the compiler once, use `npm run compile`.
10051

10152
TypeScript also has a standardized comment syntax that should be followed for primary components/functions.
10253

103-
## Logs
54+
### Logs
10455

10556
Console logs may not be left in the code. If you need to log an error, or a debug log for some reason, you can use the [Logger](https://github.com/Thenlie/Streamability/blob/main/src/logger.ts) class. This will strip the logs from production builds. See the snippet below for an example of how to use the logger.
10657

107-
```js
58+
```ts
10859
const LOG = new Logger('ScreenName');
10960

11061
LOG.error('my custom error message');
11162
LOG.debug('my custom debug message');
11263
```
113-
114-
# Testing 🧪
115-
116-
This project features a Vitest testing suite. All tests will need to pass in order for PR's to main or develop to be unblocked. You can run these tests locally with the commands below:
117-
```s
118-
npm test
119-
```
120-
121-
To run the tests in watch mode:
122-
```s
123-
npm test -- -w
124-
```
125-
126-
To run a single test:
127-
```s
128-
npm test <test-name>
129-
```
130-
131-
These tests will be run on each commit. See [work in progress commits](#work-in-progress-commits) if you would like to bypass this behavior.

docs/getting-started.md

Lines changed: 131 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,131 @@
1+
# Getting Started 🏗️
2+
3+
The steps below contain everything a first time developer needs to get the Streamability project running locally.
4+
5+
## Pre-requisites
6+
7+
- Docker Desktop
8+
- Node
9+
- Git
10+
11+
Node is the JavaScript runtime engine used on the Streamability project. The project is set up to run on the latest stable release which can be downloaded from [this link](https://nodejs.org/). If you are using a different version you can try to run the project and in most cases it will run without issue. If you do have a problem, you can use a version manager like [asdf](https://asdf-vm.com/) or [nvm](https://github.com/nvm-sh/nvm) to install a different version of Node.
12+
13+
You will need to install [Docker](https://www.docker.com/) on your machine to run the local Supabase server. Follow the installation instruction on the Docker website for your specific OS.
14+
15+
Git is the version control system used on the Streamability project. You can download the latest version from [this link](https://git-scm.com/downloads).
16+
17+
## Forking 🍴
18+
19+
> If you would prefer to follow the official GitHub documentation on forking, you can find them [here](https://docs.github.com/en/get-started/quickstart/fork-a-repo#forking-a-repository). This is a slightly abridged version of those instructions.
20+
21+
1. Navigate to the [develop](https://github.com/Thenlie/Streamability/tree/develop) branch of the repository on GitHub and click the "Fork" button on the top right corner of the page.
22+
23+
- Do not select "Copy the DEFAULT branch only" as you will need `develop` and the default branch is `main`.
24+
25+
2. Click Create fork.
26+
27+
3. Navigate to the forked repository and click on the green "Code" button.
28+
29+
4. Copy the repository URL with the method of your choosing. We suggest SSH which can be setup by following [these docs](https://docs.github.com/en/authentication/connecting-to-github-with-ssh).
30+
31+
5. Go to your terminal program of choice and navigate the the folder you want the project to live in. Then run the command below to clone the repository:
32+
33+
```sh
34+
git clone repository-url
35+
```
36+
37+
## Dependency Installation 📥
38+
39+
1. In your terminal, navigate to the project directory with the command:
40+
41+
```sh
42+
cd path-to-project
43+
```
44+
45+
2. Once you are in the project directory you need to install node modules with the command:
46+
47+
```sh
48+
npm install
49+
```
50+
51+
3. To ensure git-hooks run during commits, you need to run the set up command:
52+
53+
```sh
54+
npm run setup
55+
```
56+
57+
## Environment Variables 🌎
58+
59+
You will need to fill out the `.env` file with 3 variables. Use the `.env.template` as a guide.
60+
61+
`VITE_SUPABASE_URL` & `VITE_SUPABASE_ANON_KEY` are for Supabase.
62+
63+
1. Ensure docker is running.
64+
65+
2. These keys will be output by the command:
66+
67+
```sh
68+
npm run db-start
69+
```
70+
71+
To have the keys automatically written to you .env file, use the command:
72+
73+
```sh
74+
npm run db-start-env
75+
```
76+
77+
> Note: For remote develop or production keys, you will need to reach out to a codeowner. In general, these should not be needed.
78+
79+
`VITE_MOVIEDB_KEY` comes from The Movie Database.
80+
81+
1. Navigate to [https://www.themoviedb.org/](https://www.themoviedb.org/) and create a free account.
82+
83+
2. Navigate to your profile settings and click on "API". There you will see your API key or a button to generate one.
84+
85+
## Usage 🧑‍💻
86+
87+
### App
88+
89+
You should now have everything set up and be able to run the application. If you have stopped the database since setting up environment variables, ensure docker is running and then run the command:
90+
91+
```sh
92+
npm run db-start
93+
```
94+
95+
To run the development server, use the command:
96+
97+
```sh
98+
npm run dev
99+
```
100+
101+
This will show a localhost URL in the terminal which is where the app is being served.
102+
103+
If you would like to see a deployed version of your work, push your branch to remote. Vercel will automatically deploy that branch in a test site.
104+
105+
### Storybook
106+
107+
To run the storybook application, use the command:
108+
109+
```sh
110+
npm run storybook
111+
```
112+
113+
The storybook application should automatically open in your web browser. Check out more detailed storybook documentation [here](storybook.md).
114+
115+
## Troubleshooting 🛠️
116+
117+
If you run into issues with an npm install, use the command:
118+
119+
```sh
120+
npm run clean
121+
```
122+
123+
This will delete and reinstall all `node_modules` as well as the npm cache.
124+
125+
---
126+
127+
If you see the error `permission denied` when running one of the script files, use the command:
128+
129+
```sh
130+
chmod +x ./scripts/file-name
131+
```

0 commit comments

Comments
 (0)