API server dedicated to manage backpack inventories for hiking or bikepacking
Developer toolsGo · MakefileGitHub @Angak0kOnlineOwner unconfirmed
Have you tried it? One tap is enough. No sign-in needed.
The maker's introduction consists of the line above. Read the repository README for more details. Repository README ↗
Loading the full README.
Read the full README ↗PimpMyPack is a set of backend APIs dedicated to CRUD operations on hiking equipment inventories and packing lists.
It should be used in conjunction with any frontend candidates.
It could replace Lighterpack if this project dies (because it's not maintained anymore)
Application is available here.
The server is based on Gin Framework and provides endpoints to manage Accounts, Inventories & Packs
A dedicated API documentation is available here.
PimpMyPack uses JWT-based authentication with refresh tokens for secure API access.
Login: POST to /api/login with username and password
{
"username": "your_username",
"password": "your_password",
"remember_me": false
}
Response: Receive both tokens
{
"token": "...", // Backward compatibility (same as access_token)
"access_token": "...", // Use for API requests
"refresh_token": "...", // Use to refresh access token
"access_expires_in": 900, // Access token lifetime in seconds
"refresh_expires_in": 86400 // Refresh token lifetime in seconds
}
API Requests: Include access token in Authorization header
Authorization: Bearer <access_token>
Token Refresh: POST to /api/refresh when access token expires
{
"refresh_token": "..."
}
Logout: POST to /api/logout to revoke refresh token
{
"refresh_token": "..."
}
Token lifetimes can be configured via environment variables in .env:
ACCESS_TOKEN_MINUTES: Access token lifetime (default: 15 minutes)REFRESH_TOKEN_DAYS: Refresh token lifetime (default: 1 day)REFRESH_TOKEN_REMEMBER_ME_DAYS: Refresh token lifetime with "remember me" (default: 30 days)REFRESH_TOKEN_CLEANUP_INTERVAL_HOURS: Cleanup interval for expired tokens (default: 24 hours)REFRESH_RATE_LIMIT_REQUESTS: Rate limit for refresh endpoint (default: 10 requests/minute)REFRESH_RATE_LIMIT_WINDOW_MINUTES: Rate limit window (default: 1 minute)See our comprehensive Frontend Integration Guide for:
git clone [email protected]:Angak0k/pimpmypack.git
The app need a local DB.
You need to use docker to start a postgres database:
docker run --name pmp_db \
-d -p 5432:5432 \
-e POSTGRES_PASSWORD=pmp1234 \
-e POSTGRES_USER=pmp_user \
-e POSTGRES_DB=pmp_db postgres:17
Note: PostgreSQL 17 is required for this project.
Pimpmypack app read its conf from the environment and/or .env file.
The simplest way is to:
.env.sample file to .env.env file to match your setupgo build . && ./pimpmypack
go test ./...
or with verbose mode
go test -v ./...