From af5691e7734c3b62e65fa0c19a30144bb0eee886 Mon Sep 17 00:00:00 2001 From: willchen96 Date: Mon, 11 May 2026 03:15:34 +0800 Subject: [PATCH] Update OSS setup docs and remove app legal pages --- README.md | 127 ++++++++++--------- backend/.gitignore | 1 + frontend/src/app/privacy/page.tsx | 160 ----------------------- frontend/src/app/terms/page.tsx | 202 ------------------------------ 4 files changed, 64 insertions(+), 426 deletions(-) delete mode 100644 frontend/src/app/privacy/page.tsx delete mode 100644 frontend/src/app/terms/page.tsx diff --git a/README.md b/README.md index 0a5351d..c5807f0 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ # Mike -Open-source release containing the Mike frontend and backend. +Mike is a legal document assistant with a Next.js frontend, an Express backend, Supabase Auth/Postgres, and Cloudflare R2-compatible object storage. ## Contents @@ -19,46 +19,80 @@ Open-source release containing the Mike frontend and backend. - At least one supported model provider API key: Anthropic, Google Gemini, or OpenAI - LibreOffice installed locally if you need DOC/DOCX to PDF conversion -## Setup +## Database Setup -### 1. Clone the repo +For a new Supabase database, open the Supabase SQL editor and run: -```bash -git clone https://github.com/willchen96/mike.git -cd mike +```sql +-- copy and run the contents of: +-- backend/schema.sql ``` -### 2. Install dependencies +The schema file is based on `supabase-migration.sql` and folds in the later files in `backend/migrations/`. + +For an existing database, do not run the full schema file over production data. Apply the incremental files in `backend/migrations/` instead. + +## Environment + +Create local env files: + +```bash +touch backend/.env +touch frontend/.env.local +``` + +Create `backend/.env`: + +```bash +PORT=3001 +FRONTEND_URL=http://localhost:3000 +DOWNLOAD_SIGNING_SECRET=replace-with-a-random-32-byte-hex-string +SUPABASE_URL=https://your-project.supabase.co +SUPABASE_SECRET_KEY=your-supabase-service-role-key + +R2_ENDPOINT_URL=https://your-account-id.r2.cloudflarestorage.com +R2_ACCESS_KEY_ID=your-r2-access-key +R2_SECRET_ACCESS_KEY=your-r2-secret-key +R2_BUCKET_NAME=mike + +GEMINI_API_KEY=your-gemini-key +ANTHROPIC_API_KEY=your-anthropic-key +OPENAI_API_KEY=your-openai-key +RESEND_API_KEY=your-resend-key +USER_API_KEYS_ENCRYPTION_SECRET=your-long-random-secret +``` + +Create `frontend/.env.local`: + +```bash +NEXT_PUBLIC_SUPABASE_URL=https://your-project.supabase.co +NEXT_PUBLIC_SUPABASE_PUBLISHABLE_DEFAULT_KEY=your-supabase-anon-key +SUPABASE_SECRET_KEY=your-supabase-service-role-key +NEXT_PUBLIC_API_BASE_URL=http://localhost:3001 +``` + +Supabase values come from the project dashboard. Use the project URL for `SUPABASE_URL` / `NEXT_PUBLIC_SUPABASE_URL`, the service role key for `SUPABASE_SECRET_KEY`, and the anon/public key for `NEXT_PUBLIC_SUPABASE_PUBLISHABLE_DEFAULT_KEY`. If your Supabase project shows multiple key formats, use the legacy JWT-style anon and service role keys expected by the Supabase client libraries. + +Provider keys are only needed for the models and email features you plan to use. Model provider keys can be configured in `backend/.env` for the whole instance, or per user in **Account > Models & API Keys**. If a provider key is present in `backend/.env`, that provider is available by default and the matching browser API key field is read-only. + +## Install + +Install each app package: ```bash npm install --prefix backend npm install --prefix frontend ``` -### 3. Create env files +## Run Locally -```bash -cp backend/.env.example backend/.env -cp frontend/.env.local.example frontend/.env.local -``` - -Then fill in the values. See [Environment Variables](#environment-variables) below. - -### 4. Run the database schema - -For a new Supabase database, open the Supabase SQL editor and run the contents of `backend/schema.sql`. - -For an existing database, do not run the full schema file over production data. Apply the incremental files in `backend/migrations/` instead. - -### 5. Start the backend +Start the backend: ```bash npm run dev --prefix backend ``` -Backend runs on `http://localhost:3001`. - -### 6. Start the frontend +Start the main app: ```bash npm run dev --prefix frontend @@ -66,42 +100,11 @@ npm run dev --prefix frontend Open `http://localhost:3000`. -### 7. Sign up and add a model API key +## First Run -Sign up in the app. If you did not set provider keys in `backend/.env`, open **Account > Models & API Keys** and add an Anthropic, Gemini, or OpenAI API key. - -## Environment Variables - -Supabase values come from the project dashboard. Use the project URL for `SUPABASE_URL` / `NEXT_PUBLIC_SUPABASE_URL`, the service role key for `SUPABASE_SECRET_KEY`, and the anon/public key for `NEXT_PUBLIC_SUPABASE_PUBLISHABLE_DEFAULT_KEY`. If your Supabase project shows multiple key formats, use the legacy JWT-style anon and service role keys expected by the Supabase client libraries. - -### Backend (`backend/.env`) - -| Variable | Notes | -| --- | --- | -| `PORT` | Defaults to `3001` | -| `FRONTEND_URL` | `http://localhost:3000` for local development | -| `SUPABASE_URL` | Supabase project URL | -| `SUPABASE_SECRET_KEY` | Supabase service role key | -| `R2_ENDPOINT_URL` | Cloudflare R2, MinIO, or another S3-compatible endpoint | -| `R2_ACCESS_KEY_ID` | Object storage access key | -| `R2_SECRET_ACCESS_KEY` | Object storage secret key | -| `R2_BUCKET_NAME` | Object storage bucket name | -| `GEMINI_API_KEY` | Optional Google Gemini key | -| `ANTHROPIC_API_KEY` | Optional Anthropic key | -| `OPENAI_API_KEY` | Optional OpenAI key | -| `RESEND_API_KEY` | Optional, for email features | -| `USER_API_KEYS_ENCRYPTION_SECRET` | Secret used to encrypt per-user API keys | - -### Frontend (`frontend/.env.local`) - -| Variable | Notes | -| --- | --- | -| `NEXT_PUBLIC_SUPABASE_URL` | Supabase project URL | -| `NEXT_PUBLIC_SUPABASE_PUBLISHABLE_DEFAULT_KEY` | Supabase anon/public key | -| `SUPABASE_SECRET_KEY` | Supabase service role key | -| `NEXT_PUBLIC_API_BASE_URL` | `http://localhost:3001` for local development | - -Provider keys are only needed for the models and email features you plan to use. Model provider keys can be configured in `backend/.env` for the whole instance, or per user in **Account > Models & API Keys**. If a provider key is present in `backend/.env`, that provider is available by default and the matching browser API key field is read-only. +1. Sign up in the app. +2. If you did not set provider keys in `backend/.env`, open **Account > Models & API Keys** and add an Anthropic, Gemini, or OpenAI API key. +3. Create or open a project and start chatting with documents. ## Troubleshooting @@ -118,7 +121,3 @@ npm run build --prefix backend npm run build --prefix frontend npm run lint --prefix frontend ``` - -## License - -AGPL-3.0-only. See `LICENSE`. diff --git a/backend/.gitignore b/backend/.gitignore index fb56fbb..6b319f7 100644 --- a/backend/.gitignore +++ b/backend/.gitignore @@ -1,6 +1,7 @@ node_modules dist .env* +!.env.example *.log logs/ .DS_Store diff --git a/frontend/src/app/privacy/page.tsx b/frontend/src/app/privacy/page.tsx deleted file mode 100644 index 0223e61..0000000 --- a/frontend/src/app/privacy/page.tsx +++ /dev/null @@ -1,160 +0,0 @@ -"use client"; - -export default function PrivacyPage() { - return ( -
-
-

