Skip to content

Commit

Permalink
version 0.1 (#3)
Browse files Browse the repository at this point in the history
  • Loading branch information
banghuazhao authored Sep 22, 2024
1 parent e0125b6 commit ea7ab2f
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 10 deletions.
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

0 comments on commit ea7ab2f

Please sign in to comment.