|
1 |
| -A template/boilerplate for creating nextjs applications that use deep. It is recommended to merge with this repository to have its improvements in your nextjs application! |
| 1 | +# Deep.Memo App |
2 | 2 |
|
3 |
| -Just erase `pages/index.tsx` `Page` component body. |
| 3 | +[SDK](https://github.com/deep-foundation/sdk) based application, with configured [@deep-foundation/deepmemo-imports](https://github.com/deep-foundation/deepmemo-imports). |
4 | 4 |
|
5 |
| -# Variables |
| 5 | +[](https://gitpod.io/#https://github.com/deep-foundation/deepmemo-app) |
| 6 | +[](https://discord.gg/deep-foundation) |
6 | 7 |
|
7 |
| -```sh |
8 |
| -// Optional |
9 |
| -NEXT_PUBLIC_GRAPHQL_URL=DeepPath |
10 |
| -NEXT_PUBLIC_DEEP_TOKEN=DeepToken |
11 |
| -NEXT_PUBLIC_I18N_DISABLE=1 |
12 |
| -``` |
13 |
| - |
14 |
| -# How to make this repository pullable in your repository |
15 |
| -``` |
16 |
| -git remote add sdk https://github.com/deep-foundation/sdk.git |
17 |
| -git fetch sdk |
18 |
| -git merge sdk/main --allow-unrelated-histories --strategy ours |
19 |
| -``` |
20 |
| -Note that we use `ours` strategy during merge to avoid any changed in your existing project |
21 |
| -## How to pull some new commits but not old |
22 |
| -If you want to get some-commits to your repository - merge with `ours` strategy with old sdk commit that is created before required changes and then merge with main |
23 |
| -``` |
24 |
| -git remote add sdk https://github.com/deep-foundation/sdk.git |
25 |
| -git fetch sdk main |
26 |
| -git merge sdk/some_old_commit_hash --allow-unrelated-histories --strategy ours |
27 |
| -git merge sdk/main |
28 |
| -``` |
29 |
| -Note: I am sure that it is not the only way to do this. Possibly you can use `cherry-pick` to do this |
30 |
| - |
31 |
| -Now you can pull changes from this repository by using |
32 |
| -``` |
33 |
| -git pull sdk main |
34 |
| -``` |
| 8 | +## envs |
35 | 9 |
|
36 |
| -## Prerequisitions |
37 |
| -- Install and use nodejs version from .nvmrc |
38 |
| -``` |
39 |
| -nvm install 18 && nvm alias default 18; npm use default; |
40 |
| -``` |
41 |
| -- Install dependencies |
42 |
| -``` |
43 |
| -npm ci; (cd electron; npm ci) |
44 |
| -``` |
45 |
| -- Run by using [How to run](#how-to-run) |
46 |
| -- Pass graphql url and token |
47 |
| -To easily get token you can use `Copy token` button in the menu of deepcase. In the same menu you can find `gql` button where you can get graphql path |
48 |
| -- Install Homebrew |
49 |
| -``` |
50 |
| -/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)" |
51 |
| -``` |
52 |
| - |
53 |
| -## How to build manually |
54 |
| - |
55 |
| -### Web |
56 |
| -Development |
57 |
| -``` |
58 |
| -npm run dev |
59 | 10 | ```
|
60 |
| -<details> |
61 |
| - <summary>screenshot</summary> |
62 |
| - |
63 |
| -  |
64 |
| -</details> |
65 |
| - |
66 |
| -Build server+client build with ssr |
67 |
| -``` |
68 |
| -npm run build && |
69 |
| -npm run start |
70 |
| -``` |
71 |
| -Export static client without server |
72 |
| -``` |
73 |
| -npm run export |
74 |
| -``` |
75 |
| - |
76 |
| - |
77 |
| -### Android |
78 |
| -Prepare: |
79 |
| -- Install Android Studio. |
80 |
| -- Install in (Settings -> Languages & Frameworks -> Android SDK -> SDK Tool): |
81 |
| - - Android SDK Command-line Tools |
82 |
| - - Android Emulator |
83 |
| - - Android SDK Platfrom-Tool |
84 |
| - - Google Play services |
85 |
| -- Install in (Settings -> Languages & Frameworks -> Android SDK -> SDK Platforms): |
86 |
| - - Android 14 |
87 |
| -Build: |
88 |
| -``` |
89 |
| -npm run build-android && |
90 |
| -npm run open-android |
91 |
| -``` |
92 |
| -<details> |
93 |
| - <summary>screenshot</summary> |
94 |
| - |
95 |
| -  |
96 |
| -</details> |
97 |
| - |
98 |
| -### IOS |
99 |
| -Prepare: |
100 |
| -- Xcode 10 or later installed on your Mac. |
101 |
| -- execute this |
102 |
| -``` |
103 |
| -brew install cocoapods |
104 |
| -(cd ios/App/App; pod install) |
105 |
| -``` |
106 |
| -Build |
107 |
| -``` |
108 |
| -npm run build-ios && |
109 |
| -npm run run-ios |
110 |
| -``` |
111 |
| -<details> |
112 |
| - <summary>screenshot</summary> |
113 |
| - |
114 |
| -  |
115 |
| -</details> |
116 |
| - |
117 |
| -### Windows |
118 |
| -``` |
119 |
| -npm run build-windows |
120 |
| -``` |
121 |
| - |
122 |
| -### Unix |
123 |
| -``` |
124 |
| -npm run build-unix |
125 |
| -``` |
126 |
| - |
127 |
| -### Mac |
128 |
| -Prepare: |
129 |
| -- Xcode 10 or later installed on your Mac. |
130 |
| -- An [Apple Developer](https://developer.apple.com/) account. |
131 |
| -- [An app-specific password for your ADC account’s Apple ID](https://support.apple.com/HT204397) |
132 |
| -- `security add-generic-password -l "sdk" -a "YOUR-APPLEID-EMAIL" -s "keychain" -T "" -w "APP-PASSWORD-FROM-APPLE"` |
133 |
| -- [Generate teamId](https://github.com/electron/notarize?tab=readme-ov-file#notes-on-your-teamid) |
134 |
| -- update APPLEIDPASS, APPLEID, CSC_NAME, APPLETEAMID in `package.json`.`scripts`.`build-mac` |
135 |
| -``` |
136 |
| -npm run build-mac |
137 |
| -``` |
138 |
| -<details> |
139 |
| - <summary>screenshot</summary> |
140 |
| - |
141 |
| -  |
142 |
| -</details> |
143 |
| - |
144 |
| -### Chrome extension |
145 |
| -``` |
146 |
| -npm run build-chrome-extension |
147 |
| -``` |
148 |
| -Result path: `sdk/extension.crx` and `sdk/extension.pem` |
149 |
| -<details> |
150 |
| - <summary>screenshot</summary> |
151 |
| - |
152 |
| -  |
153 |
| -</details> |
154 |
| - |
155 |
| -### Github Pages |
156 |
| -Only activate GitHub Pages for Your Repository |
157 |
| - |
158 |
| -(Settings -> Pages -> Source -> Deploy from branch main -> Github Actions) |
159 |
| - |
160 |
| -> There is no need to make any changes to the code. |
161 |
| -<details> |
162 |
| - <summary>screenshot</summary> |
163 |
| -
|
164 |
| -  |
165 |
| -</details> |
166 |
| - |
167 |
| -# Development |
168 |
| -You can use environment variables to set graphql path and token on server instead of setting it on client. See template in [.env.development](https://github.com/deep-foundation/sdk/blob/main/.env.development). Create a file `.env.local` with your values |
169 |
| - |
170 |
| -# Translation i18n |
171 |
| -You can edit `/public/locales/*/*.json` files as `/public/locales/en/common.json` and use it inside your components as: |
172 |
| -```tsx |
173 |
| -const { t } = useTranslation(); |
174 |
| -<div>{t('connection')}</div> |
175 |
| -``` |
176 |
| -You **must** use this on every page: |
177 |
| -```tsx |
178 |
| -import { i18nGetStaticProps } from "../src/i18n"; |
179 |
| -export async function getStaticProps(arg) { |
180 |
| - return await i18nGetStaticProps(arg); |
181 |
| -} |
182 |
| -``` |
183 |
| -And this on every dynamc route page (as /path/[variable]) |
184 |
| -```tsx |
185 |
| -export async function getStaticPaths() { |
186 |
| - return { |
187 |
| - paths: ['/path/123'], |
188 |
| - fallback: true |
189 |
| - } |
190 |
| -} |
191 |
| -``` |
192 |
| -For support static `npm run export` of nextjs, you can use env variable NEXT_PUBLIC_I18N_DISABLE. But i18n is not available in export nextjs mode. |
193 |
| - |
194 |
| -## Restart |
195 |
| - |
196 |
| -### GitPod |
197 |
| - |
198 |
| -SDK app is started together with Deep.Links and other services in GitPod. So to restart it from GitPod you should do the following: |
199 |
| - |
200 |
| -1. Find terminal there `npm run gitpod-start` command was executed. |
201 |
| - |
202 |
| - |
203 |
| -2. Press `CTRL+C` in terminal to stop a Deep instance (Deep.Links and SDK). |
204 |
| - |
205 |
| - |
206 |
| -3. Press `↑` button on your keyboard to get last executed command. |
207 |
| - |
208 |
| - |
209 |
| -4. Press `Enter` to execute that command again, that will finish restart sequence. |
210 |
| - |
211 |
| - |
212 |
| -## NPM |
213 |
| - |
214 |
| -If you want launch your repo from npx as `npx @deep-foundation/sdk` you must change name in package.json, manually `npm adduser` and first publish `npm publish --access public` yout fork. |
215 |
| - |
216 |
| -For publish new version, just update package.json version field and then git commit && publish to github. |
217 |
| - |
218 |
| -This app can be launched as builded web server with `npx @deep-foundation/sdk` |
| 11 | +export NEXT_PUBLIC_GQL_PATH=localhost:3006/gql; |
| 12 | +export NEXT_PUBLIC_GQL_SSL=0; |
| 13 | +``` |
0 commit comments