A modern habit tracking and accountability platform that helps users build lasting habits through social connections and commitment tracking. HabitPact transforms personal goals into sustainable habits by leveraging the power of social accountability and consistent progress monitoring.
Project showcasing full-stack development with Spring Boot and React, implementing user authentication, real-time notifications, and PostgreSQL database integration.
- Java 21
- Spring Boot
- MongoDB
- Gradle
- React Frontend
Required installations:
- JDK 21
- Gradle 8.x
- Node v22.9.0
- Docker
JWT_SECRET=*******
DATABASE_URL=jdbc:postgresql://localhost:5432/habitpact
DATABASE_USERNAME=postgres
DATABASE_PASSWORD=********
git clone git@github.com:your-username/habit-pact.git
cd habit-pact
docker-compose up -d
./gradlew build
./gradlew bootRun
cd frontend
npm install
npm run dev
- Server runs on
http://localhost:8080
- Frontend runs on
http://localhost:5173/
HABIT-PACT/
βββ .gradle/
βββ .idea/
βββ bin/
βββ build/
βββ docker/
βββ frontend/
βββ gradle/
βββ src/
βββ build.gradle
βββ docker-compose.yml
βββ gradlew
βββ gradlew.bat
βββ README.md
βββ settings.gradle
- User authentication and profile management
- Habit tracking and progress visualization
- Social accountability partnerships
- Real-time notifications and reminders
- Detailed analytics and insights
- Goal-setting framework
- Reward system
Swagger UI: http://localhost:8080/swagger-ui.html
/api/auth/*
- Authentication endpoints/api/habits/*
- Habit management endpoints/api/users/*
- User management endpoints/api/accountability/*
- Accountability partnership endpoints
The API uses standard HTTP response codes:
- 200: Success
- 400: Bad request
- 401: Unauthorized
- 403: Forbidden
- 404: Not found
- 500: Internal server error
Please read CONTRIBUTING.md for details on our code of conduct and the process for submitting pull requests.
- Install dependencies
npm install
- Create a
.env
file in the project root with:
API_BASE_URL=http://localhost:8080
API_USERNAME=test@example.com
API_PASSWORD=password123
Run all tests:
npx playwright test
Run specific test file:
npx playwright test habits/create.api.spec.ts
Run tests with specific tag:
npx playwright test --grep "@smoke"
Run in debug mode:
npx playwright test --debug
View HTML report:
npx playwright show-report
Generate and view trace:
npx playwright test --trace on
api-tests/
βββ playwright.config.ts # Test configuration
βββ tests/ # Test Source Folder
βββ test-results/ # Test reports and traces
- Use
console.log()
in tests for debugging - Check test traces for failed tests
- Review API responses in test report
- Use
test.only()
to run single test
-
API Connection:
- Ensure API is running at correct URL
- Check port number matches configuration
-
Authentication:
- Verify test user credentials
- Check token expiration settings
-
Test Data:
- Ensure clean test state
- Check for data conflicts
# Install Playwright browsers
npx playwright install
# Run tests and generate report
npx playwright test --reporter=html
# Run specific test file with debug output
npx playwright test filename.spec.ts --debug
# Update Playwright
npm install -D @playwright/test@latest
- Group accountability circles
- Accountability partner matching system
- Progress sharing on social media
- In-app messaging system
- Video check-ins
- Accountability score tracking
- Partner rating system
- Community challenges
- Habit correlation analysis
- Success rate predictions
- Behavioral pattern recognition
- Custom reporting tools
- Progress trend visualization
- Impact analysis
- Achievement milestones tracking
- Performance insights
- Achievement badges
- Level progression system
- Challenge competitions
- Reward point system
- Streak multipliers
- Custom challenges
- Social leaderboards
- Virtual rewards store
- Native iOS app
- Native Android app
- Cross-platform compatibility
- Offline mode support
- Push notifications
- Biometric authentication
- Widget support
- Location-based reminders
docker build -t habitpact/app:1.0 .
docker run -e JWT_SECRET=******** -e DATABASE_URL=jdbc:postgresql://localhost:5432/habitpact -p 8080:8080 habitpact/app:1.0
docker push habitpact/app:1.0
# Test development
npm run dev
# Test production locally
npm run build
npm run preview
# Or use serve to test the production build
npm install -g serve
serve dist
MIT License - see LICENSE.md
For any queries, please contact [Your Contact Information].
HabitPact - Building Better Habits Through Accountability