Photo Search is a web application with "Cyber Punk Theme" that allows users to search for photos using the Unsplash API.
- Search for photos using keywords
- Paginated results
- Expandable photo previews
- Dark and light mode toggle
- Python 3.7+
- FastAPI
- Uvicorn
- Httpx
- Python-dotenv
-
Clone the repository:
git clone https://github.com/yourusername/photo-app.git cd photo-app
-
Create a virtual environment and activate it:
python -m venv venv source venv/bin/activate # On Windows, use `venv\Scripts\activate`
-
Install the required packages:
pip install -r requirements.txt
-
Create a
.env
file in the root directory and add your Unsplash API key:UNSPLASH_API_KEY=your_unsplash_api_key_here
-
Start the FastAPI server:
uvicorn app.main:app --reload
-
Open a web browser and navigate to
http://localhost:8000
-
Enter keywords in the search box to find cyberpunk-themed photos
-
Use the pagination controls to navigate through the results
-
Click on a photo to view an expanded preview
-
Toggle between dark and light modes using the "Toggle Theme" button
To run the tests, use the following command:
pytest --cov=app tests/
This will run all the tests and provide a coverage report.
Contributions are welcome! Please feel free to submit a Pull Request.
This project is licensed under the MIT License.