Skip to content

Commit

Permalink
Initial Setup for fast api
Browse files Browse the repository at this point in the history
  • Loading branch information
ufukygmr committed Dec 3, 2024
1 parent 6e58fd2 commit a2ce57a
Show file tree
Hide file tree
Showing 8 changed files with 402 additions and 1 deletion.
18 changes: 17 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -82,4 +82,20 @@ Desktop.ini
######################
# Logs
######################
*.log*
*.log*

######################
# Poetry
######################
**/.env
**/.venv

######################
# Conda
######################
**/.conda

######################
# Python
######################
**/__pycache__
1 change: 1 addition & 0 deletions AtlasMl/.env.example
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
ENV=dev
56 changes: 56 additions & 0 deletions AtlasMl/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
# **AtlasML**

A lightweight FastAPI application template that supports **Conda** for environment management and **Poetry** for dependency management. This app provides a basic health check endpoint and is ready for development and testing.

---

## **Features**
- FastAPI framework for building APIs.
- Poetry for modern Python dependency management.
- Conda environment for isolating Python runtime and libraries.
- Pre-configured endpoints:
- `/` - Home route.
- `/health` - Health check.

---

## **Setup Instructions**

### 1. **Clone the Repository**
```bash
git clone <repository_url>
cd AtlasML
```

### 2. Setup Environment
1. Ensure you have [Conda](https://docs.anaconda.com/miniconda/install/#quick-command-line-install) and [Poetry](https://python-poetry.org/docs/#installation) installed on your system.

2. Install the dependencies:
```bash
poetry install
```

3. Activate the Virtual Environment:
```bash
poetry shell
```

4. Run the Application:
``` bash
poetry run uvicorn atlasml.app:app --reload
```

OR

3. Run the Application with Poetry:
```bash
poetry run uvicorn atlasml.app:app --reload
```

## Development


## Environment Variables
Please create a `.env` file in the root directory and add the the environment variables according to the `.env.example` file. If you add new environment variables, please update the `.env.example` file.

## License
Empty file added AtlasMl/atlasml/__init__.py
Empty file.
14 changes: 14 additions & 0 deletions AtlasMl/atlasml/app.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
from fastapi import FastAPI
import os

ENV = os.getenv("ENV", "dev")

app = FastAPI()

@app.get("/")
def index():
return {"message": f"HELLO {ENV}"}

@app.get("/health")
def health():
return {"status": "ok"}
296 changes: 296 additions & 0 deletions AtlasMl/poetry.lock

Large diffs are not rendered by default.

18 changes: 18 additions & 0 deletions AtlasMl/pyproject.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
[tool.poetry]
name = "atlasml"
version = "0.1.0"
description = ""
authors = ["ufukygmr <[email protected]>"]
readme = "README.md"

[tool.poetry.dependencies]
python = "^3.13"
fastapi = "^0.115.5"


[tool.poetry.group.dev.dependencies]
uvicorn = "^0.32.1"

[build-system]
requires = ["poetry-core"]
build-backend = "poetry.core.masonry.api"
Empty file added AtlasMl/tests/__init__.py
Empty file.

0 comments on commit a2ce57a

Please sign in to comment.