Skip to content

Simple Bank API is an educational project simulating a digital banking system. Built with server-side Swift using the Vapor framework, it adheres to SOLID principles and Apple's guidelines.

Notifications You must be signed in to change notification settings

yvesoliveira23/SimpleBankAPI

Repository files navigation

SimpleBankAPI

SimpleBankAPI is a server-side Swift web application built using the Vapor framework. It provides a simple banking API with user management, balance handling, and transaction support.

Table of Contents

Installation

Prerequisites

  • Swift 5.3 or later
  • Vapor 4
  • PostgreSQL

Steps

  1. Clone the repository:

    git clone https://github.com/yvesoliveira23/SimpleBankAPI
    cd SimpleBankAPI
  2. Install dependencies:

    swift package update
  3. Set up the database:

    psql -c 'CREATE DATABASE simplebankapi;'

Usage

Running the Application

  1. Build the project:

    swift build
  2. Run the project:

    swift run
  3. The application will be available at http://localhost:8080.

Configuration

Environment Variables

  • DATABASE_PORT: The port for the database connection (default: 5432)
  • DATABASE_HOSTNAME: The hostname for the database connection (default: localhost)
  • DATABASE_USERNAME: The username for the database connection (default: vapor_username)
  • DATABASE_PASSWORD: The password for the database connection (default: "")
  • ENABLE_LEAF: Enable Leaf templating engine (default: false)

Example .env file

DATABASE_PORT=5432
DATABASE_HOSTNAME=localhost
DATABASE_USERNAME=vapor_username
DATABASE_PASSWORD=yourpassword
ENABLE_LEAF=true

Testing

Run the test suite using:

swift test

Contributing

  1. Fork the repository
  2. Create your feature branch
  3. Commit your changes
  4. Push to the branch
  5. Open a Pull Request

License

This project is licensed under the MIT License - see the LICENSE file for details.

About

Simple Bank API is an educational project simulating a digital banking system. Built with server-side Swift using the Vapor framework, it adheres to SOLID principles and Apple's guidelines.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published