A modern web application for tracking On-the-Job Training (OJT) hours. Built with Next.js, this application helps students and trainees manage their training hours, tasks, and progress towards completion requirements.
- User Authentication - Secure sign-in with Google OAuth using NextAuth.js
- Task Management - Add, edit, and delete training tasks with detailed information
- Time Tracking - Automatic calculation of hours based on time-in and time-out
- Progress Dashboard - Visual overview of completed hours, remaining hours, and overall progress
- Category Organization - Organize tasks by categories for better tracking
- Learning Outcomes - Document what you learned from each task
- Export Functionality - Export your training records for reporting
- Responsive Design - Works seamlessly on desktop, tablet, and mobile devices
- Framework: Next.js 16 with App Router
- Language: TypeScript
- Styling: Tailwind CSS 4
- Database: Neon PostgreSQL
- ORM: Prisma 7
- Authentication: NextAuth.js 5
- Form Handling: React Hook Form
- Notifications: React Toastify
- Date Handling: date-fns
- Node.js 18+ installed
- PostgreSQL database (Neon recommended)
- Google OAuth credentials
-
Clone the repository
git clone https://github.com/Adrian9502/ojt-time-tracker.git cd ojt-time-tracker -
Install dependencies
npm install
-
Set up environment variables
Create a
.envfile in the root directory:# Database DATABASE_URL="postgresql://username:password@host/database?sslmode=require" # NextAuth NEXTAUTH_URL="http://localhost:3000" NEXTAUTH_SECRET="your-secret-key-here" # Google OAuth GOOGLE_CLIENT_ID="your-google-client-id" GOOGLE_CLIENT_SECRET="your-google-client-secret"
-
Set up the database
npx prisma generate npx prisma db push
-
Run the development server
npm run dev
-
Open your browser
Navigate to http://localhost:3000
ojt-time-tracker/
├── app/ # Next.js app directory
│ ├── api/ # API routes
│ │ ├── auth/ # NextAuth configuration
│ │ ├── entries/ # Entry CRUD operations
│ │ └── settings/ # Settings management
│ ├── auth/ # Authentication pages
│ └── page.tsx # Main dashboard
├── components/ # React components
│ ├── ConfirmationModal.tsx
│ ├── EntryForm.tsx
│ ├── Header.tsx
│ ├── SettingsModal.tsx
│ ├── StatsCard.tsx
│ └── TaskTable.tsx
├── lib/ # Utility functions and configurations
│ ├── constants.ts
│ ├── prisma.ts
│ ├── types.ts
│ └── utils.ts
├── prisma/ # Prisma schema and migrations
│ └── schema.prisma
└── public/ # Static assets
The application uses Prisma with the following main models:
- User - User authentication and profile
- Account - OAuth account linking
- Session - User session management
- Settings - User-specific OJT settings
- Entry - Training day entries
- Task - Individual tasks within entries
You can customize task categories in lib/constants.ts:
export const CATEGORIES = [
"Development",
"Meeting",
"Documentation",
"Testing",
// Add more categories...
];- Push your code to GitHub
- Import your repository in Vercel
- Configure environment variables in Vercel dashboard
- Deploy!
The application is configured with automatic Prisma generation during build.
Make sure to set these in your production environment:
DATABASE_URL- Your production PostgreSQL connection stringNEXTAUTH_URL- Your production domainNEXTAUTH_SECRET- A secure random stringGOOGLE_CLIENT_ID- Google OAuth client IDGOOGLE_CLIENT_SECRET- Google OAuth client secret
- Click the "+ Add Task" button
- Fill in the task details:
- Date
- Time in and Time out
- Task description
- Category
- Learning outcome (optional)
- Click "Save Task"
- Click "Edit" on any task in the table
- Modify the task details
- Click "Update Task"
- Click "Delete" on any task
- Confirm the deletion in the popup modal
- Click on your profile picture in the header
- Select "Settings"
- Update your OJT requirements:
- Required hours
- Student name
- Start and end dates
- Click "Save Settings"
Click the "Export" button to download your training records (feature implementation may vary).
Contributions are welcome! Please feel free to submit a Pull Request.
- Fork the project
- Create your feature branch (
git checkout -b feature/AmazingFeature) - Commit your changes (
git commit -m 'Add some AmazingFeature') - Push to the branch (
git push origin feature/AmazingFeature) - Open a Pull Request
This project is licensed under the MIT License - see the LICENSE file for details.
- GitHub: @Adrian9502
- Built with Next.js
- Database hosted on Neon
- Authentication powered by NextAuth.js
- Styled with Tailwind CSS
If you found this project helpful, please consider giving it a ⭐️!
