Skip to content

Commit

Permalink
Merge pull request #94 from airtai/dev
Browse files Browse the repository at this point in the history
Add PRs #62, #84, #86, #88, #90, #92, #85
  • Loading branch information
davorrunje committed Apr 26, 2024
2 parents 378f0b8 + d4edd8d commit dbdcc62
Show file tree
Hide file tree
Showing 91 changed files with 1,501 additions and 853 deletions.
3 changes: 3 additions & 0 deletions .devcontainer/devcontainer.env
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
PORT_PREFIX=${PORT_PREFIX}
CONTAINER_PREFIX=${USER}
DATABASE_URL="postgresql://admin:password@${USER}-postgres-py310-fastagency:5432/fastagency"
3 changes: 3 additions & 0 deletions .devcontainer/python-3.10/devcontainer.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,9 @@
"./docker-compose.yml"
],
"service": "python-3.10",
"forwardPorts": [
"${containerEnv:CONTAINER_PREFIX}-nats-py310-fastagency:9222"
],
"shutdownAction": "stopCompose",
"workspaceFolder": "/workspaces/fastagency",
// "runArgs": [],
Expand Down
19 changes: 11 additions & 8 deletions .devcontainer/python-3.10/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,32 +3,35 @@ version: '3'
services:
python-3.10: # nosemgrep
image: mcr.microsoft.com/devcontainers/python:3.10
container_name: $USER-python-3.10
container_name: $USER-python-3.10-fastagency
volumes:
- ../../:/workspaces/fastagency:cached
command: sleep infinity
env_file:
- ../devcontainer.env
platform: linux/amd64
networks:
- fastagency-network
nats-fastagency: # nosemgrep
image: nats:latest
container_name: $USER-nats-fastagency
ports:
- "${PORT_PREFIX}4222:4222"
- "${PORT_PREFIX}9222:9222"
container_name: $USER-nats-py310-fastagency
# ports:
# - "${PORT_PREFIX}4222:4222"
# - "${PORT_PREFIX}9222:9222"
volumes:
- ../../examples/nats/server.conf:/etc/nats/server.conf
command: [ "--config", "/etc/nats/server.conf" ]
networks:
- fastagency-network
postgres-fastagency: # nosemgrep
image: postgres:latest
container_name: $USER-postgres-fastagency
container_name: $USER-postgres-py310-fastagency
environment:
POSTGRES_USER: admin
POSTGRES_PASSWORD: password # pragma: allowlist secret
POSTGRES_DB: fastagency
ports:
- "${PORT_PREFIX}5432:5432"
# ports:
# - "${PORT_PREFIX}5432:5432"
networks:
- fastagency-network

Expand Down
3 changes: 3 additions & 0 deletions .devcontainer/python-3.11/devcontainer.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,9 @@
"./docker-compose.yml"
],
"service": "python-3.11",
"forwardPorts": [
"${containerEnv:CONTAINER_PREFIX}-nats-py310-fastagency:9222"
],
"shutdownAction": "stopCompose",
"workspaceFolder": "/workspaces/fastagency",
// "runArgs": [],
Expand Down
16 changes: 8 additions & 8 deletions .devcontainer/python-3.11/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,32 +3,32 @@ version: '3'
services:
python-3.11: # nosemgrep
image: mcr.microsoft.com/devcontainers/python:3.11
container_name: $USER-python-3.11
container_name: $USER-python-3.11-fastagency
volumes:
- ../../:/workspaces/fastagency:cached
command: sleep infinity
networks:
- fastagency-network
nats-fastagency: # nosemgrep
image: nats:latest
container_name: $USER-nats-fastagency
ports:
- "${PORT_PREFIX}4222:4222"
- "${PORT_PREFIX}9222:9222"
container_name: $USER-nats-py311-fastagency
# ports:
# - "${PORT_PREFIX}4222:4222"
# - "${PORT_PREFIX}9222:9222"
volumes:
- ../../examples/nats/server.conf:/etc/nats/server.conf
command: [ "--config", "/etc/nats/server.conf" ]
networks:
- fastagency-network
postgres-fastagency: # nosemgrep
image: postgres:latest
container_name: $USER-postgres-fastagency
container_name: $USER-postgres-py311-fastagency
environment:
POSTGRES_USER: admin
POSTGRES_PASSWORD: password # pragma: allowlist secret
POSTGRES_DB: fastagency
ports:
- "${PORT_PREFIX}5432:5432"
# ports:
# - "${PORT_PREFIX}5432:5432"
networks:
- fastagency-network

