diff --git a/.DS_Store b/.DS_Store new file mode 100644 index 000000000..978792356 Binary files /dev/null and b/.DS_Store differ diff --git a/.cursor/rules/general-rule.mdc b/.cursor/rules/general-rule.mdc index 01ef0ac64..989407503 100644 --- a/.cursor/rules/general-rule.mdc +++ b/.cursor/rules/general-rule.mdc @@ -1,11 +1,15 @@ --- -description: -globs: +description: +globs: alwaysApply: true --- + ## Rules to Follow -- You must always commit your changes whenever you update code. +- You always prefer to use branch development. +- Before writing any code, you create a feature branch to hold those changes. +- After you are done, provide instructions in a "Merge.md" file that explains how to merge the changes back to main with both a Github PR route and a Github CLI route. +- You must always commit your changes whenever you update code. - You must always try and write code that is well documented. (self or commented is fine) - You must only work on a single feature at a time. -- You must explain your decisions thouroughly to the user. \ No newline at end of file +- You must explain your decisions thouroughly to the user. diff --git a/Merge.md b/Merge.md new file mode 100644 index 000000000..0126f4caf --- /dev/null +++ b/Merge.md @@ -0,0 +1,166 @@ +# Merge Instructions + +This repo follows a branch-based workflow. All work for this UI fix was done on `fix/chat-question-overwrite`. +Previous rollback context remains available on `rollback/ca7e9c0` (reset to commit `ca7e9c03403e3053ede6a2d14b00531facf95d98`). + +## Create PR on GitHub (UI Route) + +1. Push your branch (if not already pushed): + +```bash +git push -u origin fix/chat-question-overwrite +``` + +2. Open a Pull Request from `fix/chat-question-overwrite` into `main` on GitHub. +3. Add reviewers and wait for approvals and CI to pass. +4. Use βSquash and mergeβ or your preferred merge strategy. + +## GitHub CLI Route + +From the repo root: + +```bash +git push -u origin fix/chat-question-overwrite +gh pr create --fill --base main --head fix/chat-question-overwrite +gh pr view --web # optional, open in browser +gh pr merge --merge # or --squash / --rebase per your preference +``` + +## Post-merge cleanup + +```bash +git checkout main +git pull origin main +git branch -d fix/chat-question-overwrite +``` + +## Notes for Reviewers + +- Rollback branch `rollback/ca7e9c0` points to commit `ca7e9c0`. +- Effectively reverts subsequent changes after `ca7e9c0` by merging this branch. +- Validate that critical functionality at that commit still builds/tests cleanly. +- Any newer work has been preserved on its original feature branches. + +# Deployment Instructions + +This project consists of two separate deployments: + +1. Frontend (Next.js) +2. API (FastAPI) + +## API Deployment + +### Prerequisites + +1. Install Vercel CLI: + +```bash +npm install -g vercel +``` + +2. Login to Vercel: + +```bash +vercel login +``` + +### Deploy API + +1. Navigate to the API directory: + +```bash +cd api +``` + +2. Deploy to Vercel: + +```bash +vercel +``` + +3. After deployment, copy the API URL (you'll need it for the frontend) + +### Environment Variables for API + +Set these in your Vercel project dashboard: + +- `OPENAI_API_KEY`: Your OpenAI API key + +## Frontend Deployment + +### Prerequisites + +Same as API deployment (Vercel CLI and login) + +### Deploy Frontend + +1. Navigate to the frontend directory: + +```bash +cd frontend +``` + +2. Deploy to Vercel: + +```bash +vercel +``` + +### Environment Variables for Frontend + +Set these in your Vercel project dashboard: + +- `NEXT_PUBLIC_API_URL`: The URL of your deployed API (e.g., https://your-api.vercel.app) + +## Monitoring and Management + +### API Project + +1. Monitor API logs and performance in Vercel dashboard +2. Check Function execution logs +3. Monitor API rate limits and usage + +### Frontend Project + +1. Monitor build logs and deployment status +2. Check static asset delivery +3. Monitor page performance + +## Troubleshooting + +### API Issues + +1. Check API logs in Vercel dashboard +2. Verify environment variables are set +3. Test API endpoints directly + +### Frontend Issues + +1. Check build logs +2. Verify API URL is correctly set +3. Check browser console for errors +4. Verify API is accessible from frontend domain + +## Alternative: GitHub PR Route + +1. For API changes: + +```bash +cd api +gh pr create --title "Deploy API changes" --body "Deploy latest API changes to Vercel" +``` + +2. For Frontend changes: + +```bash +cd frontend +gh pr create --title "Deploy Frontend changes" --body "Deploy latest Frontend changes to Vercel" +``` + +3. After PRs are merged: + +```bash +gh pr merge +``` + +Vercel will automatically deploy changes when merged to main branch for each project. diff --git a/README.md b/README.md index 97bd3b1bd..4ed8db3a2 100644 --- a/README.md +++ b/README.md @@ -3,7 +3,6 @@ height="auto"/>
- ##+ Enter your OpenAI API key to get started with the chat assistant. +
++ Don't have an API key?{" "} + + Get one from OpenAI + +
+{model}
++ {isPdfUploaded + ? "PDF uploaded! Choose a topic and start asking questions." + : "Use the panel on the right to upload a PDF and pick a topic."} +
++ Powered by GPT-4.1-mini with streaming responses +
+