Skip to content

AI情绪管理app,AI可以记录你的情绪,并且通过图表显示自己的情绪在一段时间的变化。

Notifications You must be signed in to change notification settings

AeolusZane/ai-app

Repository files navigation

AI-App

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.

Crypto Env

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");
    }
/// ...

Database Server

Neon

if don't have neonctl need to install it npm install -g neonctl

Database ORM

Prisma

Setup

npm install

Run

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

About

AI情绪管理app,AI可以记录你的情绪,并且通过图表显示自己的情绪在一段时间的变化。

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published