Point of sale is a simple marketplace RESTful API backend development
What tech stack do I use?
- Go Programming Language for common language
- MySQL for Database Management
- gorm.io/gorm for Object Relational Mapping (ORM)
- gorilla/mux for Route Management
- joho/godotenv for Env Management
- github.com/golang-jwt/jwt for Authorization
- golang.org/x/crypto for Generate and Hash Password
This is the instruction how you can test go-store on your local computer:
-
Make sure that you have installed MySQL on your computer.
mysql --version
If not installed, you can get it on MySQL Documentaion
-
Make sure that you have installed Go on your computer.
go version
If not installed, you can get it on Go Documentaion
-
Make sure that you have installed Git on your computer.
git --version
If not installed, you can get it on Git Documentaion
-
Clone this project.
git clone https://github.com/risyafin/POS.git
-
Create new env file on project directory. Write the following into the env file. Example:
DB_USERNAME=root DB_PASSWORD=root DB_HOST=127.0.0.1:3306 DB_NAME=pos SERVER_PORT=8080
Adjust to your environmental values. Then, save file with name
.env
-
Make sure your MySQL service is running. You can confirm this with a command:
Linux:
sudo systemctl status mysql
Windows:
mysqladmin -u root -p status
-
Run Project on project directory path.
go run .
After the output write "server starting...." response, you can use this project. Good Luck!
Project Usage
Note
Some endpoint is need authorization to be accessed. You can get the token JWT by login, don't forget to register new account first if no user exist on database.
/register
, Register new admin. Example body:
{
"name": "Samsul Arifin",
"username": "SamsulArifin",
"password": "samsul1234",
"branchId": 1
}
/login
, login admin. Example body:
{
"username": "SamsulArifin",
"password": "samsul1234"
}