Meltype
This is Japanese input that melts the wall between half-width and full-width, like thawing snow.
AI translation
Track habits, view progress, and stay accountable with friends
AI summary · website content
ProductivityTypeScript · HTMLGitHub @ronalc90OnlineOwner unconfirmed
Have you tried it? One tap is enough. No sign-in needed.
No updates detected yet. GitHub releases will appear here.
Owners of public repositories under a personal GitHub account can sign in to verify ownership and manage the introduction themselves. No administrator approval is needed.
Sign in, generate a verification file, and commit it to this repository’s default branch within 30 minutes. Files on other branches or forks do not count. Then check the file below to manage the project without administrator approval. Keep the file to retain your access.
If needed, you will go to sign-in. After signing in, return here and press your chosen verification button again.
Run /nomorevibe verify in your project folder to verify ownership and manage the introduction yourself.
Verify in one minuteAsk about other verification options
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 ↗HabitForge es una aplicacion full-stack para el seguimiento de habitos personales con un enfoque unico en accountability social. Permite a los usuarios crear habitos, registrar su progreso diario, mantener rachas (streaks) y compartir su avance con un partner de responsabilidad.
El proyecto nacio de la necesidad de una herramienta que no solo rastree habitos, sino que incorpore mecanismos de presion social positiva para mantener la consistencia. A diferencia de otras apps de habitos, HabitForge pone el foco en la relacion entre dos personas que se comprometen mutuamente a cumplir sus metas.
/api/v1 con respuestas estandarizadasclass-validator y class-transformer{ success, data, timestamp })@CurrentUser para acceso al usuario autenticado┌─────────────────────────────────────────────────────────────────┐
│ AppModule (Root) │
│ ConfigModule.forRoot() | TypeOrmModule.forRoot() | Schedule │
└──────────┬──────────┬──────────┬──────────┬──────────┬──────────┘
│ │ │ │ │
┌──────┴──┐ ┌─────┴───┐ ┌───┴────┐ ┌───┴───┐ ┌───┴────────┐
│ Auth │ │ Habits │ │CheckIns│ │Streaks│ │ Dashboard │
│ Module │ │ Module │ │ Module │ │Module │ │ Module │
├─────────┤ ├─────────┤ ├────────┤ ├───────┤ ├────────────┤
│Controller│ │Controller│ │Controller│ │ │ │ Controller │
│ Service │ │ Service │ │ Service│ │Service│ │ Service │
│JWT Strat│ │ │ │ │ │ │ │ │
│Local St.│ │ │ │ │ │ │ │ │
└────┬────┘ └────┬────┘ └───┬────┘ └───┬───┘ └─────┬──────┘
│ │ │ │ │
┌────┴────┐ ┌───┴────┐ ┌───┴───┐ ┌───┴───┐ ┌────┴─────┐
│ User │ │ Habit │ │CheckIn│ │Streak │ │ Habit │
│ Entity │ │ Entity │ │Entity │ │Entity │ │ CheckIn │
└─────────┘ └────────┘ └───────┘ └───────┘ │ Streak │
└──────────┘
┌───────────────────┐ ┌───────────────────────────────┐
│ Notifications │ │ Common │
│ Module │ │ HttpExceptionFilter │
│ (Cron: 9 AM) │ │ TransformInterceptor │
└───────────────────┘ │ @CurrentUser Decorator │
└───────────────────────────────┘
Cliente HTTP
│
▼
ValidationPipe (whitelist + transform)
│
▼
Controller (rutas, guards, decoradores)
│
▼
Service (logica de negocio)
│
▼
TypeORM Repository (acceso a datos)
│
▼
SQLite / PostgreSQL
Para documentacion detallada de la arquitectura, ver docs/ARCHITECTURE.md
| Capa | Tecnologia | Proposito |
|---|---|---|
| Runtime | Node.js 22 | Entorno de ejecucion |
| Framework | NestJS 10 | Framework backend modular |
| Lenguaje | TypeScript 5.3 | Tipado estatico |
| ORM | TypeORM 0.3 | Mapeo objeto-relacional |
| DB (dev) | SQLite (better-sqlite3) | Base de datos local |
| DB (prod) | PostgreSQL 16 | Base de datos produccion |
| Auth | Passport + JWT | Autenticacion stateless |
| Validacion | class-validator | Validacion declarativa |
| Scheduler | @nestjs/schedule | Cron jobs |
| Frontend | Tailwind CSS + Alpine.js | UI neomorfica reactiva |
| Testing | Jest + Supertest | Unit + E2E tests |
| Contenedor | Docker | Despliegue |
# 1. Clonar el repositorio
git clone https://github.com/ronalc90/habit-forge.git
cd habit-forge
# 2. Instalar dependencias
npm ci
# 3. Configurar variables de entorno
cp .env.example .env
# Editar .env con tus valores
# 4. Ejecutar en modo desarrollo (SQLite por defecto)
npm run start:dev
# 5. Abrir el frontend
open http://localhost:3000
# Levantar servicios de infraestructura
docker-compose up -d
# Configurar .env para apuntar a PostgreSQL
# DB_HOST=localhost, DB_PORT=5432, etc.
# Ejecutar la app
npm run start:dev
| Variable | Descripcion | Default | Requerida |
|---|---|---|---|
DB_HOST | Host de PostgreSQL | localhost | No* |
DB_PORT | Puerto de PostgreSQL | 5432 | No* |
DB_USERNAME | Usuario de PostgreSQL | habitforge | No* |
DB_PASSWORD | Password de PostgreSQL | - | No* |
DB_DATABASE | Nombre de la base de datos | habitforge.sqlite | No |
JWT_SECRET | Clave secreta para tokens JWT | - | Si |
JWT_EXPIRATION | Tiempo de expiracion del token | 7d | No |
PORT | Puerto de la aplicacion | 3000 | No |
NODE_ENV | Entorno de ejecucion | development | No |
REDIS_HOST | Host de Redis | localhost | No |
REDIS_PORT | Puerto de Redis | 6379 | No |
CORS_ORIGIN | Origen permitido para CORS | * | No |
*En modo desarrollo se usa SQLite y no se requiere PostgreSQL.
Todos los endpoints usan el prefijo /api/v1. Las respuestas siguen el formato estandarizado:
{
"success": true,
"data": { ... },
"timestamp": "2026-04-10T12:00:00.000Z"
}
| Metodo | Endpoint | Descripcion | Auth |
|---|---|---|---|
GET | /api/v1/health | Health check (Docker, Kubernetes, ALB) | No |
| Metodo | Endpoint | Descripcion | Auth |
|---|---|---|---|
POST | /api/v1/auth/register | Registrar nuevo usuario | No |
POST | /api/v1/auth/login | Iniciar sesion | No |
GET | /api/v1/auth/profile | Obtener perfil del usuario | JWT |
| Metodo | Endpoint | Descripcion | Auth |
|---|---|---|---|
POST | /api/v1/habits | Crear un habito | JWT |
GET | /api/v1/habits | Listar todos los habitos | JWT |
GET | /api/v1/habits?active=true | Listar habitos activos | JWT |
GET | /api/v1/habits/:id | Obtener un habito por ID | JWT |
PATCH | /api/v1/habits/:id | Actualizar un habito | JWT |
DELETE | /api/v1/habits/:id | Eliminar un habito | JWT |
POST | /api/v1/habits/reorder | Reordenar habitos | JWT |
| Metodo | Endpoint | Descripcion | Auth |
|---|---|---|---|
POST | /api/v1/check-ins | Registrar check-in | JWT |
POST | /api/v1/check-ins/batch | Check-in masivo | JWT |
DELETE | /api/v1/check-ins/:habitId | Deshacer check-in | JWT |
GET | /api/v1/check-ins/today | Check-ins de hoy | JWT |
GET | /api/v1/check-ins/range | Check-ins por rango de fechas | JWT |
GET | /api/v1/check-ins/status/:habitId | Estado de check-in | JWT |
| Metodo | Endpoint | Descripcion | Auth |
|---|---|---|---|
GET | /api/v1/dashboard/today | Resumen del dia | JWT |
GET | /api/v1/dashboard/calendar | Datos de calendario | JWT |
GET | /api/v1/dashboard/stats | Estadisticas por periodo | JWT |
Para documentacion completa con ejemplos curl, ver docs/API.md
habit-forge/
├── src/
│ ├── auth/ # Modulo de autenticacion
│ │ ├── dto/ # DTOs: RegisterDto, LoginDto, AuthResponseDto
│ │ ├── guards/ # JwtAuthGuard, LocalAuthGuard
│ │ ├── strategies/ # JwtStrategy, LocalStrategy (Passport)
│ │ ├── auth.controller.ts # Rutas: register, login, profile
│ │ ├── auth.service.ts # Logica: hashing, validacion, JWT
│ │ └── auth.module.ts
│ ├── habits/ # Modulo de habitos
│ │ ├── dto/ # CreateHabitDto, UpdateHabitDto, ReorderDto
│ │ ├── habits.controller.ts # CRUD + reorder
│ │ ├── habits.service.ts # Logica de negocio
│ │ └── habits.module.ts
│ ├── check-ins/ # Modulo de check-ins
│ │ ├── dto/ # CreateCheckInDto, BatchDto, DateRangeDto
│ │ ├── check-ins.controller.ts
│ │ ├── check-ins.service.ts # Check-in, undo, batch, consultas
│ │ └── check-ins.module.ts
│ ├── streaks/ # Modulo de rachas
│ │ ├── streaks.service.ts # Algoritmo de calculo de rachas
│ │ └── streaks.module.ts
│ ├── dashboard/ # Modulo de dashboard
│ │ ├── dto/ # DashboardQueryDto (period, date)
│ │ ├── dashboard.controller.ts
│ │ ├── dashboard.service.ts # Resumen, calendario, estadisticas
│ │ └── dashboard.module.ts
│ ├── notifications/ # Modulo de notificaciones
│ │ ├── notifications.service.ts # Cron diario + mock push
│ │ └── notifications.module.ts
│ ├── common/ # Utilidades compartidas
│ │ ├── decorators/ # @CurrentUser
│ │ ├── filters/ # HttpExceptionFilter global
│ │ ├── interceptors/ # TransformInterceptor
│ │ └── dto/ # PaginationDto
│ ├── database/
│ │ ├── entities/ # User, Habit, CheckIn, Streak, AccountabilityPartner
│ │ └── migrations/ # Migracion inicial
│ ├── app.module.ts # Modulo raiz
│ └── main.ts # Bootstrap de la aplicacion
├── test/
│ └── app.e2e-spec.ts # Tests E2E del flujo completo
├── public/
│ └── index.html # Frontend neomorfico (SPA)
├── docs/ # Documentacion tecnica
├── .github/workflows/ # CI/CD con GitHub Actions
├── Dockerfile # Build multi-stage
├── docker-compose.yml # PostgreSQL + Redis
├── package.json
└── tsconfig.json
| Decision | Alternativa | Razon |
|---|---|---|
| NestJS sobre Express puro | Express, Fastify | Arquitectura modular, DI nativa, decoradores, ecosistema de modulos |
| TypeORM sobre Prisma | Prisma, Sequelize | Decoradores nativos con NestJS, Active Record + Data Mapper, migraciones |
| SQLite para desarrollo | PostgreSQL local, Docker | Zero-config, archivo unico, ideal para desarrollo rapido |
| JWT + Passport | Session-based auth | Stateless, escalable, multiples estrategias (local + jwt) |
| Neomorfismo para UI | Material, Bootstrap | Diferenciacion visual, experiencia tactil, innovacion en UX |
| Algoritmo incremental para streaks | Recalculo completo | O(1) en check-in vs O(n), con recalculo completo como fallback en undo |
Para ADRs detallados, ver docs/DECISIONS.md
El proyecto cuenta con 57 tests unitarios y 21 tests E2E (78 tests en total):
# Ejecutar tests unitarios
npm test
# Ejecutar con cobertura
npm run test:cov
# Ejecutar tests E2E (requiere PostgreSQL)
npm run test:e2e
# Ejecutar en modo watch
npm run test:watch
| Modulo | Tests | Tipo |
|---|---|---|
| AuthController | 6 | Unit |
| HabitsController | 10 | Unit |
| CheckInsService | 13 | Unit |
| StreaksService | 17 | Unit |
| DashboardService | 11 | Unit |
| App E2E Flow | 21 | E2E |
| Total | 78 | - |
# Construir imagen
docker build -t habitforge .
# Ejecutar contenedor
docker run -p 3000:3000 \
-e JWT_SECRET=tu-clave-secreta \
-e DB_DATABASE=habitforge.sqlite \
habitforge
# Instalar Railway CLI
npm i -g @railway/cli
# Login y deploy
railway login
railway init
railway up
Para instrucciones detalladas de despliegue, ver docs/DEPLOYMENT.md
Desarrollado por Ronald - GitHub
Este proyecto esta bajo la Licencia MIT. Ver LICENSE para mas detalles.