Expand Down
3 changes: 3 additions & 0 deletions .devcontainer/python-3.12/devcontainer.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,9 @@
"./docker-compose.yml"
],
"service": "python-3.12",
"forwardPorts": [
"${containerEnv:CONTAINER_PREFIX}-nats-py310-fastagency:9222"
],
"shutdownAction": "stopCompose",
"workspaceFolder": "/workspaces/fastagency",
// "runArgs": [],
Expand Down
16 changes: 8 additions & 8 deletions .devcontainer/python-3.12/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,32 +3,32 @@ version: '3'
services:
python-3.12: # nosemgrep
image: mcr.microsoft.com/devcontainers/python:3.12
container_name: $USER-python-3.12
container_name: $USER-python-3.12-fastagency
volumes:
- ../../:/workspaces/fastagency:cached
command: sleep infinity
networks:
- fastagency-network
nats-fastagency: # nosemgrep
image: nats:latest
container_name: $USER-nats-fastagency
ports:
- "${PORT_PREFIX}4222:4222"
- "${PORT_PREFIX}9222:9222"
container_name: $USER-nats-py312-fastagency
# ports:
# - "${PORT_PREFIX}4222:4222"
# - "${PORT_PREFIX}9222:9222"
volumes:
- ../../examples/nats/server.conf:/etc/nats/server.conf
command: [ "--config", "/etc/nats/server.conf" ]
networks:
- fastagency-network
postgres-fastagency: # nosemgrep
image: postgres:latest
container_name: $USER-postgres-fastagency
container_name: $USER-postgres-py312-fastagency
environment:
POSTGRES_USER: admin
POSTGRES_PASSWORD: password # pragma: allowlist secret
POSTGRES_DB: fastagency
ports:
- "${PORT_PREFIX}5432:5432"
# ports:
# - "${PORT_PREFIX}5432:5432"
networks:
- fastagency-network

Expand Down
3 changes: 3 additions & 0 deletions .devcontainer/python-3.9/devcontainer.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,9 @@
"./docker-compose.yml"
],
"service": "python-3.9",
"forwardPorts": [
"${containerEnv:CONTAINER_PREFIX}-nats-py310-fastagency:9222"
],
"shutdownAction": "stopCompose",
"workspaceFolder": "/workspaces/fastagency",
// "runArgs": [],
Expand Down
16 changes: 8 additions & 8 deletions .devcontainer/python-3.9/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,32 +3,32 @@ version: '3'
services:
python-3.9: # nosemgrep
image: mcr.microsoft.com/devcontainers/python:3.9
container_name: $USER-python-3.9
container_name: $USER-python-3.9-fastagency
volumes:
- ../../:/workspaces/fastagency:cached
command: sleep infinity
networks:
- fastagency-network
nats-fastagency: # nosemgrep
image: nats:latest
container_name: $USER-nats-fastagency
ports:
- "${PORT_PREFIX}4222:4222"
- "${PORT_PREFIX}9222:9222"
container_name: $USER-nats-py39-fastagency
# ports:
# - "${PORT_PREFIX}4222:4222"
# - "${PORT_PREFIX}9222:9222"
volumes:
- ../../examples/nats/server.conf:/etc/nats/server.conf
command: [ "--config", "/etc/nats/server.conf" ]
networks:
- fastagency-network
postgres-fastagency: # nosemgrep
image: postgres:latest
container_name: $USER-postgres-fastagency
container_name: $USER-postgres-py39-fastagency
environment:
POSTGRES_USER: admin
POSTGRES_PASSWORD: password # pragma: allowlist secret
POSTGRES_DB: fastagency
ports:
- "${PORT_PREFIX}5432:5432"
# ports:
# - "${PORT_PREFIX}5432:5432"
networks:
- fastagency-network

