URL shortener service built with FastAPI, SQLite, and Python.
Author: Anish Kr Singh
- Python 3.8 or higher
- pip (Python package installer)
- Clone the repository
git clone https://github.com/anishfyle/fastapi-backend.git
cd fastapi-backend- Create a virtual environment
python -m venv fastapi_venv- Activate the virtual environment
On Windows (PowerShell):
.\fastapi_venv\Scripts\Activate.ps1On Windows (Command Prompt):
.\fastapi_venv\Scripts\activate.batOn macOS/Linux:
source fastapi_venv/bin/activate- Install required dependencies
pip install fastapi uvicorn pydantic- Run the application
uvicorn main:app --reload- Access the application
- API will be available at: http://127.0.0.1:8000
- Interactive API documentation: http://127.0.0.1:8000/docs
- Alternative API documentation: http://127.0.0.1:8000/redoc
The application uses SQLite database (urls.db) which will be automatically created when the application starts for the first time.