Simple Bank API
- Clone project from https://github.com/imkhoirularifin/simple-bank.git
git clone https://github.com/imkhoirularifin/simple-bank.git
- Change directory
cd simple-bank
- Install Dependencies
go get ./...
- Create a copy of your .env file
cp env.example .env
- Create Database in postgresql
example name = simple-bank
- Configure you own .env
DB_HOST=
DB_PORT=
DB_USERNAME=
DB_PASSWORD=
DB_NAME=simple-bank
API_PORT=
LOG_FILE=logger.log
SESSION_KEY="wonderfulIndonesia"
SESSION_MAX_AGE=604800 # expire in 7 day, data stored in seconds
- Configure DB_URL in Makefile
DB_URL=postgresql://{user}:{password}@{host}:{port}/simple-bank?sslmode=disable
- Migrate up
make migrateup
- Run the Project
go run .
- Import postman collection from this project file, all json request are in there
Note: This project is far from perfect, there is still a lot of inefficient code and lack of security on the backend, I don't use JWT for authentication, I only store user information in the session which is in the client cookie, I hope to develop this project deeper to implement the best practices in all aspects.