This repository is a FastAPI application that includes user authentication, MongoDB integration, and more.
- Python 3.8 or newer
- pip
- MongoDB account (Atlas or local installation)
git clone https://github.com/Explore-Hub-Capstone-Project/ExploreHub-Backend
cd ExploreHub-Backendyou can use poetry or pip here are the poetry instructions:
- install poetry here: https://python-poetry.org/docs/#installing-with-pipx
- run
poetry install poetry run pre-commit install- For formatting and linting run
poetry run pre-commitbefore committing - Recommended: install ide extensions – Mypy, black, flake8
- for starting server run 'poetry run start'
here are the pip instructions:
pip install -r requirements.txtIt's recommended to use a virtual environment for Python projects to manage dependencies separately for each project.
If you use poetry, it will create the virtual environment for you.
if you don't use poetry, here are the manual steps:
python3 -m venv venv
source venv/bin/activatepython -m venv venv
.\venv\Scripts\activateCreate a .env file in the root directory of the project and fill it with your MongoDB URI
if you use poetry, you would write :
poetry run startif you don't use poetry, you would write:
uvicorn main:app --reloadThis will start the FastAPI application on http://127.0.0.1:5000. You can access the API documentation at http://127.0.0.1:5000/docs.