Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

version 0.1 #3

Merged
merged 1 commit into from
Sep 22, 2024
Merged
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
3 changes: 2 additions & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -15,4 +15,5 @@ COPY . .
EXPOSE 8000

# Run the FastAPI app with Uvicorn server
CMD ["uvicorn", "app.main:app", "--host", "0.0.0.0", "--port", "8000"]
CMD ["sh", "-c", "uvicorn app.main:app --host 0.0.0.0 --port $PORT"]

34 changes: 25 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
# SwiftComp-API
[![Version](https://img.shields.io/github/v/release/wenbinyugroup/swiftcomp-api)](https://github.com/wenbinyu/swiftcomp-api/releases)
[![Build Status](https://github.com/wenbinyugroup/swiftcomp-api/actions/workflows/ci.yml/badge.svg)](https://github.com/wenbinyugroup/swiftcomp-api/actions)
[![codecov](https://codecov.io/gh/wenbinyugroup/swiftcomp-api/branch/main/graph/badge.svg)](https://codecov.io/gh/wenbinyugroup/swiftcomp-api)
[![Last Commit](https://img.shields.io/github/last-commit/wenbinyugroup/swiftcomp-api)](https://github.com/wenbinyugroup/swiftcomp-api/commits/main)


Expand Down Expand Up @@ -39,6 +38,16 @@

---

## Public Use
The SwiftComp API is deployed online:
https://swiftcomp-api-7327e882adaf.herokuapp.com

You can access API documentation at:
* Swagger UI: https://swiftcomp-api-7327e882adaf.herokuapp.com/docs
* ReDoc: https://swiftcomp-api-7327e882adaf.herokuapp.com/redoc

---

## Installation Using Docker (recommend)

### Prerequisites
Expand Down Expand Up @@ -119,6 +128,20 @@ uvicorn app.main:app --reload

This will start the SwiftComp API server at http://127.0.0.1:8000.


5. **Testing**:

The repository includes unit tests using `pytest`. To run the tests:

* Ensure you are in the virtual environment.
* Run the following command:
```bash
PYTHONPATH=./ pytest
```


---

## API Documentation
FastAPI automatically generates interactive API documentation using **Swagger** and **Redoc**. Once the server is running, you can access the documentation at:

Expand All @@ -132,14 +155,7 @@ FastAPI automatically generates interactive API documentation using **Swagger**
* **POST /api/v1/laminate_3d_properties**: Computes the 3D properties of laminate.
* **POST /api/v1/udfrc_properties**: Calculates UDFRC properties.

## Testing
The repository includes unit tests using `pytest`. To run the tests:

1. Ensure you are in the virtual environment.
2. Run the following command:
```bash
PYTHONPATH=./ pytest
```
---

## Contributing
We welcome contributions to **SwiftComp-API**! Here's how you can help:
Expand Down
Loading