Skip to content

This is a FastAPI-based ⚡ API that powers a ride-sharing mobile app (TuShare)

Notifications You must be signed in to change notification settings

morikeli/TuShare-backend

Repository files navigation

🚀 TuShare (ride-sharing app) API

This FastAPI-based RESTful API powers the TuShare mobile app.

📋 Features

  • 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.

🛠️ Tech stack

  • 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.

📦 Installation

  1. Clone the repository:
git clone https://github.com/morikeli/TuShare-backend.git
  1. Create a virtual environment and activate it:
python -m venv venv
source venv/bin/activate  # On Linux/Mac
venv\Scripts\activate    # On Windows
  1. Install dependencies:
pip install -r requirements.txt
  1. Run the FastAPI server:
uvicorn main:app --reload

The server will start at: http://localhost:8000


🧪 Testing

You can test the API using Postman or the FastAPI interactive docs:

http://localhost:8000/docs

🗂️ Project structure

📦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

📌 License


🤝 Contributing

Contributions are welcome! Please fork the repository and submit a pull request.


🐛 Issues

If you encounter any issues, please create an issue here.


✨ Happy Coding! 🚀