Skip to content

morikeli/TuShare-backend

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

🚀 TuShare (ride-sharing app) API

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

Project screenshots

Screenshot from 2025-05-17 22-24-08 Screenshot from 2025-05-17 22-24-22 Screenshot from 2025-05-17 22-24-32

📋 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 app: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/api/v1/docs  # swagger docs
http://localhost:8000/api/v1/redoc  # redoc


🗂️ Project structure

📦project-root
│
├── 📂 app
│   └── 📂 core
|   |   └── 📄 __init__.py
|   |   └── 📄 config.py
|   |   └── 📄 database.py
|   |   └── 📄 dependencies.py
|   |   └── 📄 redis.py
|   |   └── 📄 token_bearer.py
│   └── 📂 mails
|   |   └── 📄 __init__.py
|   |   └── 📄 send_mail.py
│   └── 📂 middleware
|   |   └── 📄 __init__.py
|   |   └── 📄 auth_middleware.py
│   └── 📂 models
|   |   └── 📄 __init__.py
|   |   └── 📄 base.py
|   |   └── 📄 booking.py
|   |   └── 📄 messages.py
|   |   └── 📄 rides.py
|   |   └── 📄 user.py
│   └── 📂 routers
|   |   └── 📄 __init__.py
|   |   └── 📄 auth.py
|   |   └── 📄 messages.py
|   |   └── 📄 rides.py
|   |   └── 📄 users.py
│   └── 📂 schemas
|   |   └── 📄 __init__.py
|   |   └── 📄 auth_schema.py
|   |   └── 📄 booking_schema.py
|   |   └── 📄 messages_schema.py
|   |   └── 📄 rides_schema.py
|   |   └── 📄 user_schema.py
│   └── 📂 service
|   |   └── 📄 __init__.py
|   |   └── 📄 auth_service.py
|   |   └── 📄 booking_service.py
|   |   └── 📄 messages_service.py
|   |   └── 📄 rides_service.py
|   |   └── 📄 user_service.py
│   └── 📂 utils
|   |   └── 📄 __init__.py
|   └── 📄 __init__.py
|   └── 📄 exceptions.py
├── 📂 media
│   └── 📂 dps
├── 📂 migrations
│   └── 📂 versions
│   └── 📄 env.py
│   └── 📄 README.md
│   └── 📄 script.py.mako
├── 📄 scripts
│   └── 📄 __init__.py
│   └── 📄 seed_db.py
├── 📄 templates
│   └── 📄 email-verification.html
│   └── 📄 reset-password.html
|
├── 📄 .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.


Made with ♥️. Don't hit the star button ⭐ to star this repo

✨ Happy Coding! 🚀