Skip to content

Commit

Permalink
Merge branch 'main' into miho-merge-todo-apps
Browse files Browse the repository at this point in the history
  • Loading branch information
infomiho committed Jan 30, 2025
2 parents 9ff964f + 802b78b commit 4cbc123
Show file tree
Hide file tree
Showing 161 changed files with 24,719 additions and 551 deletions.
15 changes: 6 additions & 9 deletions mage/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,7 +1,4 @@
# NOTE: Why do we specify alpine version here?
# Because if not, we had situations where it would use the different version
# locally and on Github CI. This way we ensure exact version is used,
# and also have control over updating it (instead of update surprising us).
# For Mage we are using the Debian Node.js image
FROM node:18 AS node


Expand Down Expand Up @@ -41,22 +38,22 @@ RUN cd .wasp/build/server && npm run bundle
# TODO: Use pm2?
# TODO: Use non-root user (node).
FROM base AS server-production
RUN curl -sSL https://get.wasp-lang.dev/installer.sh | sh -s -- -v 0.15.0
RUN curl -sSL https://get.wasp-lang.dev/installer.sh | sh -s -- -v 0.16.0
ENV PATH "$PATH:/root/.local/bin"
ENV NODE_ENV production
WORKDIR /app
# Copying the top level 'node_modules' because it contains the Prisma packages
# necessary for migrating the database.
COPY --from=server-builder /app/node_modules ./node_modules
# Copying the SDK because 'validate-env.mjs' executes independent of the bundle
# Copying the SDK because the server bundle doesn't bundle the SDK
# and references the 'wasp' package.
COPY --from=server-builder /app/.wasp/out/sdk .wasp/out/sdk
# Copying 'server/node_modules' because 'validate-env.mjs' executes independent
# of the bundle and references the dotenv package.
# Copying 'server/node_modules' because we require dotenv package to
# load environment variables
# TODO: replace dotenv with native Node.js environment variable loading
COPY --from=server-builder /app/.wasp/build/server/node_modules .wasp/build/server/node_modules
COPY --from=server-builder /app/.wasp/build/server/bundle .wasp/build/server/bundle
COPY --from=server-builder /app/.wasp/build/server/package*.json .wasp/build/server/
COPY --from=server-builder /app/.wasp/build/server/scripts .wasp/build/server/scripts
COPY db/ .wasp/build/db/
EXPOSE ${PORT}
WORKDIR /app/.wasp/build/server
Expand Down
61 changes: 1 addition & 60 deletions mage/main.wasp
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
app waspAi {
wasp: {
version: "^0.13.0"
version: "^0.16.0"
},
title: "MAGE - GPT Web App Generator ✨",
head: [
Expand All @@ -17,9 +17,6 @@ app waspAi {
client: {
rootComponent: import { RootComponent } from "@src/client/RootComponent.jsx",
},
db: {
system: PostgreSQL,
},
auth: {
userEntity: User,
methods: {
Expand Down Expand Up @@ -131,62 +128,6 @@ query getNumProjects {
]
}

entity User {=psl
id Int @id @default(autoincrement())

email String?
username String?

projects Project[]
psl=}

entity Project {=psl
id String @id @default(uuid())
name String
description String
primaryColor String @default("sky")
authMethod String @default("usernameAndPassword")
creativityLevel String @default("balanced")
createdAt DateTime @default(now())
status String @default("pending")
referrer String @default("unknown")
zipDownloadedAt DateTime?
userId Int?
user User? @relation(fields: [userId], references: [id])
files File[]
logs Log[]
feedbacks Feedback[]
psl=}

entity Feedback {=psl
id String @id @default(uuid())
score Int
message String
createdAt DateTime @default(now())

projectId String
project Project @relation(fields: [projectId], references: [id])
psl=}

entity File {=psl
id String @id @default(uuid())
name String
content String
createdAt DateTime @default(now())
projectId String
project Project @relation(fields: [projectId], references: [id])

@@index([name, projectId])
psl=}

entity Log {=psl
id String @id @default(uuid())
content String
createdAt DateTime @default(now())
projectId String
project Project @relation(fields: [projectId], references: [id])
psl=}

job checkPendingAppsJob {
executor: PgBoss,
schedule: {
Expand Down
Loading

0 comments on commit 4cbc123

Please sign in to comment.