Skip to content

🌱 A minimalist habit tracking API built with NestJS and MongoDB, featuring JWT authentication, streak tracking, and comprehensive statistics. Clean, modern, and developer-friendly.

License

Notifications You must be signed in to change notification settings

fberrez/minihabits

Repository files navigation

minihabits.

A minimalist habit tracking app built with NestJS, MongoDB, and JWT, designed to help users build and maintain daily habits with a clean, intuitive interface.

Features

  • 🌓 Dark/Light mode support
  • 📱 Clean, modern UI with smooth animations
  • 📊 5-day habit tracking view
  • 🔥 Streak counting
  • 💾 Persistent storage using AsyncStorage
  • 📲 Haptic feedback for interactions
  • 🔍 Detailed habit view
  • ➕ Easy habit creation with modal interface

Getting Started

Prerequisites

  • Node.js (v20 or later)
  • pnpm

Installation

  1. Clone the repository:
git clone https://github.com/fberrez/minihabits.git
  1. Install dependencies:
cd minihabits
pnpm install
  1. Create a .env file in the root of the project with the following variables:
CORS_ORIGIN="http://localhost:5173"
FRONTEND_URL="http://localhost:5173"
JWT_EXPIRATION_TIME="7d"
JWT_REFRESH_EXPIRATION_TIME="30d"
JWT_REFRESH_SECRET="refresh_secret"
JWT_SECRET="secret"
MONGODB_URI="mongodb://admin:password@localhost:27017/minihabits"
NODE_ENV="development"
PORT="3000"
RESEND_API_KEY="re_11234"
RESEND_FROM="Minihabits <[email protected]>"
  1. Start the development server:
npm run start:dev

TODO

Authentication Routes

  • POST /auth/signup - Register a new user
  • POST /auth/signin - Login user
  • POST /auth/refresh - Refresh JWT token

Habits Routes

  • GET /habits - Get all habits for the authenticated user
  • POST /habits - Create a new habit
  • GET /habits/:id - Get a specific habit details
  • PATCH /habits/:id - Update a habit
  • DELETE /habits/:id - Delete a habit

Habit Tracking Routes

  • POST /habits/:id/track - Track a habit for today
  • DELETE /habits/:id/track - Untrack a habit for today
  • GET /habits/:id/streak - Get streak information
  • GET /habits/stats - Get overall statistics

User Routes

  • GET /users/me - Get current user profile
  • PATCH /users/me - Update user preferences (e.g., dark/light mode)
  • DELETE /users/me - Delete account

Optional Future Routes

  • GET /habits/daily - Get habits for today
  • GET /habits/weekly - Get weekly overview
  • POST /habits/:id/reminder - Set reminder for a habit
  • GET /habits/search - Search through habits

About

🌱 A minimalist habit tracking API built with NestJS and MongoDB, featuring JWT authentication, streak tracking, and comprehensive statistics. Clean, modern, and developer-friendly.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published