This is a simple FastAPI application for managing books using MongoDB.
Before running the application, make sure you have the following installed:
- Python 3.7 or higher
- MongoDB Atlas account (or a local MongoDB instance)
- Clone the repository:
git clone https://github.com/Shanu79/restapi-letsbloom.git
cd restapi-letsbloom-master
- Install dependencies:
pip install -r requirements.txt
-
Configure MongoDB:
- Create a MongoDB Atlas cluster or use a local MongoDB instance.
-
Configure the .env file:
- create a new .env file
- Update the
uri
variable in the.env
file with your MongoDB connection string. - Update the
JSON_DATA_PATH
with your actual dummy data file is located
-
Run the application:
uvicorn main:app --reload
The application should now be running at http://localhost:8000.
Visit http://localhost:8000/docs to access the Swagger UI for API documentation.
- GET /api/books: List all books.
- POST /api/books: Add new books.
- PUT /api/books/{id}: Update books
- /seed-database: Seed the Database with dummy data