Skip to content

Commit 361b265

Browse files
committed
Bump dependencies
1 parent 086c175 commit 361b265

File tree

4 files changed

+259
-153
lines changed

4 files changed

+259
-153
lines changed

README.md

Lines changed: 61 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@ My photography portfolio with galleries, tags, folders, and a globe 🌎
44

55
# Setup
66

7+
## Development Server
8+
79
The prerequisites are Node >= 20 and pnpm >= 8.
810

911
First, install the dependencies:
@@ -20,6 +22,30 @@ pnpm dev
2022

2123
Open http://localhost:3000 to see the app!
2224

25+
## Photos Backend
26+
27+
This project uses Contentful to upload photos and manage photo albums. No other CMS are currently supported.
28+
29+
> **Beginning April 30, 2025, Contentful has made changes to the Free plan entitlements by reducing the monthly asset bandwidth from 800GB to 50GB. If you expect to exceed 50GB in CDN bandwidth a month, you may consider replacing it with another CMS and update the GraphQL queries and environment variables as necessary.**
30+
31+
To start, you'll need to create a [Contentful](https://app.contentful.com/) space. Once created, head to Settings -> API Keys -> Add API Key.
32+
33+
Here, you'll see a space ID and two tokens. You can then populate an `.env.local` file with these:
34+
35+
```
36+
CONTENTFUL_SPACE_ID=abcdefghijkl
37+
CONTENTFUL_PREVIEW_ACCESS_TOKEN=roughly40randomcharacters
38+
CONTENTFUL_ACCESS_TOKEN=roughly40randomcharacters
39+
```
40+
41+
Then, head to `Content model -> Create content type`. Create the [Photo Albums](#photo-albums) model using the schema below. Once made, you can add entries on the Content tab, and upload images to each entry's media field.
42+
43+
This project does _not_ make use of the Contentful Image API to optimize photos. Instead, we optimize images beforehand by converting them to `.webp` in a script using [`cwebp`](https://developers.google.com/speed/webp/download) and [`ImageMagick`](https://formulae.brew.sh/formula/imagemagick):
44+
45+
```
46+
bash scripts/webp.sh <some directory of image files>
47+
```
48+
2349
# Technologies
2450

2551
## Development
@@ -50,38 +76,46 @@ The Next site is statically exported and hosted on a GitHub Pages site using Git
5076

5177
All assets are stored on [Contentful](https://www.contentful.com/) and fetched from their GraphQL endpoint.
5278

53-
### Schema
79+
## Contentful Schema
80+
81+
### Photo Albums
82+
83+
This model refers to the albums featured on the front page.
84+
85+
When asked, the Contentful model should be created with the API identifier `photoGallery`. You can pick any ID, just be sure to then update `photoGalleryCollection` where needed in the codebase.
86+
87+
| Field | Contentful Type |
88+
| ----------- | ---------------------------------------- |
89+
| title | Short text |
90+
| photos | Media, many files |
91+
| color | Short text - Hexadecimal color code |
92+
| type | Short text - Enum['location', 'custom']¹ |
93+
| description | Long text |
94+
| date | Short text (optional) |
95+
| lat | Decimal |
96+
| lng | Decimal |
97+
| locations | JSON (optional)² |
98+
| order | Decimal |
5499

55-
#### Photo Albums
100+
¹ `type: 'location'` refers to albums on the front page with coordinate data. `type: 'custom'` has a fancy animation and no coordinate data, e.g. the _Music_ album on my site.
56101

57-
This model refers to the albums featured on the front page, titled by their region.
102+
² This is an array of objects, each with lat, lng, and description; e.g. `[{"lat": 40.00, "lng": 70.00, "description": "narnia"}, ...]`
58103

59-
Special albums on the front page like `Music` can exist without coordinate data if using `type: custom`.
104+
For more information, see the [album Zod schemas](https://github.com/agarun/photos/blob/main/src/types/albums.ts#L14). Note this field originally had ID `photoGallery`.
60105

61-
| Field | Contentful Type |
62-
| ----------- | -------------------------------------- |
63-
| title | Short text |
64-
| photos | Media |
65-
| color | Short text |
66-
| type | Short text: Enum<[location, custom]> |
67-
| description | Long text |
68-
| date | Short text |
69-
| lat | Decimal |
70-
| lng | Decimal |
71-
| locations | JSON: Array<{ lat, lng, description }> |
72-
| order | Decimal |
106+
### Photo Folders
73107

74-
For more information, see the [album types](https://github.com/agarun/photos/blob/main/src/types/albums.ts#L14). Note this field originally had ID `photoGallery`.
108+
This model refers to the folders feature available at the [`/folders`](https://photos.agarun.com/folders) route.
75109

76-
#### Photo Folders
110+
When asked, the Contentful model should be created with the API identifier `photoFolders`. You can pick any ID, just be sure to then update `photoFoldersCollection` where needed in the codebase.
77111

78-
This model refers to the _optional_ folders feature available at the `/folders` route.
112+
This feature is optional.
79113

80-
| Field | Contentful Type |
81-
| ------------ | --------------- |
82-
| title | Short text |
83-
| parent_title | Short text |
84-
| photos | Media |
85-
| description | Long text |
86-
| date | Short text |
87-
| order | Decimal |
114+
| Field | Contentful Type |
115+
| ------------ | ----------------- |
116+
| title | Short text |
117+
| parent_title | Short text |
118+
| photos | Media, many files |
119+
| description | Long text |
120+
| date | Short text |
121+
| order | Decimal |

package.json

Lines changed: 16 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -17,30 +17,37 @@
1717
},
1818
"dependencies": {
1919
"@react-three/fiber": "^8.16.3",
20-
"@types/three": "^0.164.0",
20+
"@types/three": "0.180.0",
2121
"classnames": "^2.5.1",
2222
"cobe": "^0.6.3",
2323
"d3-geo": "^3.1.1",
2424
"justifiedGallery": "^3.8.1",
2525
"masonic": "^4.0.0",
26-
"next": "14.2.3",
26+
"next": "14.2.33",
2727
"photoswipe": "^5.4.3",
2828
"prettier": "^3.2.5",
29-
"react": "^18",
30-
"react-dom": "^18",
31-
"react-globe.gl": "^2.27.2",
29+
"react": "^18.3.1",
30+
"react-dom": "^18.3.1",
31+
"react-globe.gl": "2.27.2",
3232
"react-photoswipe-gallery": "^3.0.1",
3333
"react-spring": "^9.7.3",
34-
"three": "^0.164.1",
34+
"three": "0.180.0",
3535
"three-geojson-geometry": "^1.3.2",
36-
"three-globe": "^2.31.0",
3736
"topojson-client": "^3.1.0",
3837
"zod": "^3.23.8"
3938
},
39+
"overrides": {
40+
"three-render-objects": "1.39.3"
41+
},
42+
"pnpm": {
43+
"overrides": {
44+
"three-render-objects": "1.39.3"
45+
}
46+
},
4047
"devDependencies": {
4148
"@types/node": "^20",
42-
"@types/react": "^18",
43-
"@types/react-dom": "^18",
49+
"@types/react": "^18.3.1",
50+
"@types/react-dom": "^18.3.1",
4451
"eslint": "^8",
4552
"eslint-config-next": "14.2.3",
4653
"postcss": "^8",

0 commit comments

Comments
 (0)