Skip to content

Commit

Permalink
feat: working docker compose sucessfull deployment on local
Browse files Browse the repository at this point in the history
  • Loading branch information
Nakul Bhandare authored and Nakul Bhandare committed Feb 19, 2025
2 parents 0978bc7 + 296fcaa commit e45cc73
Show file tree
Hide file tree
Showing 27 changed files with 211 additions and 168 deletions.
Binary file removed .DS_Store
Binary file not shown.
8 changes: 0 additions & 8 deletions .idea/.gitignore

This file was deleted.

9 changes: 0 additions & 9 deletions .idea/PlantWaterSystem.iml

This file was deleted.

10 changes: 0 additions & 10 deletions .idea/misc.xml

This file was deleted.

8 changes: 0 additions & 8 deletions .idea/modules.xml

This file was deleted.

6 changes: 0 additions & 6 deletions .idea/vcs.xml

This file was deleted.

2 changes: 1 addition & 1 deletion backend/controller/plant_controller.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ def verify_credentials(credentials: HTTPBasicCredentials = Depends(security)):


@create_plant.post("/api/plant/data", response_model=PlantSchema)
def create_plant_entry(plant: PlantSchema, service: PlantService = Depends(get_service), username: str = Depends(verify_credentials)):
def create_plant_entry(plant: PlantSchema, service: PlantService = Depends(get_service)):
try:
# Call the service layer to create the plant
response = service.create_plant(plant)
Expand Down
9 changes: 9 additions & 0 deletions backend/main.py
Original file line number Diff line number Diff line change
@@ -1,13 +1,22 @@
from fastapi import FastAPI
from controller.plant_controller import create_plant
from config.database import Base, engine
from fastapi.middleware.cors import CORSMiddleware

# Initialize database
Base.metadata.create_all(bind=engine)

# FastAPI App
app = FastAPI()

app.add_middleware(
CORSMiddleware,
allow_origins=["*"], # Allow all origins (you can restrict this in production)
allow_credentials=True, # Allow cookies or authorization headers
allow_methods=["*"], # Allow all HTTP methods (GET, POST, PUT, DELETE, etc.)
allow_headers=["*"], # Allow all headers
)

# Include Routes
app.include_router(create_plant)

Expand Down
162 changes: 56 additions & 106 deletions frontend/web-app/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit e45cc73

Please sign in to comment.