Expand Down
3 changes: 3 additions & 0 deletions .devcontainer/setup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,3 +6,6 @@ pip install -e ".[dev]"

# install pre-commit hook if not installed already
pre-commit install

# install wasp
curl -sSL https://get.wasp-lang.dev/installer.sh | sh
18 changes: 17 additions & 1 deletion .github/workflows/test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -185,7 +185,7 @@ jobs:

docker_build_push_node:
runs-on: ubuntu-22.04
needs: [unit_test_wasp]
# needs: [unit_test_wasp]
permissions:
contents: read
packages: write
Expand Down Expand Up @@ -258,12 +258,28 @@ jobs:
if: github.ref_name == 'main' || github.ref_name == 'dev'
run: docker push ghcr.io/$GITHUB_REPOSITORY --all-tags

pre-commit-check:
runs-on: ubuntu-latest
env:
SKIP: "static-analysis"
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
- name: Set $PY environment variable
run: echo "PY=$(python -VV | sha256sum | cut -d' ' -f1)" >> $GITHUB_ENV
- uses: actions/cache@v4
with:
path: ~/.cache/pre-commit
key: pre-commit|${{ env.PY }}|${{ hashFiles('.pre-commit-config.yaml') }}
- uses: pre-commit/action@v3.0.1

# https://github.com/marketplace/actions/alls-green#why
check: # This job does nothing and is only used for the branch protection
if: github.event.pull_request.draft == false

