Features β’ Tech Stack β’ Quick Start β’ Documentation β’ Contributing
- Overview
- Features
- Tech Stack
- Prerequisites
- Quick Start
- Installation
- Environment Variables
- Database Setup
- Project Structure
- Available Scripts
- API Documentation
- Testing
- Deployment
- Troubleshooting
- Documentation
- Contributing
- License
Digital-Logbook is a comprehensive full-stack web application designed to facilitate structured learning relationships between mentees and mentors. It provides a robust platform for tracking learning activities, managing projects, delivering feedback, and generating performance reports.
- Activity Tracking: Students log daily learning activities with time spent and technologies used
- Mentor Oversight: Mentors review student progress and provide timely, structured feedback
- Project Management: Organize learning across multiple domains (software, film, training, research)
- Performance Analytics: Generate detailed reports on mentor activities and student progress
- User Administration: Streamlined user management, invitations, and role-based access control
- Gamification: Award badges to recognize and motivate student achievements
- Students/Mentees: Track learning progress, receive feedback, and earn recognition
- Mentors: Monitor mentees, provide feedback, and log mentoring activities
- Super Admins: Manage users, projects, invitations, and platform analytics
- π Activity Logging - Log daily activities with time tracking and technology tags
- π Progress Dashboard - Visualize learning progress and performance metrics
- π Gamification - Earn badges for achievements and milestones
- π€ Profile Management - Manage personal information and learning preferences
- π Task Calendar - Calendar view of activities and deadlines
- π₯ Mentee Management - View and manage assigned students
- β Feedback System - Approve, reject, or provide feedback on student activities
- π Bulk Reporting - Generate comprehensive reports (PDF/Excel export)
- π Activity Calendar - Calendar view of all mentee activities
- β±οΈ Time Tracking - Log mentoring hours and activities
- π― Project Management - Create and manage projects across multiple domains
- π€ User Management - Create, deactivate, and manage user roles
- π§ Bulk Invitations - Send and track email invitations with unique tokens
- π Analytics Dashboard - Platform-wide analytics and insights
- π Badge Management - Create and award achievement badges
β οΈ Warning System - Flag and monitor concerning activity patterns- π Report Management - View and manage generated reports
- π JWT Authentication - Secure token-based authentication
- π¨ Modern UI - Beautiful, responsive interface with TailwindCSS
- π Type-Safe APIs - End-to-end type safety with oRPC
- π± Responsive Design - Mobile-friendly interface
- π Dark Mode Support - Theme switching capability
- π§ Email Notifications - Automated email notifications via Nodemailer
- π Background Jobs - Async task processing with BullMQ
| Technology | Version | Purpose |
|---|---|---|
| Next.js | 14.2.5 | React framework with SSR/SSG |
| React | 18.x | UI library |
| TypeScript | 5.x | Type-safe JavaScript |
| TailwindCSS | Latest | Utility-first CSS framework |
| Radix UI | Latest | Accessible component primitives |
| shadcn/ui | Latest | Re-usable component library |
| React Hook Form | 7.x | Form validation |
| Zod | 3.x | Schema validation |
| TanStack Query | v5 | Data fetching & caching |
| Technology | Version | Purpose |
|---|---|---|
| Next.js API Routes | 14.2.5 | API endpoints |
| oRPC | 1.13.14 | Type-safe RPC framework |
| Prisma | 5.19.1 | ORM for database access |
| PostgreSQL | 16.3 | Relational database |
| Redis | Latest | Caching & job queue |
| BullMQ | 5.x | Background job processing |
| Jose | 5.x | JWT token handling |
| bcrypt | 5.x | Password hashing |
| Nodemailer | 6.x | Email sending |
| Technology | Version | Purpose |
|---|---|---|
| Docker | 27.1.2+ | Containerization |
| Docker Compose | Latest | Multi-container orchestration |
| Jest | Latest | Testing framework |
| ESLint | Latest | Code linting |
| Prettier | Latest | Code formatting |
Before you begin, ensure you have the following installed:
- Node.js:
v22.7.0(use nvm for version management) - npm:
10.8.2 - Docker:
27.1.2+(Install Docker) - Docker Compose: Latest version
- Git: Latest version
Note: Using the exact Node.js and npm versions is crucial for compatibility.
Get up and running in 5 minutes:
# 1. Clone the repository
git clone https://github.com/tracet2t/Digital-Logbook.git
cd Digital-Logbook
# 2. Navigate to server directory
cd server
# 3. Use the correct Node.js version
nvm use
# If not installed, run: nvm install
# 4. Install npm version
npm install npm@10.8.2
# 5. Install dependencies
npm install
# 6. Start Docker containers (from root directory)
cd ..
docker compose up --build
# 7. Return to server directory
cd server
# 8. Run database migrations
npm run migrate:maindb
# 9. Seed the database (optional)
npm run seed
# 10. Start the development server
npm run dev
# 11. Open your browser
# Application: http://localhost:3000
# PgAdmin: http://localhost:8080git clone https://github.com/tracet2t/Digital-Logbook.git
cd Digital-Logbookcd server
# Install Node Version Manager (if not already installed)
# https://github.com/nvm-sh/nvm#installing-and-updating
# Use the required Node.js version
nvm use
# If the version is not installed
nvm install
# Install the correct npm version
npm install npm@10.8.2npm installCreate a .env file in the server/ directory:
cp dotenv .envEdit .env with your configuration (see Environment Variables section).
Create a .env file in the server/ directory with the following variables:
# Database Configuration
DATABASE_URL="postgresql://postgres:your-db-password@pgdb:5432/postgres?schema=public"
NEXT_PUBLIC_POSTGRES_HOST=pgdb
NEXT_PUBLIC_POSTGRES_USER=postgres
NEXT_PUBLIC_POSTGRES_PASSWORD=your-db-password
# Redis Configuration (for job queue)
NEXT_PUBLIC_REDIS_HOST=redis
NEXT_PUBLIC_REDIS_PORT=6379
# Authentication
JWT_SECRET=your-super-secret-jwt-key-min-32-characters
BASE_URL=http://localhost:3000
# Email Configuration (SMTP)
SMTP_HOST=smtp.example.com
SMTP_PORT=587
SMTP_USER=your-email@example.com
SMTP_PASSWORD=your-email-password
SMTP_FROM=noreply@example.com
# Application Configuration
NODE_ENV=development
β οΈ Security Warning: Never commit your.envfile to version control. The.envfile is already in.gitignore.
| Variable | Description | Example |
|---|---|---|
DATABASE_URL |
PostgreSQL connection string | postgresql://user:pass@host:5432/db |
JWT_SECRET |
Secret key for JWT token signing (min 32 chars) | your-super-secret-key |
BASE_URL |
Application base URL | http://localhost:3000 |
SMTP_HOST |
SMTP server hostname | smtp.gmail.com |
SMTP_PORT |
SMTP server port | 587 or 465 |
SMTP_USER |
SMTP username/email | your-email@example.com |
SMTP_PASSWORD |
SMTP password | your-app-password |
The project uses Docker Compose to manage PostgreSQL, Redis, and pgAdmin:
# From project root directory
# First time setup
docker compose up --build
# Subsequent runs
docker compose upThis will start:
- PostgreSQL on
localhost:5432 - Redis on
localhost:6379 - pgAdmin on
localhost:8080(admin@example.com / admin)
cd server
npm run migrate:maindbnpm run seed# Open Prisma Studio (visual database editor)
npm run db:studio
# Reset database (β οΈ deletes all data)
npm run db:deleteDigital-Logbook/
βββ server/ # Main application directory
β βββ src/
β β βββ app/ # Next.js pages & layouts
β β β βββ admin/ # Super admin pages
β β β βββ mentor/ # Mentor pages
β β β βββ student/ # Student pages
β β β βββ login/ # Authentication pages
β β βββ components/ # React components
β β β βββ admin/ # Admin-specific components
β β β βββ mentor/ # Mentor-specific components
β β β βββ ui/ # Shared UI components (shadcn/ui)
β β βββ routers/ # oRPC API routers
β β βββ repositories/ # Data access layer (Prisma)
β β βββ services/ # Business logic
β β βββ server_actions/ # Next.js Server Actions
β β βββ middlewares/ # Authentication & routing middleware
β β βββ schemas/ # Zod validation schemas
β β βββ types/ # TypeScript type definitions
β β βββ utils/ # Utility functions
β β βββ lib/ # Library configurations
β β βββ worker/ # Background job workers (BullMQ)
β βββ prisma/
β β βββ schema.prisma # Database schema
β β βββ seed.mjs # Database seeding script
β β βββ migrations/ # Database migrations
β βββ public/ # Static assets
β βββ test/ # Test files
β βββ package.json # Dependencies & scripts
βββ docs/ # Documentation
β βββ api/ # API documentation
β βββ QA-Testcases/ # Test cases
β βββ schema/ # Database schema docs
βββ init/ # Database initialization scripts
βββ docker-compose.yml # Docker services configuration
βββ README.md # This file
Navigate to the server/ directory and run:
| Script | Command | Description |
|---|---|---|
| Development | npm run dev |
Start development server on port 3000 |
| Build | npm run build |
Build production bundle |
| Start | npm start |
Start production server |
| Lint | npm run lint |
Run ESLint |
| Test | npm test |
Run Jest tests |
| Prisma Generate | npm run generate |
Generate Prisma Client |
| Migrate DB | npm run migrate:maindb |
Run database migrations |
| Migrate Test DB | npm run migrate:testdb |
Run test database migrations |
| Seed DB | npm run seed |
Seed database with initial data |
| Prisma Studio | npm run db:studio |
Open Prisma Studio (DB GUI) |
| Reset DB | npm run db:delete |
Reset database ( |
This project uses oRPC for type-safe API development. oRPC provides:
- End-to-end type safety
- Automatic OpenAPI schema generation
- Runtime validation with Zod
- React Query integration
API routers are located in server/src/routers/:
- Authentication: User login, registration, password reset
- Projects: CRUD operations for projects
- Invitations: Bulk invitations and invitation management
- Activities: Student activity logging and retrieval
- Feedback: Mentor feedback on student activities
- Reports: Report generation and management
- Users: User management (admin)
- Badges: Badge creation and awarding
- API Registration & Authentication
- API Projects
- API Invitations
- oRPC Beginner Guide
- oRPC Quick Reference
- oRPC Implementation Explanation
The project uses Jest for unit and integration testing.
cd server
# Run all tests
npm test
# Run tests for specific file
npm test -- invitationRepository.test.ts
# Run tests in watch mode
npm test -- --watchTest files are located in server/test/:
invitationRepository.test.ts- Invitation repository testsmenteeTechnologyRepository.test.ts- Technology repository testspreliminaries.test.ts- Preliminary setup testsstudentTaskTechnologiesRoute.test.ts- Route tests
Comprehensive test cases are documented in docs/QA-Testcases/:
- Admin Dashboard Component
- Project Component
- User Component
- Report Component
- Invitation Repository
- Overall Admin Module
The application is containerized and can be deployed using Docker:
# Build and start all services
docker compose up --build -d
# View logs
docker compose logs -f nextjs-app
# Stop services
docker compose down
# Stop and remove volumes (β οΈ deletes data)
docker compose down -v- Environment Variables: Use production values for all sensitive variables
- Database: Use managed PostgreSQL service (e.g., AWS RDS, Supabase)
- Redis: Use managed Redis service (e.g., Redis Cloud, AWS ElastiCache)
- Secrets Management: Use environment variable managers (e.g., AWS Secrets Manager)
- SSL/TLS: Enable HTTPS with valid SSL certificates
- Monitoring: Set up logging and monitoring (e.g., Sentry, DataDog)
- Backups: Configure automated database backups
- Vercel - Next.js optimized deployment
- Railway - Full-stack deployment
- AWS - EC2, ECS, or App Runner
- DigitalOcean - App Platform or Droplets
# Find and kill process using port 3000
lsof -ti:3000 | xargs kill -9
# Or change port in package.json dev script
"dev": "next dev -p 3001"# Restart Docker services
docker compose down
docker compose up --build
# Clean Docker cache
docker system prune -a- Ensure Docker containers are running:
docker compose ps - Check
DATABASE_URLin.envfile - Verify PostgreSQL container health:
docker logs pgdb
# Regenerate Prisma Client
npm run generate
# Reset and regenerate
npm run db:delete
npm run migrate:maindb
npm run generate# Ensure correct Node.js version
nvm use
# If not installed
nvm install 22.7.0
nvm use 22.7.0# Clear node_modules and reinstall
rm -rf node_modules package-lock.json
npm installComprehensive documentation is available in the docs/ directory:
We welcome contributions! Here's how you can help:
- Fork the repository
- Create a feature branch
git checkout -b feature/your-feature-name
- Make your changes
- Follow existing code style
- Add tests for new features
- Update documentation as needed
- Run tests
npm test npm run lint - Commit your changes
git commit -m "feat: add amazing feature" - Push to your fork
git push origin feature/your-feature-name
- Create a Pull Request
- TypeScript: Use strict type checking
- Components: Follow React best practices
- Naming: Use descriptive variable and function names
- Comments: Add JSDoc comments for complex functions
- Formatting: Run Prettier before committing
- Testing: Write tests for new features
Follow Conventional Commits:
feat:- New featurefix:- Bug fixdocs:- Documentation changesstyle:- Code style changes (formatting, etc.)refactor:- Code refactoringtest:- Adding or updating testschore:- Maintenance tasks
- Components: Place in appropriate domain folder (
admin/,mentor/,student/) - Routers: Use oRPC router pattern
- Repositories: Follow repository pattern for data access
- Schemas: Define Zod schemas for validation
- Types: Add TypeScript interfaces in
types/directory
This project is licensed under the MIT License - see the LICENSE file for details.
MIT License
Copyright (c) 2024 tracet2t
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
- Next.js - The React Framework
- Prisma - Next-generation ORM
- oRPC - Type-safe RPC framework
- shadcn/ui - Beautiful UI components
- Radix UI - Accessible component primitives
- TailwindCSS - Utility-first CSS framework
For questions, issues, or feature requests:
- Issues: GitHub Issues
- Discussions: GitHub Discussions
All rights reserved Β© 2024-2026 Tracet2t
This project and all associated intellectual property, including but not limited to source code, documentation, design, and trademarks, are the exclusive property of Tracet2t.
While this software is licensed under the MIT License (see LICENSE file), all rights not expressly granted by the license are reserved by Tracet2t.
Made with β€οΈ by Tracet2t
Β© 2024-2026 Tracet2t. All Rights Reserved.
β Star this repository if you find it helpful!