Initial project setup with MIT license
- Add MIT License (Copyright 2025 David Folch Agulles) - Add README with project description - Add .gitignore for Go project - Add .env.example for configuration - Initialize Go module
This commit is contained in:
@@ -0,0 +1,13 @@
|
|||||||
|
DB_TYPE=sqlite
|
||||||
|
DB_PATH=./data/habits.db
|
||||||
|
|
||||||
|
PORT=8080
|
||||||
|
HOST=0.0.0.0
|
||||||
|
|
||||||
|
JWT_SECRET=change-me-in-production
|
||||||
|
JWT_EXPIRY=24h
|
||||||
|
REFRESH_TOKEN_EXPIRY=168h
|
||||||
|
|
||||||
|
CORS_ORIGINS=http://localhost:3000
|
||||||
|
|
||||||
|
DEFAULT_TIMEZONE=UTC
|
||||||
@@ -0,0 +1,9 @@
|
|||||||
|
.env
|
||||||
|
data/
|
||||||
|
*.db
|
||||||
|
*.db-shm
|
||||||
|
*.db-wal
|
||||||
|
habit-tracker-api
|
||||||
|
dist/
|
||||||
|
bin/
|
||||||
|
.internal-notes/
|
||||||
@@ -0,0 +1,21 @@
|
|||||||
|
MIT License
|
||||||
|
|
||||||
|
Copyright (c) 2025 David Folch Agulles
|
||||||
|
|
||||||
|
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||||
|
of this software and associated documentation files (the "Software"), to deal
|
||||||
|
in the Software without restriction, including without limitation the rights
|
||||||
|
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||||
|
copies of the Software, and to permit persons to whom the Software is
|
||||||
|
furnished to do so, subject to the following conditions:
|
||||||
|
|
||||||
|
The above copyright notice and this permission notice shall be included in all
|
||||||
|
copies or substantial portions of the Software.
|
||||||
|
|
||||||
|
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||||
|
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||||
|
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||||
|
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||||
|
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||||
|
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||||
|
SOFTWARE.
|
||||||
@@ -0,0 +1,53 @@
|
|||||||
|
# Habit Tracker API
|
||||||
|
|
||||||
|
Self-hosted habit tracking service with a clean, hexagonal architecture.
|
||||||
|
|
||||||
|
## Features
|
||||||
|
|
||||||
|
- **Multiple habit types**: Boolean (check), Counter, Value
|
||||||
|
- **Flexible scheduling**: Daily, Weekly, Monthly with specific days
|
||||||
|
- **Carry-over support**: Choose if incomplete habits persist or expire
|
||||||
|
- **Full history tracking**: Complete audit trail of all interactions
|
||||||
|
- **Charts & Analytics**: Heatmaps, line charts, and statistics
|
||||||
|
- **Self-hosted first**: Easy deployment with SQLite or PostgreSQL
|
||||||
|
|
||||||
|
## Quick Start
|
||||||
|
|
||||||
|
### Using the binary
|
||||||
|
|
||||||
|
1. Download the latest release
|
||||||
|
2. Copy `.env.example` to `.env` and configure
|
||||||
|
3. Run: `./habit-tracker-api`
|
||||||
|
|
||||||
|
The API will be available at `http://localhost:8080`
|
||||||
|
|
||||||
|
## Development
|
||||||
|
|
||||||
|
### Prerequisites
|
||||||
|
|
||||||
|
- Go 1.23+
|
||||||
|
- SQLite (or PostgreSQL)
|
||||||
|
|
||||||
|
### Running locally
|
||||||
|
|
||||||
|
```bash
|
||||||
|
cp .env.example .env
|
||||||
|
go run cmd/api/main.go
|
||||||
|
```
|
||||||
|
|
||||||
|
## API Documentation
|
||||||
|
|
||||||
|
Once running, visit `http://localhost:8080/api/v1/docs` for interactive API documentation.
|
||||||
|
|
||||||
|
## Architecture
|
||||||
|
|
||||||
|
This project follows hexagonal (ports & adapters) architecture:
|
||||||
|
|
||||||
|
- `domain/`: Core business logic and entities
|
||||||
|
- `application/`: Use cases (commands & queries)
|
||||||
|
- `infrastructure/`: External adapters (database, HTTP, etc.)
|
||||||
|
- `shared/`: Common utilities and errors
|
||||||
|
|
||||||
|
## License
|
||||||
|
|
||||||
|
MIT
|
||||||
Reference in New Issue
Block a user