Skip to content

Commit

Permalink
Merge pull request #14 from akai-org/backend
Browse files Browse the repository at this point in the history
add requirements.txt
  • Loading branch information
Laskos-p authored Oct 1, 2023
2 parents 3341c48 + 44d4001 commit 7429c7b
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 7 deletions.
13 changes: 6 additions & 7 deletions api/src/main.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
from fastapi import FastAPI
from sqlalchemy.orm import Session
from fastapi.middleware.cors import CORSMiddleware
from .add_data import populate_all
from .database import create_all
from .database import create_all, engine
from .routers import projects, users, courses, hackathons
from .crud import get_users

app = FastAPI()

Expand All @@ -27,14 +29,11 @@
@app.on_event("startup")
def startup_event():
create_all()
with Session(engine) as session:
if not get_users(session):
populate_all()


@app.get("/")
def main():
return {"message": "Hello World!"}


@app.get("/populate")
def populate():
populate_all()
return {"message": "Populated!"}
21 changes: 21 additions & 0 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
annotated-types==0.5.0
anyio==3.7.1
click==8.1.7
exceptiongroup==1.1.3
fastapi==0.103.2
greenlet==2.0.2
h11==0.14.0
httptools==0.6.0
idna==3.4
pydantic==2.4.2
pydantic_core==2.10.1
python-dotenv==1.0.0
PyYAML==6.0.1
sniffio==1.3.0
SQLAlchemy==2.0.21
starlette==0.27.0
typing_extensions==4.8.0
uvicorn==0.23.2
uvloop==0.17.0
watchfiles==0.20.0
websockets==11.0.3

0 comments on commit 7429c7b

Please sign in to comment.