Skip to content

Commit

Permalink
Merge pull request #41 from berrysauce/update-ui
Browse files Browse the repository at this point in the history
Update UI
  • Loading branch information
Paul Haedrich authored May 13, 2024
2 parents ce7cc83 + 5613a2d commit 66a2629
Show file tree
Hide file tree
Showing 42 changed files with 2,919 additions and 170 deletions.
2 changes: 1 addition & 1 deletion FAIR_USE_POLICY.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ The term "Commercial Use" is generally defined as any use of the service that is
- Using the service to create a derivative work that you sell

### 1. Purpose of Fair Use Policy
The Fair Use Policy (the "Policy") for Ingredients (ingredients.tech) (the "Website" or the "Service") outlines the terms and conditions under which users can access and utilize the website scanning service and API provided by Foerstal (the "Operator"). This Policy is designed to ensure fair and responsible use of the service while protecting the integrity of the Website and its resources.
The Fair Use Policy (the "Policy") for Ingredients (ingredients.work) (the "Website" or the "Service") outlines the terms and conditions under which users can access and utilize the website scanning service and API provided by Foerstal (the "Operator"). This Policy is designed to ensure fair and responsible use of the service while protecting the integrity of the Website and its resources.

### 2. Prohibited Commercial Use
The use of the Ingredients API and website scanning service for commercial purposes is strictly prohibited under this Policy. Users are not allowed to utilize the service to extract, compile, or otherwise gather information with the intent of creating products, services, or applications for commercial gain.
Expand Down
2 changes: 1 addition & 1 deletion SECURITY.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ Although Ingredients doesn't save any personal user data, I take security vulner

1. **Confirm the vulnerability:** Before reporting a potential security vulnerability, please make sure it is a genuine issue. I encourage you to test thoroughly and ensure that the behavior you're observing is indeed a security vulnerability.

2. **Privately notify me:** Please report security vulnerabilities by emailing me at security@ingredients.tech. Please refrain from disclosing the vulnerability publicly until I had an opportunity to address it.
2. **Privately notify me:** Please report security vulnerabilities by emailing me at security@ingredients.work. Please refrain from disclosing the vulnerability publicly until I had an opportunity to address it.

3. **Provide necessary details:** When reporting the vulnerability, please include detailed information such as:
- A brief description of the vulnerability.
Expand Down
4 changes: 2 additions & 2 deletions Spacefile
Original file line number Diff line number Diff line change
Expand Up @@ -14,5 +14,5 @@ micros:
primary: false
public: true
path: /api
dev: python3.9 main.py

run: uvicorn main:app
dev: .venv/bin/uvicorn main:app --reload
3 changes: 2 additions & 1 deletion main.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import os
import json
import httpx
import uvicorn
Expand All @@ -12,7 +13,7 @@
import ingredients


deta = Deta()
deta = Deta(project_key=os.environ.get("DETA_DATA_KEY"))

db = deta.Base("ingredients-stats")
cache_db = deta.Base("ingredients-cache")
Expand Down
4 changes: 2 additions & 2 deletions pages/api.html
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ <h1 class="display-4 text-center" style="font-family: 'Inter Tight', sans-serif;
</svg>
Star on GitHub
</a>
<a class="btn btn-primary" role="button" style="padding: 3px 20px;background: rgba(255,255,255,0);color: rgb(33,37,41);border-style: solid;border-color: rgb(225,225,225);" href="https://ingredients.tech/api/docs">
<a class="btn btn-primary" role="button" style="padding: 3px 20px;background: rgba(255,255,255,0);color: rgb(33,37,41);border-style: solid;border-color: rgb(225,225,225);" href="https://ingredients.work/api/docs">
API Documentation
<svg class="icon icon-tabler icon-tabler-arrow-right" xmlns="http://www.w3.org/2000/svg" width="1em" height="1em" viewBox="0 0 24 24" stroke-width="2" stroke="currentColor" fill="none" stroke-linecap="round" stroke-linejoin="round" style="margin-left: 6px;margin-bottom: 3px;">
<path stroke="none" d="M0 0h24v24H0z" fill="none"></path>
Expand All @@ -37,7 +37,7 @@ <h1 class="display-4 text-center" style="font-family: 'Inter Tight', sans-serif;
By using this service, you agree to the Privacy Policy and Terms of Service of berrysauce.me&nbsp;and any listed third-party providers. This API is available under a <a href="https://github.com/berrysauce/ingredients/blob/main/FAIR_USE_POLICY.md" style="color: inherit;">Fair-use-Policy</a>. Contents on this API (e.g. logos)
may be subject to Copyright by their respective owners. <a href="https://github.com/berrysauce/ingredients/blob/main/LICENSE.md" style="color: inherit;">View the license for this API here</a>.<br />
<br />
<!--sse-->If you would like to get content removed from this API, please <a href="mailto:webmaster@ingredients.tech" style="color: inherit;">contact the administrator</a>.<!--/sse-->
<!--sse-->If you would like to get content removed from this API, please <a href="mailto:webmaster@ingredients.work" style="color: inherit;">contact the administrator</a>.<!--/sse-->
</p>
</div>
</div>
Expand Down
23 changes: 18 additions & 5 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,18 @@
httpx
beautifulsoup4
fastapi
uvicorn
deta
annotated-types==0.6.0
anyio==3.7.1
beautifulsoup4==4.12.2
certifi==2023.7.22
click==8.1.7
deta==1.2.0
fastapi==0.104.1
h11==0.14.0
httpcore==1.0.1
httpx==0.25.1
idna==3.4
pydantic==2.4.2
pydantic_core==2.10.1
sniffio==1.3.0
soupsieve==2.5
starlette==0.27.0
typing_extensions==4.8.0
uvicorn==0.24.0.post1
38 changes: 38 additions & 0 deletions ui/old/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
# create-svelte

Everything you need to build a Svelte project, powered by [`create-svelte`](https://github.com/sveltejs/kit/tree/master/packages/create-svelte).

## Creating a project

If you're seeing this, you've probably already done this step. Congrats!

```bash
# create a new project in the current directory
npm create svelte@latest

# create a new project in my-app
npm create svelte@latest my-app
```

## Developing

Once you've created a project and installed dependencies with `npm install` (or `pnpm install` or `yarn`), start a development server:

```bash
npm run dev

# or start the server and open the app in a new browser tab
npm run dev -- --open
```

## Building

To create a production version of your app:

```bash
npm run build
```

You can preview the production build with `npm run preview`.

> To deploy your app, you may need to install an [adapter](https://kit.svelte.dev/docs/adapters) for your target environment.
File renamed without changes.
File renamed without changes.
4 changes: 2 additions & 2 deletions ui/src/hooks.server.ts → ui/old/hooks.server.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import type { Handle } from "@sveltejs/kit";
export const handle: Handle = async ({ resolve, event }) => {

// Apply CORS header for API routes
if (String(event.url.hostname).endsWith("ingredients.tech")) {
if (String(event.url.hostname).endsWith("ingredients.work")) {
// Required for CORS to work
if(event.request.method === "OPTIONS") {
return new Response(null, {
Expand All @@ -17,7 +17,7 @@ export const handle: Handle = async ({ resolve, event }) => {
}

const response = await resolve(event);
if (String(event.url.hostname).endsWith("ingredients.tech")) {
if (String(event.url.hostname).endsWith("ingredients.work")) {
response.headers.append("Access-Control-Allow-Origin", `*`);
}
return response;
Expand Down
Loading

0 comments on commit 66a2629

Please sign in to comment.