- Privacy Policy -

-
-

- 1. Introduction -

-

- Mike ("we," "our," or "us") is committed to protecting - your privacy. This Privacy Policy explains how we - collect, use, disclose, and safeguard your information - when you use our legal research service. -

-
- -
-

- 2. Information We Collect -

-

- We collect information that you provide directly to us, - including: -

-
    -
  • Email address and account credentials
  • -
  • Search queries and research history
  • -
  • Chat conversations with our AI assistant
  • -
  • Usage data and preferences within the service
  • -
-
- -
-

- 3. How We Use Your Information -

-

- We use the information we collect to: -

-
    -
  • Provide, maintain, and improve our services
  • -
  • Process your requests and transactions
  • -
  • Send you technical notices and support messages
  • -
  • Respond to your comments and questions
  • -
  • Develop new features and improve our AI models
  • -
-
- -
-

- 4. Information Sharing and Disclosure -

-

- We do not sell your personal information. We may share - your information only in the following circumstances: -

-
    -
  • With your consent
  • -
  • - To comply with legal obligations or court orders -
  • -
  • - To protect our rights, privacy, safety, or property -
  • -
  • - With service providers who assist in our operations -
  • -
-
- -
-

- 5. Data Security -

-

- We implement appropriate technical and organizational - measures to protect your personal information. However, - no method of transmission over the Internet or - electronic storage is 100% secure, and we cannot - guarantee absolute security. -

