Here is your content formatted as Markdown:
# Walkit
A fitness workout tracking API built with Go, Gin framework, and PocketBase. This project is based on the [Fitness Workout Tracker](https://roadmap.sh/projects/fitness-workout-tracker) project from roadmap.sh.
## Features
- User Authentication (JWT)
- Exercise Management
- Workout Planning
- User Profile Management
- API Documentation with Swagger
- PocketBase Database Integration
## Prerequisites
- Go 1.19 or higher
- PocketBase
- Air (for hot reload)
- Swag (for API documentation)
## Installation
1. Clone the repository:
```bash
git clone https://github.com/rowjay007/walkit.git
cd walkit
-
Install dependencies:
go mod tidy
-
Install development tools:
go install github.com/swaggo/swag/cmd/swag@latest go install github.com/cosmtrek/air@latest
-
Set up environment variables (create a
.env
file):PORT=8080 POCKETBASE_URL=http://127.0.0.1:8090 JWT_SECRET=your_jwt_secret
-
Start PocketBase:
./pocketbase serve
Start the development server with hot reload:
make run
Other available commands:
make build # Build the application
make test # Run tests
make docs # Generate Swagger documentation
make clean # Clean build artifacts
Access the Swagger UI at:
http://localhost:8080/swagger/index.html
POST /api/v1/auth/register
- Register new userPOST /api/v1/auth/login
- User loginPOST /api/v1/auth/forgot-password
- Request password resetPOST /api/v1/auth/reset-password
- Reset password
GET /api/v1/users/me
- Get current user profilePATCH /api/v1/users/me
- Update current userDELETE /api/v1/users/me
- Delete current userGET /api/v1/users
- List usersGET /api/v1/users/:id
- Get user by IDPATCH /api/v1/users/:id
- Update userDELETE /api/v1/users/:id
- Delete user
POST /api/v1/exercises
- Create exerciseGET /api/v1/exercises
- List exercisesGET /api/v1/exercises/:id
- Get exercise by IDPATCH /api/v1/exercises/:id
- Update exerciseDELETE /api/v1/exercises/:id
- Delete exercise
POST /api/v1/workouts
- Create workoutGET /api/v1/workouts/:id
- Get workout by IDPATCH /api/v1/workouts/:id
- Update workoutDELETE /api/v1/workouts/:id
- Delete workout
walkit/
├── cmd/
│ └── server/
│ └── main.go
├── config/
├── internal/
│ ├── handler/
│ ├── middleware/
│ ├── model/
│ ├── repository/
│ ├── routes/
│ └── service/
├── pkg/
│ ├── logger/
│ └── util/
├── docs/
├── .air.toml
├── .env
├── Makefile
└── README.md
This project uses PocketBase as its database solution. PocketBase is an open-source backend consisting of embedded database with realtime subscriptions, built-in auth, and file storage.
Access the PocketBase Admin UI at:
http://127.0.0.1:8090/_/
The following collections are used in the project:
- users
- exercises
- workouts
- workout_schedules
This project is licensed under the MIT License - see the LICENSE file for details.