|
| 1 | +# FastAPI Project with `create-fastapi-project` |
| 2 | + |
| 3 | +This is a FastAPI project initialized using [`create-fastapi-project`](https://github.com/allient/create-fastapi-project), designed to provide a quick start for building APIs with [FastAPI](https://fastapi.tiangolo.com/). |
| 4 | + |
| 5 | +## Required API Keys |
| 6 | + |
| 7 | +### OpenAI |
| 8 | + |
| 9 | +1. Create an account on [OpenAI](https://platform.openai.com/). |
| 10 | +2. Get your API key from [API Keys - OpenAI](https://platform.openai.com/account/api-keys). |
| 11 | +3. Set your API key as an environment variable named `OPENAI_API_KEY`. |
| 12 | + |
| 13 | +## Other API Keys (Optional if you want to use the template's custom tools) |
| 14 | + |
| 15 | +### Unsplash (Image Search) |
| 16 | + |
| 17 | +1. Create an account on [Unsplash](https://unsplash.com/developers). |
| 18 | +2. Create an app on [Unsplash Developers](https://unsplash.com/oauth/applications). |
| 19 | +3. Get your Access Key from [Your Applications - Unsplash Developers](https://unsplash.com/oauth/applications). |
| 20 | +4. Set your Access Key as an environment variable named `UNSPLASH_API_KEY`. |
| 21 | + |
| 22 | +### SerpApi (Search Engine Results Page API) |
| 23 | + |
| 24 | +1. Create an account on [SerpApi](https://serpapi.com/). |
| 25 | +2. Get your API key from [API Key - SerpApi](https://serpapi.com/manage-api-key). |
| 26 | +3. Set your API key as an environment variable named `SERP_API_KEY`. |
| 27 | + |
| 28 | +## Getting Started |
| 29 | + |
| 30 | +The commands in this documentation can be customized on the **Makefile**. It can be started with and without docker. |
| 31 | + |
| 32 | +- Run the server (Recommended using docker): |
| 33 | + |
| 34 | +```bash |
| 35 | +# Run locally with docker in dev mode and force build |
| 36 | +make run-dev-build |
| 37 | +# or |
| 38 | +# Run locally with docker in dev mode |
| 39 | +make run-dev |
| 40 | +# or |
| 41 | +# Run locally with docker in prod mode (Autoreload disabled) |
| 42 | +make run-prod |
| 43 | +``` |
| 44 | + |
| 45 | +- Run the server without docker: |
| 46 | + |
| 47 | +First, make sure you have all packages installed: |
| 48 | + |
| 49 | +```bash |
| 50 | +make install |
| 51 | +``` |
| 52 | + |
| 53 | +```bash |
| 54 | +make run-app |
| 55 | +``` |
| 56 | + |
| 57 | +Open [http://localhost:8000/docs](http://localhost:8000/docs) with your browser to see the result. |
| 58 | + |
| 59 | +You can start editing the server by modifying `app/main.py`. |
| 60 | + |
| 61 | +## Demo Langchain Tools |
| 62 | + |
| 63 | +This template includes some tools to help you get started with your project: |
| 64 | + |
| 65 | +- Search pokemon by name or id |
| 66 | +- Search weather by city name |
| 67 | +- Search images by keyword |
| 68 | +- Search videos by keyword |
| 69 | + |
| 70 | +And also includes a agent that uses the tools to answer your questions. |
| 71 | +You can access the agent by opening [http://localhost:8000/chat](http://localhost:8000/chat) with your browser. |
| 72 | + |
| 73 | +## Learn More |
| 74 | + |
| 75 | +To learn more about Fastapi, take a look at the following resources: |
| 76 | + |
| 77 | +- [Fastapi Documentation](https://fastapi.tiangolo.com/). |
| 78 | +- [fastapi-alembic-sqlmodel-async](https://github.com/jonra1993/fastapi-alembic-sqlmodel-async). |
| 79 | +- [full-stack-fastapi-postgresql](https://github.com/tiangolo/full-stack-fastapi-postgresql). |
| 80 | +- [sqlmodel-tutorial](https://sqlmodel.tiangolo.com/tutorial/fastapi/). |
| 81 | +- [asyncer-tutorial](https://asyncer.tiangolo.com/tutorial/). |
| 82 | +- [fastapi-pagination](https://github.com/uriyyo/fastapi-pagination). |
| 83 | +- [fastapi-best-practices](https://github.com/zhanymkanov/fastapi-best-practices). |
| 84 | +- [awesome-fastapi](https://github.com/mjhea0/awesome-fastapi). |
| 85 | + |
| 86 | +## Why use Create FastAPI Project? |
| 87 | + |
| 88 | +`create-fastapi-project` provides a streamlined way to kickstart your FastAPI projects. Here are some compelling reasons to choose it for your project setup: |
| 89 | + |
| 90 | +### Interactive Experience |
| 91 | + |
| 92 | +Running `pip install create-fastapi-project@latest` (with no arguments) launches an interactive experience that guides you through the process of setting up your project. This interactive approach simplifies the initial configuration and gets you started quickly. |
| 93 | + |
| 94 | +### Zero Dependencies |
| 95 | + |
| 96 | +`create-fastapi-project` has been designed to be lightweight and efficient. It requires zero external dependencies, ensuring that your project remains unburdened by unnecessary packages. |
| 97 | + |
| 98 | +### Reliability and Maintenance |
| 99 | + |
| 100 | +`create-fastapi-project` is officially maintained by the [Allient development team](https://www.allient.io/). It is well-tested and aligns with best practices, ensuring that it functions as expected and remains up to date with FastAPI's releases. |
| 101 | + |
| 102 | +By choosing `create-fastapi-project`, you streamline your initial project setup, leverage reliable patterns, and enjoy the convenience of a tool tailored for FastAPI development. |
| 103 | + |
| 104 | +We love ❤️ [FastAPI](https://fastapi.tiangolo.com/) and its ecosystem. You can check out the [create-fastapi-project GitHub repository](https://github.com/allient/create-fastapi-project) - your feedback and contributions are welcome! |
0 commit comments