This is a FastAPI project using Python 3.11, PostgreSQL, and Git.
To get started, clone the repository from GitHub:
git clone https://github.com/AnwarHossainSR/python-fast-api.git
Change directory to the project directory:
cd <your-project-name>
Install the required dependencies:
pip install -r requirements.txt
Create a new PostgreSQL database for the project:
createdb <your-database-name>
Update environment variable in the .env
file :
DATABASE_HOSTNAME=
DATABASE_PORT=
DATABASE_PASSWORD=
DATABASE_NAME=
DATABASE_USERNAME=
SECRET_KEY=
ALGORITHM=
ACCESS_TOKEN_EXPIRE_MINUTES=
To migrate the database, run the following command:
alembic upgrade head
Start the development server:
uvicorn app.main:app --reload
This will create any new tables or columns that are required by the database schema, and update any existing tables or columns.
To use the API, open a web browser and navigate to http://localhost:8000/docs
. You will see a list of all of the available endpoints.
To make a request to an endpoint, click on the "Try it out" button and enter the required parameters. Then, click on the "Execute" button.
The response from the API will be displayed in the "Response body" section.
If you would like to contribute to this project, please open a pull request.
This project is licensed under the MIT License.