https://github.com/anuja-rahul/python-fastapi
Simple API made using python for a social media platform.
https://github.com/anuja-rahul/python-fastapi
api fastapi python sql
Last synced: 27 days ago
JSON representation
Simple API made using python for a social media platform.
- Host: GitHub
- URL: https://github.com/anuja-rahul/python-fastapi
- Owner: anuja-rahul
- License: apache-2.0
- Created: 2024-06-20T15:22:10.000Z (about 1 year ago)
- Default Branch: main
- Last Pushed: 2024-08-14T18:08:43.000Z (11 months ago)
- Last Synced: 2025-01-01T19:28:36.249Z (6 months ago)
- Topics: api, fastapi, python, sql
- Language: Python
- Homepage:
- Size: 154 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README






# Python-fastAPI





[](https://github.com/anuja-rahul/portfolio-nextjs)
## Prerequisites
- [python ≥ 3.10](https://www.python.org/downloads/)
- [postgreSQL ≥ 16.0](https://www.postgresql.org/download/)## Getting Started
1. Clone this repository
```bash
git clone https://github.com/anuja-rahul/python-fastAPI.git
```2. Create a Virtual environment
```bash
python -m venv venv
```3. Activate the venv
```bash
activate venv
```4. Install the packages
```bash
pip install -r requirements.txt
```5. Setting up the env variables: _`required: .env`_
ex: _for dev env_
```bash
SECRET_KEY="Your Secret Key"
ALGORITHM="HS256"
ACCESS_TOKEN_EXPIRE_MINUTES="60"
HOST="localhost"
DBNAME="Your DB name"
PORT="8000"
USER="Your Username"
PASSWORD="Your password"
```- Note: If you have openssl, to generate a `SECRET_KEY` you can run :
```bash
openssl rand -hex 32
```6. Start the uvicorn server
```bash
uvicorn app.main:app --reload
```## Documentation
- After starting the uvicorn server visit
for _`Swagger UI`_:
```bash
http://localhost:8000/docs
```or for _`Redoc`_:
```bash
http://localhost:8000/redoc
```
