This FastAPI-based RESTful API powers the TuShare mobile app.
- Authentication - login, signup & logout
- Profile management - view and update user profile
- Password hashing for enhanced security.
- Book rides, search for available rides and view booked rides
- In-app messaging between passengers and drivers
- Database integration using SQLAlchemy.
- Error handling for unique constraint violations.
- FastAPI - Python web framework for building REST APIs.
- SQLite - Database for data persistence.
- SQLAlchemy - ORM for database interactions.
- Pydantic - Data validation.
- UUID - Unique ID generation.
- Shutil & OS - File system operations.
- Clone the repository:
git clone https://github.com/morikeli/TuShare-backend.git
- Create a virtual environment and activate it:
python -m venv venv
source venv/bin/activate # On Linux/Mac
venv\Scripts\activate # On Windows
- Install dependencies:
pip install -r requirements.txt
- Run the FastAPI server:
uvicorn main:app --reload
The server will start at: http://localhost:8000
You can test the API using Postman or the FastAPI interactive docs:
http://localhost:8000/docs
📦project-root
│
├── 📄 db
│ └── 📄 __init__.py
│ └── 📄 database.py
│ └── 📄 schemas.py
│ └── 📄 seed_db.py
├── 📂 media
│ └── 📂 dps
├── 📄 routes
│ └── 📄 __init__.py
│ └── 📄 messages.py
│ └── 📄 rides.py
│ └── 📄 users.py
├── 📄 schemas
│ └── 📄 __init__.py
│ └── 📄 auth_schema.py
│ └── 📄 messages_schema.py
│ └── 📄 rides_schema.py
│ └── 📄 users_schema.py
├── 📄 .env
├── 📄 .gitignore
├── ⚙️ alembic.ini
├── 📄 auth.py
├── 📄 config.py
├── 📄 __init__.py
├── 📄 main.py
├── 📄 models.py
└── 📄 README.md
├── 📄 requirements.txt
├── 📄 utils.py
Contributions are welcome! Please fork the repository and submit a pull request.
If you encounter any issues, please create an issue here.
✨ Happy Coding! 🚀