This project is a FastAPI-based application designed to manage users across multiple projects. It provides a unified API for creating, retrieving, updating, and deleting user information, with data stored in Google Cloud Firestore. Additionally, the application includes functionality to send email invitations with links to API documentation.
- User Management: Create, retrieve, update, and delete users.
- Project Association: Users are associated with specific projects via a
project_id
. - Email Invitations: Send emails with links to Swagger UI and ReDoc API documentation.
- Google Cloud Firestore: Utilizes Firestore for data storage.
-
Clone the Repository:
git clone https://github.com/aniketwdubey/FastAPI-Firestore-User-Management.git cd FastAPI-Firestore-User-Management
-
Set Up Virtual Environment:
python3 -m venv .venv source .venv/bin/activate
-
Install Dependencies:
pip install -r requirements.txt
-
Environment Variables: Create a
.env
file in the root directory and add the following variables:[email protected] MAIL_PASSWORD=your_email_password [email protected] [email protected],[email protected]
-
Start the FastAPI Server:
uvicorn app.main:app --reload
-
Access API Documentation:
- Swagger UI: http://localhost:8000/docs
- ReDoc: http://localhost:8000/redoc
- Create User:
POST /add_users
- Get Users:
GET /get_users
- Update User:
PATCH /update_users/{user_id}
- Delete User:
DELETE /delete_users/{user_id}
- Send Invitation:
POST /send_invite
The application can be deployed on AWS EC2 or any other cloud service. Ensure that the necessary ports are open and the environment variables are set correctly.
This project is licensed under the MIT License.