Giter VIP home page Giter VIP logo

go-bank-api's Introduction

Go Bank API

This is a monorepo for the Go Bank API, which consists of two microservices: the Auth Service and the Banking Service. The Auth Service is responsible for handling user authentication using JWT, while the Banking Service is the main REST API for managing resources.

Getting Started

These instructions will help you set up and run the Go Bank API on your local machine for development and testing purposes.

Prerequisites

  • Go (v1.17 or higher) - Optional, for local development without Docker
  • Docker (for running the services in containers)
  • Docker Compose (for orchestrating the containers)

Installing

  1. Clone the repository:

ssh:

git clone [email protected]:sebi75/go-bank-api.git
cd go-bank-api

https:

git clone https://github.com/sebi75/go-bank-api.git
cd go-bank-api

Set up the environment variables for each microservice. Rename the .env.example file to .env in the root directory of each microservice, and set the values for the environment variables. For example, in the auth-service/.env file, you should have something like this:

DB_HOST=localhost
DB_PORT=5432
DB_USER=yourdbuser
DB_PASSWORD=yourdbpassword
DB_NAME=yourdbname
JWT_SECRET=yourjwtsecret

Make sure to replace the values with your own.

Build and run the microservices using Docker Compose. In the root directory of the project, run the following command:

docker-compose up --build

Docker Compose will build the images and start the containers for both services.

Using the Monorepo in Visual Studio Code To properly work with the monorepo in Visual Studio Code, create a go-bank-api.code-workspace file in the root directory of the repository, and include the following configuration:

{
	"folders": [
		{
			"path": "auth-service"
		},
		{
			"path": "banking-service"
		}
		{
			"path": "banking-lib"
		}
	]
}

Now, open the go-bank-api.code-workspace file in Visual Studio Code, and you should have a properly configured workspace for the monorepo.

Usage Once the services are up and running, you can interact with the API using tools like Postman or curl. Below are some example endpoints:

Auth Service:

POST /auth/register: Register a new user POST /auth/login: Authenticate a user and generate a JWT token Banking Service:

GET /customers: Get a list of customers POST /customers: Create a new customer PUT /customers/{id}: Update a customer DELETE /customers/{id}: Delete a customer Refer to the API documentation for a complete list of endpoints and request/response formats.

go-bank-api's People

Contributors

sebi75 avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.