Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 1 addition & 3 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,8 @@
.env
.env.*

lib/

bin/

**/__pycache__/

.unlimiter/
**/unlimiter.config*
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ WORKDIR /usr/src/core-services-api

RUN mkdir -p /root/.unlimiter

COPY ./.unlimiter/config.yaml /root/.unlimiter/config.yaml
COPY /config/unlimiter.config.yaml /root/.unlimiter/config.yaml

COPY --from=requirements-stage /tmp/requirements.txt /usr/src/core-services-api/requirements.txt

Expand Down
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -47,3 +47,4 @@ in the project root and _[follow the directions for authentication and configura
|---|---|
| `bash index.sh` | This command builds and starts the Core Services API inside a Docker container.|


File renamed without changes.
12 changes: 12 additions & 0 deletions api/controller/loupe_controller.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
from api.lib.services import benchling_service

class LoupeController:
def __init__(self):
pass


@classmethod
def get_all_projects(self):
result = benchling_service.get_all_projects()
return result

Empty file added api/lib/__init__.py
Empty file.
Empty file added api/lib/services/__init__.py
Empty file.
9 changes: 3 additions & 6 deletions app/main.py → api/lib/services/benchling_service.py
Original file line number Diff line number Diff line change
@@ -1,11 +1,8 @@
from fastapi import FastAPI

from unlimiter.data.api import BenchlingV2APIConnection

app = FastAPI()
import pprint

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

not using this


@app.get('/')
async def root():
def get_all_projects():
with BenchlingV2APIConnection() as benchling:
projects = benchling.projects.list_projects()
return projects
return projects
16 changes: 16 additions & 0 deletions api/main.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
from functools import lru_cache
from fastapi import FastAPI
from .routes.loupe import loupe_v1
from starlette.middleware.cors import CORSMiddleware

app = FastAPI()

app.add_middleware(
CORSMiddleware,
allow_origins= ['http://localhost:3000'],
allow_credentials=True,
allow_methods=["GET"],
allow_headers=["*"],
)

app.include_router(loupe_v1.router)
12 changes: 12 additions & 0 deletions api/routes/loupe/loupe_v1.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@

from fastapi import APIRouter
from starlette import responses
from api.controller.loupe_controller import LoupeController


router = APIRouter()

@router.get('/v1/loupe/projects')
async def get_all_projects():
responses = LoupeController.get_all_projects()
return responses
Empty file added api/routes/wfvt.py
Empty file.
7 changes: 7 additions & 0 deletions config/api_settings.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
from pydantic import BaseSettings

class Settings(BaseSettings):
app_name: str = "Core Services API"

class Config:
env_file = '.env.dev'
21 changes: 21 additions & 0 deletions config/unlimiter.config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
asana_v1:
dev:
url: https://app.asana.com/api/1.0
auth:
method: bearer
token: <token>
benchling_v2:
dev:
url: https://abscitest.benchling.com/api/v2
auth:
method: basic
username: sk_mAqh8a9o8ipbAIWTCyIQumeIX7LQQ

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

bfg this repo. again.

password: ''
benchling_warehouse:
dev:
scheme: postgresql
url: postgres-warehouse.abscidev.benchling.com:5432/warehouse
auth:
method: basic
username: <username>
password: <password>
2 changes: 1 addition & 1 deletion docker-compose.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ services:
BENCHLING_API_KEY: ${BENCHLING_API_KEY}
GITHUB_TOKEN: ${GITHUB_TOKEN}
container_name: core_api
command: uvicorn app.main:app --reload --workers 1 --host 0.0.0.0 --port 5000
command: uvicorn api.main:app --reload --workers 1 --host 0.0.0.0 --port 5000
ports:
- 5002:5000
environment:
Expand Down