Skip to content

Commit

Permalink
tweaks
Browse files Browse the repository at this point in the history
sshh12 committed Nov 11, 2024
1 parent c50c20b commit 8bd25c4
Showing 3 changed files with 20 additions and 3 deletions.
19 changes: 18 additions & 1 deletion backend/main.py
Original file line number Diff line number Diff line change
@@ -1,10 +1,26 @@
from fastapi import FastAPI
from fastapi.middleware.cors import CORSMiddleware
from db.database import init_db
import asyncio
from contextlib import asynccontextmanager

from routers import auth, projects, websockets, stacks

app = FastAPI()

async def periodic_task():
while True:
print("Running periodic task...")
await asyncio.sleep(60)


@asynccontextmanager
async def lifespan(app: FastAPI):
task = asyncio.create_task(periodic_task())
yield
task.cancel()


app = FastAPI(lifespan=lifespan)

# Configure CORS
app.add_middleware(
@@ -24,6 +40,7 @@
app.include_router(projects.router)
app.include_router(websockets.router)
app.include_router(stacks.router)

if __name__ == "__main__":
init_db()
import uvicorn
2 changes: 1 addition & 1 deletion backend/sandbox/packs.py
Original file line number Diff line number Diff line change
@@ -43,7 +43,7 @@ class StackPack(BaseModel):
The user choose to use a Nextjs app with Shadcn UI so avoid adding any additional dependencies unless they are explicitly asked for.
Included:
- Nextjs (use for routing)
- Nextjs App Router (use for routing)
- `lucide-react` for icons
- The Nextjs app is already created in /app/frontend (do not run `create-next-app`)
2 changes: 1 addition & 1 deletion images/NextjsShadcnDockerFile
Original file line number Diff line number Diff line change
@@ -16,7 +16,7 @@ RUN apt-get update && \

RUN node --version && npm --version

RUN npx --yes create-next-app@latest frontend --js --tailwind --no-eslint && \
RUN npx --yes create-next-app@latest frontend --js --tailwind --no-eslint --src-dir src --app --no-turbopack --no-import-alias && \
cd frontend && \
npm install lucide-react --force \
npx shadcn@latest init -d \

0 comments on commit 8bd25c4

Please sign in to comment.