Welcome to the official MQL BackEnd repository β This is a backend project built using Django and Django REST Framework (DRF).
To simplify frontend development and interaction with APIs, a dedicated apiHandler.js file has been provided. This utility streamlines API communication and makes the behavior of each endpoint clearer and more accessible for frontend developers.
π Key Features User registration and login functionality for clients
Ability for users to submit orders with detailed descriptions and a list of required tools
An admin panel to track and manage submitted orders
- β User Registration & Login APIs
- π Token-based Authentication System
- π¦ RESTful API built with Django REST Framework
- β‘ Frontend Integration via
fetch()(JavaScript) - π§± SQLite Database for lightweight development
- π§ Modular, Scalable Django Architecture
- π Frontend-friendly API handler (
apiHandeler.js)
MQL-BackEnd/ βββ MQL/ # Main Django settings & root config β βββ settings.py β βββ urls.py βββ AuthenticationSystem/ # Authentication app (core logic) β βββ models.py # User model(s) and logic β βββ views.py # API endpoints β βββ serializers.py # DRF serializers β βββ admin.py βββ apiHandeler.js # JS utility for API requests βββ manage.py # Django management script βββ db.sqlite3 # Development SQLite DB βββ requirements.txt # Python dependencies
yaml Copy Edit
| Area | Technology |
|---|---|
| Backend | Django, Django REST Framework |
| Auth | Token Authentication (DRF Token) |
| Database | SQLite |
| Frontend | Vanilla JavaScript (fetch) |
| API Format | REST / JSON |
git clone https://github.com/EstarioRios/MQL-BackEnd.git
cd MQL-BackEndCopy
Edit
python -m venv venv
source venv/bin/activate # Linux/macOS
venv\Scripts\activate # WindowsCopy
Edit
pip install -r requirements.txtCopy
Edit
python manage.py migrateCopy
Edit
python manage.py runserver
The backend will be available at: http://127.0.0.1:8000/Endpoint Method Description
β
Signup normal user (user_type="normal")
POST /api/signup/
Required fields: email, phone_number, password, first_name, last_name
β
Login (JWT-based, fallback to manual login if token not valid)
POST /api/login/
Required fields: email, password
Optional field: remember (boolean)
β
Manually login if JWT not present or failed
POST /api/manual-login/
Required fields: email, password
β
Create new admin user (Requires JWT and must be admin)
POST /api/create-admin/
Required fields: first_name, last_name, email, password, phone_number
β
Submit a new order (Authenticated users only)
POST /api/sub-order /
Required fields: title, description, tools_descriptionThese endpoints are implemented inside the AuthenticationSystem app using Django REST views and serializers.
The file apiHandeler.js contains utility methods to:
Call /register and /login endpoints using fetch()
Store and reuse the token for authenticated requests
Add Authorization headers automatically
Ideal for static sites, SPAs, or mobile hybrid apps.
Full-stack starter authentication for Django projects
Backend for React/Vue frontend with token-based login
Educational use for learning DRF + Auth patterns
Built with β€οΈ by Abolfazl Khezri GitHub: @EstarioRios
This project is licensed under the MIT License.
β¨ Future Enhancements (Optional Ideas)
β Add JWT support with refresh tokens
β Email confirmation during registration
β Rate limiting and login throttling
β Admin dashboard or user management panel
β Docker support for production deployment