needs:
- static_analysis
- pre-commit-check
- coverage-combine
- test-macos-latest
- test-windows-latest
Expand Down
19 changes: 17 additions & 2 deletions .secrets.baseline
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,10 @@
{
"path": "detect_secrets.filters.allowlist.is_line_allowlisted"
},
{
"path": "detect_secrets.filters.common.is_baseline_file",
"filename": ".secrets.baseline"
},
{
"path": "detect_secrets.filters.common.is_ignored_due_to_verification_policies",
"min_level": 2
Expand Down Expand Up @@ -107,6 +111,17 @@
"path": "detect_secrets.filters.heuristic.is_templated_secret"
}
],
"results": {},
"generated_at": "2023-12-23T23:23:00Z"
"results": {
".devcontainer/devcontainer.env": [
{
"type": "Basic Auth Credentials",
"filename": ".devcontainer/devcontainer.env",
"hashed_secret": "5baa61e4c9b93f3f0682250b6cf8331b7ee68fd8",
"is_verified": false,
"line_number": 3,
"is_secret": false
}
]
},
"generated_at": "2024-04-25T08:32:26Z"
}
32 changes: 16 additions & 16 deletions app/main.wasp
Original file line number Diff line number Diff line change
Expand Up @@ -6,18 +6,18 @@ app OpenSaaS {
head: [
"<meta property='og:type' content='website' />",
"<meta property='og:title' content='FastAgency' />",
"<meta property='og:url' content='https://fastagency.ai/' />",
"<meta property='og:url' content='https://fastagency.ai/' />",
"<meta property='og:description' content='Quickly build scalable SaaS solutions using our powerful, multi-agent AI framework that streamlines complex processes.' />",
"<meta property='og:image' content='https://fastagency.ai/public-banner.png' />",
"<meta name='twitter:image' content='https://fastagency.ai/public-banner.png' />",
"<meta name='twitter:image' content='https://fastagency.ai/public-banner.png' />",
"<meta name='twitter:image:width' content='800' />",
"<meta name='twitter:image:height' content='400' />",
"<meta name='twitter:card' content='summary_large_image' />",
// you can put your analytics scripts here
// "<script defer data-domain='<your-site-id>' src='https://plausible.io/js/script.js'></script>",
// plausible has script extension `script.local.js` for local development
// "<script defer data-domain='<your-site-id>' src='https://plausible.io/js/script.local.js'></script>",
// google analytics only needs one script and will automatically detect if you are in dev mode
// google analytics only needs one script and will automatically detect if you are in dev mode
//"<!-- Google tag (gtag.js) --><script>...</script>"
"<script type='text/javascript'> (function(l) { if (l.search[1] === '/' ) { var decoded = l.search.slice(1).split('&').map(function(s) { return s.replace(/~and~/g, '&') }).join('?'); window.history.replaceState(null, null, l.pathname.slice(0, -1) + decoded + l.hash ); } }(window.location)) </script>",
],
Expand All @@ -33,7 +33,7 @@ app OpenSaaS {
onAuthFailedRedirectTo: "/login",
onAuthSucceededRedirectTo: "/chat",
},
db: {
db: {
system: PostgreSQL,
seeds: [
import { devSeedUsers } from "@src/server/scripts/usersSeed.js",
Expand All @@ -42,21 +42,21 @@ app OpenSaaS {
client: {
rootComponent: import App from "@src/client/App",
},

emailSender: {
// Note that the "Dummy" provider is just for local development purposes.
// Note that the "Dummy" provider is just for local development purposes.
// Make sure to check the server logs for the confirmation email token (it will not be sent to an address)!
// Please use SendGrid in production. See: https://docs.opensaas.sh/guides/email-sending/
provider: SendGrid,
provider: SendGrid,
defaultFrom: {
name: "Open SaaS App",
// When using SendGrid, you must use the same email address that you configured your account to send out emails with!
email: "me@example.com"
email: "me@example.com"
},
},
}

/* 💽 Wasp defines DB entities via Prisma Database Models:
/* 💽 Wasp defines DB entities via Prisma Database Models:
* https://wasp-lang.dev/docs/data-model/entities
*/

Expand All @@ -70,17 +70,17 @@ entity User {=psl
hasAcceptedTos Boolean @default(false)
hasSubscribedToMarketingEmails Boolean @default(false)
isSignUpComplete Boolean @default(false)
stripeId String?
stripeId String?
checkoutSessionId String?
hasPaid Boolean @default(false)
subscriptionTier String?
subscriptionStatus String?
sendEmail Boolean @default(false)
datePaid DateTime?
credits Int @default(3)
credits Int @default(3)
psl=}

entity DailyStats {=psl
entity DailyStats {=psl
id Int @id @default(autoincrement())
date DateTime @default(now()) @unique
totalViews Int @default(0)
Expand All @@ -95,9 +95,9 @@ entity DailyStats {=psl
psl=}

entity PageViewSource {=psl
date DateTime @default(now())
name String
visitors Int
date DateTime @default(now())
name String
visitors Int
dailyStats DailyStats? @relation(fields: [dailyStatsId], references: [id])
dailyStatsId Int?
@@id([date, name])
Expand Down Expand Up @@ -257,7 +257,7 @@ query getPaginatedUsers {
/*
* 📡 These are custom Wasp API Endpoints. Use them for callbacks, webhooks, etc.
* https://wasp-lang.dev/docs/advanced/apis
*/
*/

api stripeWebhook {
fn: import { stripeWebhook } from "@src/server/webhooks/stripe.js",
Expand Down
2 changes: 1 addition & 1 deletion app/migrations/migration_lock.toml
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
# Please do not edit this file manually
# It should be added in your version-control system (i.e. Git)
provider = "postgresql"
provider = "postgresql"
Loading

0 comments on commit dbdcc62

Please sign in to comment.