-
- -
-

- 6. Data Retention -

-

- We retain your personal information for as long as - necessary to provide our services and fulfill the - purposes outlined in this Privacy Policy, unless a - longer retention period is required by law. -

-
- -
-

7. Your Rights

-

- You have the right to: -

-
    -
  • Access and receive a copy of your data
  • -
  • Correct inaccurate or incomplete data
  • -
  • Request deletion of your data
  • -
  • Object to or restrict data processing
  • -
  • Data portability
  • -
-
- -
-

- 8. Cookies and Tracking Technologies -

-

- We use cookies and similar tracking technologies to - collect and track information about your usage of our - service. You can control cookies through your browser - settings. -

-
- -
-

- 9. Children's Privacy -

-

- Our service is not intended for children under 13 years - of age. We do not knowingly collect personal information - from children under 13. -

-
- -
-

- 10. Changes to This Privacy Policy -

-

- We may update this Privacy Policy from time to time. We - will notify you of any changes by posting the new - Privacy Policy on this page and updating the "Last - updated" date. -

-
- -
-

11. Contact Us

-

- If you have any questions about this Privacy Policy, - please contact us at team@mikeoss.com. -

-
-
-
- ); -} diff --git a/frontend/src/app/terms/page.tsx b/frontend/src/app/terms/page.tsx deleted file mode 100644 index 179af30..0000000 --- a/frontend/src/app/terms/page.tsx +++ /dev/null @@ -1,202 +0,0 @@ -"use client"; - -const lastUpdated = "May 2, 2026"; - -const sections = [ - { - title: "1. Acceptance of Terms", - body: [ - "Welcome to Mike. These Terms of Service are a legally binding agreement between you and Mike regarding your access to and use of our website, hosted application, open-source software, APIs, and related services.", - "By creating an account, clicking to accept these Terms, or using the Service, you acknowledge that you have read, understood, and agree to be bound by these Terms and our Privacy Policy. If you do not agree, you may not use the Service.", - ], - }, - { - title: "2. Service Overview", - body: [ - "Mike provides legal AI workflow tools, including document upload, project workspaces, document chat, citations, tabular review, reusable workflows, and document drafting or editing features.", - "Mike hosted on MikeOSS.com is currently provided as a demo service for evaluation and testing purposes only. You should not upload, submit, transmit, or store sensitive, confidential, privileged, proprietary, personally identifiable, client, or otherwise restricted information through the Service. Use the Service only with non-sensitive materials and at your own risk.", - "The Service may connect to third-party large language model providers, hosting providers, authentication services, storage services, and payment or infrastructure providers. We may add, remove, suspend, or modify features or third-party integrations at any time.", - ], - }, - { - title: "3. Eligibility and Authority", - body: [ - "You must be at least 13 years old to use the Service. If you are under 18, you must have permission from a parent or legal guardian.", - "If you use the Service on behalf of a company, law firm, organization, or other entity, you represent that you have authority to bind that entity to these Terms.", - ], - }, - { - title: "4. Accounts and Security", - body: [ - "You may need an account to access most features. You agree to provide accurate account information and to keep it up to date.", - "You are responsible for maintaining the confidentiality of your account credentials and for all activity under your account. If you believe your account is compromised, contact us promptly at team@mikeoss.com.", - ], - }, - { - title: "5. Fees, Credits, and Third-Party Costs", - body: [ - "Some features may be free, metered, usage-limited, or paid. We may introduce or change fees, plans, credits, quotas, or usage limits with notice where required by law.", - "If you connect your own third-party AI provider API keys, you are responsible for any charges, usage limits, provider terms, or account restrictions imposed by those providers.", - "Unless otherwise stated at the time of purchase, fees are non-refundable except where required by law.", - ], - }, - { - title: "6. User Content and AI Outputs", - body: [ - "You may submit documents, prompts, text, files, data, and other materials to the Service (\"Input\") and receive AI-generated or system-generated responses, summaries, extractions, drafts, edits, citations, or other content (\"Output\"). Input and Output are collectively \"User Content.\"", - "As between you and Mike, you retain any rights you have in your Input. Subject to applicable law and third-party provider terms, you are responsible for evaluating and using Output.", - "You grant Mike a limited license to host, store, process, transmit, display, and otherwise use User Content as necessary to provide, secure, troubleshoot, improve, and support the Service.", - "You represent that you have all rights and permissions necessary to submit Input to the Service and that your Input and use of the Service will not violate law, third-party rights, confidentiality duties, court orders, professional obligations, or applicable provider terms.", - ], - }, - { - title: "7. Legal and Professional Responsibility", - body: [ - "Mike is a software tool. It does not provide legal, financial, tax, regulatory, compliance, or professional advice, and it does not create an attorney-client relationship.", - "AI systems can produce inaccurate, incomplete, outdated, or misleading Output. You are solely responsible for reviewing, verifying, and exercising professional judgment before relying on any Output or using it in client work, filings, transactions, negotiations, or legal advice.", - ], - }, - { - title: "8. Third-Party AI Models and Services", - body: [ - "The Service may route Input to third-party AI models or infrastructure providers selected by you, configured by your account, or made available through the Service.", - "Your use of third-party models or services may be subject to additional terms, policies, data practices, retention settings, training settings, and usage restrictions. We are not responsible for third-party services, model availability, model behavior, pricing, outages, or provider terms.", - ], - }, - { - title: "9. Prohibited Conduct", - body: [ - "You agree not to use the Service for unlawful, harmful, infringing, deceptive, abusive, or security-compromising activity.", - "You may not attempt to gain unauthorized access to the Service or any account, interfere with the Service, upload malware, scrape or copy the Service except as permitted by law or applicable open-source licenses, bypass usage limits, misrepresent your identity, or use the Service in violation of any third-party AI provider terms.", - "You may not submit Input that you do not have the right to use, that violates confidentiality or privacy obligations, or that infringes intellectual property or other third-party rights.", - ], - }, - { - title: "10. Open-Source Software and Ownership", - body: [ - "Certain Mike software may be made available under open-source licenses. Your use, copying, modification, and distribution of that open-source software is governed by the applicable open-source license, not these Terms.", - "The hosted Service, website, brand, design, trade names, hosted infrastructure, documentation, and non-open-source elements are owned by Mike or its licensors and are protected by intellectual property and other laws.", - ], - }, - { - title: "11. Feedback", - body: [ - "If you provide comments, suggestions, ideas, or feedback, you grant us a perpetual, irrevocable, worldwide, royalty-free license to use that feedback for any purpose without obligation to compensate you.", - ], - }, - { - title: "12. Confidentiality", - body: [ - "Each party may receive non-public information from the other in connection with the Service. The receiving party will use reasonable care to protect confidential information and will use it only for purposes related to the Service, except where disclosure is required by law or authorized by the disclosing party.", - "Confidential information does not include information that is public through no fault of the receiving party, already known without a confidentiality duty, lawfully received from a third party, independently developed, or submitted as feedback.", - ], - }, - { - title: "13. Privacy and Data Protection", - body: [ - "Please review our Privacy Policy for information about how we collect, use, store, and disclose personal information. The Privacy Policy is incorporated into these Terms.", - "If you use the Service on behalf of an organization and require a data processing agreement, contact us at team@mikeoss.com.", - ], - }, - { - title: "14. Suspension and Termination", - body: [ - "You may stop using the Service at any time. We may suspend or terminate your access to the Service if you violate these Terms, create risk for the Service or other users, or if we discontinue the Service or any material feature.", - "Upon termination, your right to use the Service ends, but provisions that by their nature should survive will survive, including provisions about User Content, ownership, confidentiality, disclaimers, limitations of liability, indemnity, and dispute resolution.", - ], - }, - { - title: "15. Disclaimers", - body: [ - "THE SERVICE, OUTPUT, MATERIALS, AND ALL CONTENT AVAILABLE THROUGH THE SERVICE ARE PROVIDED \"AS IS\" AND \"AS AVAILABLE\" WITHOUT WARRANTIES OF ANY KIND, WHETHER EXPRESS, IMPLIED, OR STATUTORY.", - "TO THE MAXIMUM EXTENT PERMITTED BY LAW, WE DISCLAIM ALL WARRANTIES, INCLUDING IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, TITLE, QUIET ENJOYMENT, NON-INFRINGEMENT, ACCURACY, AVAILABILITY, SECURITY, AND RELIABILITY.", - "WE DO NOT WARRANT THAT THE SERVICE OR OUTPUT WILL BE UNINTERRUPTED, ERROR-FREE, SECURE, CURRENT, COMPLETE, OR SUITABLE FOR ANY PARTICULAR LEGAL OR PROFESSIONAL USE.", - ], - }, - { - title: "16. Limitation of Liability", - body: [ - "TO THE MAXIMUM EXTENT PERMITTED BY LAW, MIKE AND ITS AFFILIATES, OFFICERS, EMPLOYEES, CONTRACTORS, AGENTS, SUPPLIERS, AND LICENSORS WILL NOT BE LIABLE FOR INDIRECT, INCIDENTAL, SPECIAL, CONSEQUENTIAL, EXEMPLARY, OR PUNITIVE DAMAGES, OR FOR LOST PROFITS, LOST REVENUE, LOST DATA, LOSS OF GOODWILL, BUSINESS INTERRUPTION, OR SUBSTITUTE SERVICES.", - "THE SERVICE IS PROVIDED FREE OF CHARGE. TO THE MAXIMUM EXTENT PERMITTED BY LAW, MIKE WILL NOT BE LIABLE FOR ANY DAMAGES ARISING OUT OF OR RELATING TO THE SERVICE OR THESE TERMS.", - ], - }, - { - title: "17. Indemnity", - body: [ - "You will defend, indemnify, and hold harmless Mike and its affiliates, officers, employees, contractors, agents, suppliers, and licensors from and against claims, liabilities, damages, losses, and expenses, including reasonable attorneys' fees, arising from your use of the Service, your User Content, your violation of these Terms, your violation of law, or your violation of third-party rights.", - ], - }, - { - title: "18. Changes to These Terms", - body: [ - "We may modify these Terms from time to time. If changes materially affect your rights or obligations, we will provide reasonable notice, such as by posting the updated Terms or sending an email or in-product notice.", - "Your continued use of the Service after the effective date of updated Terms means you accept the updated Terms. If you do not agree, you must stop using the Service.", - ], - }, - { - title: "19. Governing Law and Dispute Resolution", - body: [ - "These Terms are governed by the laws of the State of New York, without regard to conflict of law principles, unless applicable law requires otherwise.", - "Before filing a claim, each party agrees to try to resolve the dispute informally by contacting the other party. You may contact us at team@mikeoss.com. If the dispute is not resolved within 30 days, either party may pursue available remedies in a court of competent jurisdiction.", - "You and Mike agree that claims must be brought only in an individual capacity and not as a plaintiff or class member in any class, collective, consolidated, private attorney general, or representative proceeding, to the maximum extent permitted by law.", - ], - }, - { - title: "20. Electronic Communications", - body: [ - "By using the Service, you consent to receive communications from us electronically. Electronic communications may include notices, account messages, product updates, and legal disclosures. You agree that electronic communications satisfy any legal requirement that such communications be in writing.", - ], - }, - { - title: "21. Contact", - body: [ - "If you have questions about these Terms, contact us at team@mikeoss.com.", - ], - }, -]; - -export default function TermsPage() { - return ( -
-
-

- Terms of Service -

-

- Last Updated: {lastUpdated} -

-
-

- Demo service notice -

-

- Mike hosted on MikeOSS.com is currently provided as a - demo service. Do not upload, submit, or store - sensitive, confidential, privileged, proprietary, - client, or personally identifiable documents or - information through the Service. -

-
-
- {sections.map((section) => ( -
-

- {section.title} -

-
- {section.body.map((paragraph) => ( -

- {paragraph} -

- ))} -
-
- ))} -
-
-
- ); -}