Skip to content

ByteBank API is a project that makes up the mobile application ByeBank developed in Flutter. It provides an interface with only one endpoint for creating and reading transfers.

Notifications You must be signed in to change notification settings

davidgaspardev/bytebank-api

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

30 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

ByteBank API

Simple API server for ByteBank mobile app add-on. This server was developed 100% in the programming language Go.

Installations

Prerequisite to install Bytebank API:

MongoDB Atlas

If you use MongoDB Atlas, you need to declare and initialize the following environment variables:

  • MONGO_USER: Username to connect with MongoDB
  • MONGO_PASS: Password to connect with MongoDB
  • MONGO_HOST: MongoDB address hostname, DNS or IP (optional, default: localhost)
  • MONGO_PORT: MongoDB address port (optional, default: 27017)
  • MONGO_DB: Database name declared in the MongoDB (optinal, default: bytebank)

Obs: You can use a Makefile to set the environment variables.

Authetication configurations

You need to declare and initialize the following environment variables:

  • Basic HTTP Authentication Scheme. (See more: RFC 7617)
    • AUTH_USER: Anything username (Ex: elonmusk)
    • AUTH_PASS: Anything password (Ex: jeff%1993)

    Obs: External applications that have consumed this API will need to know this username and password for successful communication.

  • PASS_POST: Password to validate transfer storage in database

Application build

Download the necessary dependencies to run the application:

go get

Now just run the application with the following command:

(with MongoDB Atlas)

MONGO_USER=<your user> MONGO_PASS=<your pass> MONGO_HOST=<your host> MONGO_DB=<your database name>  AUTH_USER=<anything> AUTH_PASS=<anything> POST_PASS=<anything> go run main.go

(with local MongoDB)

AUTH_USER=<anything> AUTH_PASS=<anything> POST_PASS=<anything> go run main.go

About

ByteBank API is a project that makes up the mobile application ByeBank developed in Flutter. It provides an interface with only one endpoint for creating and reading transfers.

Topics

Resources

Stars

Watchers

Forks