Skip to content

Swaroop883/loginpage

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

16 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Login Application

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.


🚀 Tech Stack

Layer Technology
Frontend Swift, SwiftUI / UIKit (Xcode)
Backend FastAPI (Python)
Database PostgreSQL
Authentication JWT (JSON Web Tokens)

📂 Project Structure

Backend (/backend)

The backend follows a modular design for scalability:

  • main.py – Entry point of the FastAPI application
  • auth.py – Logic for password hashing and JWT token generation
  • database.py – SQLAlchemy engine and session configuration for PostgreSQL
  • models.py – Database table definitions
  • schemas.py – Pydantic models for validation and request/response shapes
  • routes.py – API endpoints for login, registration, and user management

Frontend (/frontend/login_page)

The iOS application built in Xcode:

  • login_page.xcodeproj – Xcode project file
  • login_page/ – Contains Swift views and view models
  • login_pageTests/ – Unit tests for the frontend logic

🛠️ Getting Started

✅ Prerequisites

  • Python 3.9+
  • PostgreSQL
  • Xcode (for running the iOS app)

⚙️ Backend Setup

1️⃣ Navigate to backend directory

cd backend

2️⃣ Install dependencies

pip install -r requirements.txt

3️⃣ Configure environment

Update database.py with your PostgreSQL credentials, for example:

postgresql://user:password@localhost/dbname

4️⃣ Run the server

uvicorn main:app --reload

The API will be available at:

http://127.0.0.1:8000

📱 Frontend Setup

  1. Open login_page.xcodeproj in Xcode
  2. Ensure the API base URL in your Swift code matches your local backend address
  3. Build and run the app using:
    • iOS Simulator

🔐 Key Features

  • 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

👨‍💻 Author

Developed as a full-stack authentication demo using FastAPI and Swift.

About

Full-stack authentication system with a FastAPI backend, PostgreSQL database, JWT-based security, and a native Swift iOS frontend.

Resources

Stars

Watchers

Forks

Releases

Packages

Contributors

Languages