LinGo-DBT is a Next.js web application that gamifies Dialectical Behavioral Therapy (DBT) skills learning using a Duolingo-inspired approach. The app helps users learn DBT skills through interactive exercises, progress tracking, and gamification elements.
This application follows a Clean Architecture approach combined with Domain-Driven Design (DDD) and Command Query Responsibility Segregation (CQRS) patterns.
- DBT Skills Learning: Structured modules covering core DBT skills (Mindfulness, Distress Tolerance, Emotion Regulation, Interpersonal Effectiveness)
- Interactive Exercises: Various exercise types to practice DBT skills
- Progress Tracking: Track user advancement through modules, skills, and lessons
- Gamification: XP, levels, streaks, and achievements to motivate consistent practice
- User Authentication: Secure authentication with email/password and OAuth options
- Frontend: Next.js, React, TailwindCSS
- Backend: Next.js API Routes
- Database: PostgreSQL with Prisma ORM
- Authentication: NextAuth.js
- State Management: Zustand, SWR for data fetching
The application follows Clean Architecture with these layers:
- Presentation Layer: Next.js pages and React components
- Application Layer: Commands, Queries, DTOs, and Application Services
- Domain Layer: Core business logic with Entities, Value Objects, and Domain Events
- Infrastructure Layer: Technical implementations (database, authentication, etc.)
For more details, see Architecture Documentation.
The DBT content is structured hierarchically:
- Modules: Main DBT skill areas (e.g., Mindfulness, Distress Tolerance)
- Skills: Specific techniques within modules (e.g., Wise Mind, DEAR MAN)
- Lessons: Step-by-step learning units for each skill
- Exercises: Interactive activities for practicing skills
For more details, see DBT Domain Model.
- Node.js (v18+)
- PostgreSQL database
-
Clone the repository
git clone https://github.com/yourusername/lingo-dbt.git cd lingo-dbt -
Install dependencies
npm install
-
Set up environment variables
cp .env.example .env.local
Then edit
.env.localwith your database connection string and other configuration. -
Set up the database
npx prisma migrate dev
-
Run the development server
npm run dev
-
Open http://localhost:3000 in your browser
src/
├── app/ # Next.js App Router
├── components/ # UI Components
│ ├── features/ # Feature-specific components
│ ├── layouts/ # Layout components
│ └── ui/ # Reusable UI components
├── core/ # Domain Layer
│ ├── entities/ # Domain entities
│ ├── valueObjects/ # Value objects
│ ├── events/ # Domain events
│ ├── services/ # Domain services
│ ├── repositories/ # Repository interfaces
│ └── types/ # Domain types
├── application/ # Application Layer
│ ├── commands/ # Command handlers
│ ├── queries/ # Query handlers
│ ├── dtos/ # Data transfer objects
│ ├── interfaces/ # Interfaces
│ └── services/ # Application services
├── infrastructure/ # Infrastructure Layer
│ ├── database/ # Database setup
│ ├── repositories/ # Repository implementations
│ ├── auth/ # Authentication
│ └── services/ # External services
└── utils/ # Utilities
- Fork the repository
- Create your feature branch (
git checkout -b feature/amazing-feature) - Commit your changes (
git commit -m 'Add some amazing feature') - Push to the branch (
git push origin feature/amazing-feature) - Open a Pull Request
This project is licensed under the MIT License - see the LICENSE file for details.