A full-stack login system featuring a robust FastAPI backend and a native Swift/iOS frontend.
This project demonstrates modern API design, secure authentication, and database persistence.
| Layer | Technology |
|---|---|
| Frontend | Swift, SwiftUI / UIKit (Xcode) |
| Backend | FastAPI (Python) |
| Database | PostgreSQL |
| Authentication | JWT (JSON Web Tokens) |
The backend follows a modular design for scalability:
main.py– Entry point of the FastAPI applicationauth.py– Logic for password hashing and JWT token generationdatabase.py– SQLAlchemy engine and session configuration for PostgreSQLmodels.py– Database table definitionsschemas.py– Pydantic models for validation and request/response shapesroutes.py– API endpoints for login, registration, and user management
The iOS application built in Xcode:
login_page.xcodeproj– Xcode project filelogin_page/– Contains Swift views and view modelslogin_pageTests/– Unit tests for the frontend logic
- Python 3.9+
- PostgreSQL
- Xcode (for running the iOS app)
cd backendpip install -r requirements.txtUpdate database.py with your PostgreSQL credentials, for example:
postgresql://user:password@localhost/dbname
uvicorn main:app --reloadThe API will be available at:
http://127.0.0.1:8000
- Open
login_page.xcodeprojin Xcode - Ensure the API base URL in your Swift code matches your local backend address
- Build and run the app using:
- iOS Simulator
- Secure Authentication – Passwords are hashed before storage in PostgreSQL
- Validation – Pydantic schemas ensure only valid data is processed
- JWT Support – Token-based authentication system
- Modular Routing – Clean separation between authentication logic, database models, and API routes
- Scalable Backend Design – Easy to extend with additional features
Developed as a full-stack authentication demo using FastAPI and Swift.