Complete blog web api written with golang/gin web server and postgres database
- JWT token
- Godotenv
- Postgres
- GORM
- Docker
- Swagger
- Gin
git clone https://github.com/pooulad/blogo
cd ./blogo
⚠️ Dont forget to create .env file with required JWT_SECRET_TOKEN
with jwt secret token value(you can generate from internet)
1-Simple way with .sh file:
./run.sh
2-Run docker compose manually
docker compose up --build -d
1-In root of source you should run your go project with your db config in ./config/config.json or .env file
go run ./cmd/blogo --cfg ./config/config.json
2-Or you can add all flags one by one like this sample:
go run ./cmd/blogo --db_name="test" --db_port=5432 ...
Flag name | Description |
---|---|
env | env file address |
app_url | application url |
port | application port |
db_port | database port |
db_name | database name |
db_host | database host |
db_username | database username |
db_password | database password |
db_sslmode | database sslmode(true/false) |
cfg | confige file |
{
"app_url": "0.0.0.0",
"port": "8000",
"environment": "development",
"db": {
"postgresql": {
"port": "5432",
"host": "postgres",
"dbname": "test_blogo",
"username": "postgres",
"password": "postgres",
"sslmode": "disable"
}
}
}
you can see all of them in ./docs/insomnia directory with .json or .har or .yaml extention
cd ./docs/insomnia
This section tracks the progress of implemented features in blogo.
- Dockerize
- Add swagger
- Releaser
- Validation for post methods
- Testing
This project is licensed under the MIT License.