BankPoc is a Golang-based application that demonstrates API creation using CRUD operations. It is designed as a microservices-based project with mailing capabilities.
- Feature 1
- Feature 2
- ...
To install BankPoc, follow these steps:
- Clone this repository.
- Install the required dependencies.
- Configure the settings (if necessary).
- Build the application using
go build
. It creates an executable file without any extension in macOS and Linux, but creates an executable with.exe
in Windows. - Run the application.
To install BankPoc, follow these steps:
-
Clone this Repository:
git clone https://github.com/yourusername/BankPoc.git cd BankPoc
-
Install Required Dependencies:
Ensure you have Go installed on your system. You can download it from here.
-
Configuration (if Necessary):
If your application requires any configuration, specify where users should add configuration files or environment variables. For example:
- Create a
.env
file in the project root. - Add your configuration settings to the
.env
file.
- Create a
-
Build the Application:
-
On macOS and Linux:
go build -o myapp #go build -o myapp.exe
-
On Windows:
go build -o myapp.exe
This command will create an executable file named
myapp
(without an extension on macOS and Linux) ormyapp.exe
(on Windows). -
-
Run the Application:
-
On macOS and Linux:
./myapp
-
On Windows:
.\myapp.exe
-
By following these steps, users should be able to clone, set up, build, and run your Go application with ease.
Step 1: Create a user. You can take its carl bash from developer console network tab fetch/XHR tab by pressing F12, and paste it in Postman to generate the URL endpoint automatically.
Step 2: Create password for the created user (non-temporary password).
Step 3: Create a client of "OpenID Connect" type and keep track of its secret found in dashboard.
Step 4: To fetch token for login, hit the Keycloak API endpoint: http://localhost:8080/realms/bankpoc/protocol/openid-connect/token
with body parameters ( x-www-form-urlencoded ) as:
client_id=<to be taken from Keycloak API> #bankpoc
username=<username>
password=<password>
grant_type=password #Value is literal "password" here.
client_secret=<value> # Taken from the Keycloak dashboard.
# Body parameters ( x-www-form-urlencoded ) while hitting the keycloak API: Key values in params but were to be passed in body section x-www-form-urlencoded subsection, then only they work
Step 5: Take the token from the response generated in the above step and use in hitting the Keycloak API: http://localhost:8080/realms/bankpoc/protocol/openid-connect/token/introspect with body parameters ( x-www-form-urlencoded ) as: client_secret= # Taken from the Keycloak dashboard. token= client_id= #bankpoc
# Body parameters ( x-www-form-urlencoded ) while hitting the keycloak API: Key values in params but were to be passed in body section x-www-form-urlencoded subsection, then only they work.
...
If your application requires any configuration, specify where users should add configuration files or environment variables. For example:
- Create a
.env
file in the project root. - Add your configuration settings to the
.env
file.
...
...
Use 'esc' key to come out of 'insert' mode and type ':wq' to save and exit.
#ADD
TO RUN docker-compose on MAC in case of docker command not found error:
ls -l /usr/local/bin | grep docker-compose ls /usr/local/bin | grep docker-compose
export PATH="/usr/local/bin:$PATH"
/usr/local/bin/docker-compose up
source ~/.bashrc
It looks like you were able to resolve the issue by sourcing your .bashrc file. This likely refreshed your environment variables and made the docker-compose command available. The Docker Compose command should now work as expected. Run ut after setting the environment, then it works. The source command, when used in a shell like Bash or Zsh, is used to execute commands from a file within the current shell session. In your case, when you run source ~/.bashrc, it executes the commands found in the ~/.bashrc file, which is typically used to set up environment variables, configure your shell, and define various aliases and functions.
docker-compose up docker-compose down docker-compose -f mysql-service.yaml up -d docker-compose -f docker-compose.yaml -f mysql-service.yaml up -d docker-compose -f docker-compose.yaml -f mysql-service.yaml down
If modules not found then create build file and then try to run the same.
- If the docker desktop is not running then, this will give this output: Manmohans-MacBook-Air:docker manmohansharma$ source ~/.bashrc Manmohans-MacBook-Air:docker manmohansharma$ docker-compose up Cannot connect to the Docker daemon at unix:///Users/manmohansharma/.docker/run/docker.sock. Is the docker daemon running?