Sadiqov-Riad/HabitForge

HabitForge is a habit‑building app that helps people turn a simple intention into a clear, day‑by‑day action plan. It generates structured routines with specific daily tasks, keeps progress visible through streaks and completion tracking, and encourages consistency with personalized guidance.

TypeScript

0

17 commits

updated Feb 21, 2026

See the code

README

HabitForge (Backend + Frontend)

Repo structure

  • backend/ — ASP.NET Core (.NET 9) API
  • frontend/ — React + Vite UI
  • Docker — PostgreSQL for local development

The backend host project is backend/AuthAPI/AuthAPI.Presentation.csproj.
It serves both Auth endpoints and Habit endpoints (Habit controllers are loaded via AddApplicationPart(...)).


Quick start (local dev)

1) Start Postgres (Docker)

From repo root:

docker compose up -d

Databases:

  • UserDb (Auth)
  • HabitDb (Habits)

2) Install .NET 9 SDK and restore tools

Install .NET 9 SDK (required for this backend):

brew install --cask dotnet-sdk9

Then restore local tools from backend/.config/dotnet-tools.json:

cd backend
dotnet tool restore

3) Configure backend environment

Create backend/AuthAPI/.env and edit values:

  • set JWT__SecretKey (min 32 chars)
  • (optional) configure Email__*, GoogleKeys__*, HuggingFace__*, LogoStorage__*

You can start from backend/AuthAPI/.env.example.

4) Apply EF Core migrations

Run these from backend/:

dotnet ef database update --project ./AuthAPI.Infrastructure/AuthAPI.Infrastructure.csproj --startup-project ./AuthAPI/AuthAPI.Presentation.csproj --context UserDbContext
dotnet ef database update --project ./Habit.Infrastructure/Habit.Infrastructure.csproj --startup-project ./AuthAPI/AuthAPI.Presentation.csproj --context HabitDbContext

5) Run backend

From backend/:

dotnet run --project ./AuthAPI/AuthAPI.Presentation.csproj --launch-profile https

Expected URLs (from launchSettings.json):

  • https://localhost:7145
  • http://localhost:5106

6) Run frontend

From frontend/:

npm install
npm run dev

Frontend dev server:

  • http://localhost:5174

Vite proxies API calls:

  • /api/* → https://localhost:7145 (see frontend/vite.config.ts)

Useful commands

Frontend

  • npm run dev — start dev server (port 5174)
  • npm run build — build to frontend/dist
  • npm run preview — preview build (port 4173)

Backend

  • dotnet build backend/AuthAPI/AuthAPI.Presentation.csproj
  • Add migration (Auth):
dotnet ef migrations add NAME_HERE --project ./AuthAPI.Infrastructure/AuthAPI.Infrastructure.csproj --startup-project ./AuthAPI/AuthAPI.Presentation.csproj --context UserDbContext --output-dir Migrations
  • Add migration (Habits):
dotnet ef migrations add NAME_HERE --project ./Habit.Infrastructure/Habit.Infrastructure.csproj --startup-project ./AuthAPI/AuthAPI.Presentation.csproj --context HabitDbContext --output-dir Migrations

Troubleshooting

  • Frontend shows ECONNREFUSED: backend not running on https://localhost:7145 or wrong port.
  • 401 then logout: refresh token missing/expired in localStorage (frontend uses axios interceptor in frontend/src/shared/lib/axios.ts).
  • Migrations fail to connect: check Postgres is up (docker ps) and port 5433 is free.
  • Need to reset DB (destroys data):
docker compose down -v

Docker notes

See backend/DockerConfig.md for Postgres + connection string details.

Sadiqov-Riad/HabitForge

HabitForge is a habit‑building app that helps people turn a simple intention into a clear, day‑by‑day action plan. It generates structured routines with specific daily tasks, keeps progress visible through streaks and completion tracking, and encourages consistency with personalized guidance.

TypeScript

0

17 commits

updated Feb 21, 2026

See the code

README

HabitForge (Backend + Frontend)

Repo structure

  • backend/ — ASP.NET Core (.NET 9) API
  • frontend/ — React + Vite UI
  • Docker — PostgreSQL for local development

The backend host project is backend/AuthAPI/AuthAPI.Presentation.csproj.
It serves both Auth endpoints and Habit endpoints (Habit controllers are loaded via AddApplicationPart(...)).


Quick start (local dev)

1) Start Postgres (Docker)

From repo root:

docker compose up -d

Databases:

  • UserDb (Auth)
  • HabitDb (Habits)

2) Install .NET 9 SDK and restore tools

Install .NET 9 SDK (required for this backend):

brew install --cask dotnet-sdk9

Then restore local tools from backend/.config/dotnet-tools.json:

cd backend
dotnet tool restore

3) Configure backend environment

Create backend/AuthAPI/.env and edit values:

  • set JWT__SecretKey (min 32 chars)
  • (optional) configure Email__*, GoogleKeys__*, HuggingFace__*, LogoStorage__*

You can start from backend/AuthAPI/.env.example.

4) Apply EF Core migrations

Run these from backend/:

dotnet ef database update --project ./AuthAPI.Infrastructure/AuthAPI.Infrastructure.csproj --startup-project ./AuthAPI/AuthAPI.Presentation.csproj --context UserDbContext
dotnet ef database update --project ./Habit.Infrastructure/Habit.Infrastructure.csproj --startup-project ./AuthAPI/AuthAPI.Presentation.csproj --context HabitDbContext

5) Run backend

From backend/:

dotnet run --project ./AuthAPI/AuthAPI.Presentation.csproj --launch-profile https

Expected URLs (from launchSettings.json):

  • https://localhost:7145
  • http://localhost:5106

6) Run frontend

From frontend/:

npm install
npm run dev

Frontend dev server:

  • http://localhost:5174

Vite proxies API calls:

  • /api/* → https://localhost:7145 (see frontend/vite.config.ts)

Useful commands

Frontend

  • npm run dev — start dev server (port 5174)
  • npm run build — build to frontend/dist
  • npm run preview — preview build (port 4173)

Backend

  • dotnet build backend/AuthAPI/AuthAPI.Presentation.csproj
  • Add migration (Auth):
dotnet ef migrations add NAME_HERE --project ./AuthAPI.Infrastructure/AuthAPI.Infrastructure.csproj --startup-project ./AuthAPI/AuthAPI.Presentation.csproj --context UserDbContext --output-dir Migrations
  • Add migration (Habits):
dotnet ef migrations add NAME_HERE --project ./Habit.Infrastructure/Habit.Infrastructure.csproj --startup-project ./AuthAPI/AuthAPI.Presentation.csproj --context HabitDbContext --output-dir Migrations

Troubleshooting

  • Frontend shows ECONNREFUSED: backend not running on https://localhost:7145 or wrong port.
  • 401 then logout: refresh token missing/expired in localStorage (frontend uses axios interceptor in frontend/src/shared/lib/axios.ts).
  • Migrations fail to connect: check Postgres is up (docker ps) and port 5433 is free.
  • Need to reset DB (destroys data):
docker compose down -v

Docker notes

See backend/DockerConfig.md for Postgres + connection string details.

Languages

TypeScript

64.6%

C#

34.0%