--
This repository contains the backend API for the TutorApp, a platform that connects students with tutors for academic sessions. The API provides endpoints for user authentication, session management, messaging, payments, and more.
- Prerequisites
- Cloning the Repository
- Setting Up the Environment
- Running the Project
- API Endpoints
- Contributing
- License
Before you begin, ensure you have the following installed on your system:
- Python 3.8+: Download from python.org.
- pip: Python's package installer (comes with Python 3.8+).
- virtualenv (optional): For creating isolated Python environments.
- Git: To clone the repository.
To clone the repository, run the following command in your terminal:
git clone https://github.com/SaadAlsuabie/TutorAppAPI.git
cd TutorAppAPI-
Create a Virtual Environment: It's recommended to use a virtual environment to manage dependencies.
python -m venv env source env/bin/activate # On Windows: env\Scripts\activate
-
Install Dependencies: Install the required packages using
pip.pip install -r requirements.txt
-
Set Environment Variables: Create a
.envfile in the root directory and add the following variables:SECRET_KEY=your_django_secret_key DEBUG=True ALLOWED_HOSTS=127.0.0.1,localhost DATABASE_URL=sqlite:///db.sqlite3 # Or your database URL JWT_SECRET_KEY=your_jwt_secret_key
Note: Replace
your_django_secret_keyandyour_jwt_secret_keywith secure random keys. -
Database Setup: By default, the project uses SQLite. If you want to use a different database, update the
DATABASE_URLin the.envfile.Apply migrations to set up the database schema:
python manage.py migrate
-
Create a Superuser (Optional): To access the Django admin panel, create a superuser:
python manage.py createsuperuser
-
Start the Development Server:
python manage.py runserver
The server will start at
http://127.0.0.1:8000/. -
Access the API: Use tools like Postman, HTTPie, or cURL to interact with the API endpoints.