{"id":31897735,"url":"https://github.com/regnull/ratemyportfolio","last_synced_at":"2025-10-13T11:44:37.190Z","repository":{"id":317447102,"uuid":"1067443584","full_name":"regnull/ratemyportfolio","owner":"regnull","description":null,"archived":false,"fork":false,"pushed_at":"2025-09-30T22:19:19.000Z","size":113,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-10-01T00:19:33.693Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/regnull.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2025-09-30T21:33:36.000Z","updated_at":"2025-09-30T22:19:24.000Z","dependencies_parsed_at":"2025-10-01T00:19:36.000Z","dependency_job_id":"1dccbaeb-f2dc-4d56-b940-a4937ca55aad","html_url":"https://github.com/regnull/ratemyportfolio","commit_stats":null,"previous_names":["regnull/ratemyportfolio"],"tags_count":null,"template":false,"template_full_name":null,"purl":"pkg:github/regnull/ratemyportfolio","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/regnull%2Fratemyportfolio","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/regnull%2Fratemyportfolio/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/regnull%2Fratemyportfolio/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/regnull%2Fratemyportfolio/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/regnull","download_url":"https://codeload.github.com/regnull/ratemyportfolio/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/regnull%2Fratemyportfolio/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":279014811,"owners_count":26085594,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-10-13T02:00:06.723Z","response_time":61,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2025-10-13T11:44:35.006Z","updated_at":"2025-10-13T11:44:37.184Z","avatar_url":"https://github.com/regnull.png","language":"TypeScript","readme":"# Rate My Portfolio\n\nRate My Portfolio is a slick Next.js web application that helps investors evaluate how well their holdings align with their risk tolerance. Upload the documents that describe a portfolio, pick a risk profile, and the app will send everything to an AI model that returns ratings, commentary, and improvement ideas that you can share with others.\n\n## Project plan\n\n1. **Discover \u0026 design** – Confirm the product requirements, map the primary user flow (upload → choose risk → submit → view/share results), and outline the supporting API and UI components.\n2. **Implement the experience** – Bootstrap a Next.js 15 app with Tailwind CSS, build reusable components for uploads, risk selection, results, and sharing, and create an API route that composes an LLM prompt from the uploaded files.\n3. **Document \u0026 test** – Capture configuration details (environment variables, scripts) in this README and validate the project using the built-in lint command.\n\n## Architecture overview\n\n- **App Router (Next.js 15)** – The UI lives under `app/` using a single-page workflow with client components for interactive controls.\n- **Components** – Custom building blocks (`FileUpload`, `RiskToleranceSelector`, `ResultCard`, `ShareButton`) keep the page composed, accessible, and easy to extend.\n- **API Route (`app/api/rate`)** – Accepts multipart form data, normalises risk selection, reads the text contents of each file (up to 5 MB, trimmed to 2 000 characters), and calls OpenAI to obtain structured JSON analysis. If no API key is configured, the route returns a deterministic mock analysis so that the front end remains testable.\n- **Styling** – Tailwind CSS 4 powers a glassmorphic-inspired design with gradients, rounded surfaces, and high-contrast typography.\n\n## Getting started\n\n### Prerequisites\n\n- Node.js 18.18 or later (Next.js 15 requirement)\n- npm 9+ (installed automatically with Node)\n\n### Installation\n\nInstall dependencies after cloning the repository:\n\n```bash\nnpm install\n```\n\n### Environment configuration\n\nThe portfolio analysis endpoint requires an OpenAI API key. Create a `.env.local` file at the project root and add the key:\n\n```bash\nOPENAI_API_KEY=sk-your-key-here\n```\n\nWhen the key is missing the API responds with a helpful mock analysis so the UI can be demonstrated without external services.\n\n### Running the development server\n\n```bash\nnpm run dev\n```\n\nThe app will be available at [http://localhost:3000](http://localhost:3000). Uploaded files never leave your browser until you submit the form.\n\n### Building for production\n\n```bash\nnpm run build\n```\n\nStart the production build locally with:\n\n```bash\nnpm run start\n```\n\n### Linting\n\n```bash\nnpm run lint\n```\n\n## Usage tips\n\n1. Upload text-based statements, spreadsheets, or screenshots describing your portfolio (each file must be smaller than 5 MB).\n2. Select the risk tolerance that best matches your objectives: Conservative, Moderate, Aggressive, or Extremely Aggressive.\n3. Click **Rate my portfolio** to generate insights. The response includes axis-specific ratings and actionable suggestions.\n4. Share the results using the Web Share API or copy link fallback.\n\n## Folder structure highlights\n\n- `app/page.tsx` – Main landing page, orchestrates upload, submission, and rendering of results.\n- `app/api/rate/route.ts` – Backend route that builds the AI prompt and returns the analysis JSON.\n- `components/` – Reusable UI components that keep concerns separated.\n- `lib/prompt.ts` – Prompt builder and constants for file processing.\n\n## Future enhancements\n\n- Persist analyses to generate shareable URLs with historical tracking.\n- Support deeper document parsing (PDF text extraction, spreadsheet parsing) before calling the LLM.\n- Add automated tests for the upload form and API route using Playwright or Vitest.\n\n## License\n\nThis project is provided as-is for demonstration purposes.\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fregnull%2Fratemyportfolio","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fregnull%2Fratemyportfolio","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fregnull%2Fratemyportfolio/lists"}