This's an app you can write your entries. By AI power, it can tell you what the mood of your journal entry is. And it would try to analysis what you were feeling, saying, how you feel that day(pos or neg).
U can ask it, how i felt that day? Was i in a bad mood this month?... AI will give you answer.
We don't need to know anything about the ai algorithm, just need to know how to call the api of openAI.
I use crypto to upload env variables, npm run gen
to generate env variable.
- 通过将【密码】做hash(使用
id
)生成SigningKey
【私钥】 - 使用
id
生成【消息摘要】 - 用【私钥】对【消息摘要】做签名,生成【地址】,使用
recoverAddress
- 【地址】用于验证密码是否正确,【地址】明文保存
- 用【对称加密】恢复环境变量文件
File: gen_env.js
/// ...
const key = new SigningKey(id("private-key"));
const digest = id("private-key");
const sig = key.sign(digest).serialized;
const address = recoverAddress(digest, sig);
if (address === VERIFY_ADDRESS) {
if (answers.mode === 'encrypt') {
cipher_file("private-key");
} else {
decipher_file("private-key");
}
} else {
console.error("Invalid password");
}
/// ...
if don't have neonctl
need to install it npm install -g neonctl
npm install
npm run dev
project setup
- serveless database: neon
- databse orm: prisma
- auth: clerk
- log in/sign up logic
... 2024-10-19
building the journal page
- new user
- creating the journal page
- user profile widget from clerk
- journal entry ui
**creating & updating journal entries
- api call
- new entry component
- entry card component