A FastAPI CRUD app where users can create an account and manage their favorite books.
https://github.com/Prakashsaw/FastAPI-CRUD-App
https://fastapi-crud-app.netlify.app
Books Store is a full-stack CRUD application built with FastAPI, React.js, and MongoDB. Users can register, log in, and manage their favorite books securely. The app features JWT-based authentication, email verification, session management, and password recovery.
- JavaScript, React.js, Bootstrap, CSS
- Python, FastAPI, FastAPI-Mail
- MongoDB
git clone https://github.com/Prakashsaw/FastAPI-CRUD-App.git
cd FastAPI-CRUD-App
cd frontend
npm install
1️⃣ Create a virtual environment:
python -m venv your_virtual_env_name
2️⃣ Activate the virtual environment:
# Windows
your_virtual_env_name\Scripts\activate
# macOS/Linux
source your_virtual_env_name/bin/activate
3️⃣ Install dependencies:
pip install -r requirements.txt
Create a .env
file in the backend
directory and add the following environment variables:
MONGO_URI =
DB_NAME =
JWT_SECRET_KEY =
JWT_ALGORITHM =
JWT_ACCESS_SECRET_KEY =
JWT_ACCESS_EXPIRY_MINUTES =
JWT_REFRESH_SECRET_KEY =
JWT_REFRESH_EXPIRY_DAYS =
USER_SESSION_EXPIRY_MINUTES =
MAIL_USERNAME =
MAIL_PASSWORD =
MAIL_FROM =
MAIL_FROM_NAME =
MAIL_PORT =
MAIL_SERVER =
MAIL_STARTTLS =
MAIL_SSL_TLS =
USE_CREDENTIALS =
VALIDATE_CERTS =
FRONTEND_HOST = http://localhost:3000 or https://your-deployed-domain.com
APP_NAME =
- If the virtual environment is not activated, activate it first:
# Windows
your_virtual_env_name\Scripts\activate
# macOS/Linux
source your_virtual_env_name/bin/activate
- Run the FastAPI server:
uvicorn main:app --reload
cd frontend
npm run start
📌 Now, the Books Store app should be running locally!
- User Registration & Login with complete validation.
- Email Verification: Users receive a confirmation link via email to verify their account.
- Secure Authentication & Authorization:
- Middleware ensures protected routes using JWT tokens.
- Refresh tokens allow users to renew access tokens without re-logging in.
- Forgot Password: Users can reset their password if forgotten.
- Session Expiry Handling:
- If an access token expires, users can refresh it without logging in again.
- CRUD Operations:
- Users can add, edit, delete, and manage their favorite books.
- User Profile Management:
- Users can update their profile details and change their password.
This project is licensed under the MIT License.
You are free to use, modify, and distribute this software as long as you include the original license.