Ride the Wave of Productivity.
Daily Logger is a holistic productivity and wellness tracking application designed to help users organize tasks, reflect on their days, and optimize sleep patterns. Built with a serene "Ocean" theme, it offers a distraction-free environment with enterprise-grade authentication and data visualization.
- JWT-Based Auth: Secure Access and Refresh token rotation.
- Auto-Logout: Automatic session flushing upon token expiry.
- Middleware: Protected routes ensuring only authenticated access to dashboard features.
- CRUD Operations: Create, Read, Update, and Delete tasks seamlessly.
- Smart Sorting: Pending tasks always appear first; Completed tasks move to the bottom.
- Filtering: Filter views by All, Pending, or Completed.
- Optimistic UI: Instant status toggling for a snappy user experience.
- Star Ratings: Rate your day on a 1-5 scale.
- Validation: Prevents logging for future dates to ensure data integrity.
- Rich Summaries: Text area for detailed daily reflections.
-
Visual Timeline: Timeline view showing Bedtime vs. Wake Up time.
-
Smart Validation:
-
Prevents overlapping sleep sessions.
-
Ensures Start Time < End Time.
-
Limits sleep duration (Max 12 hours) to prevent erroneous data.
-
History restriction (Cannot log sleep older than 5 days).
-
Auto-Calculation: Automatically calculates sleep duration.
-
Custom SVG Charts: Lightweight, dependency-free visualization of data.
-
Pie Chart: Task Completion rates.
-
Line Chart: Mood trends over the last 7 logs.
-
Bar Chart: Sleep duration history.
-
Quote of the Day: Daily motivational quotes that update every 24 hours (with manual refresh option).
-
Profile Management: Update user details (Name, Username, Email) with uniqueness checks.
- Ocean Theme: A custom-designed Light/Dark mode (
ocean-light/ocean-dark) using Tailwind. - Responsive Design: Fully mobile-optimized with a custom collapsible hamburger menu.
- Loading States: Skeleton loaders and spinners for smooth data fetching.
| Technology | Description |
|---|---|
| Next.js | App Router framework for React. |
| TypeScript | Static typing for reliability. |
| Tailwind CSS | Utility-first styling with custom theme configuration. |
| Zustand | Lightweight, persisted global state management (Auth/Theme). |
| Axios | HTTP client with interceptors for token refreshing. |
| React Hot Toast | Beautiful, stacked notifications. |
| Technology | Description |
|---|---|
| Next.js API Routes | Serverless backend endpoints. |
| Drizzle ORM | Type-safe SQL ORM. |
| PostgreSQL | Relational database (Neon / Supabase / Local PostgreSQL). |
| Jose / Bcrypt | JWT handling and password hashing. |
Follow these steps to set up the project locally.
- Node.js (v18 or higher)
- npm or yarn
- PostgreSQL Database
- Clone the repository
git clone https://github.com/yourusername/daily-logger.git
cd daily-logger
- Install dependencies
npm install
- Set up the Database
- Ensure your PostgreSql server is running.
- Run Drizzle migrations (if applicable) or push schema:
npx drizzle-kit push:pg
- Configure Environment Variables
- Create a
.envfile in the root directory. - Copy the contents from
.env.example(see below).
- Run the development server
npm run dev
- Open http://localhost:3000 in your browser.
Create a .env file and add the following keys:
DATABASE_URL=postgresql://
ACCESS_SECRET=
REFRESH_SECRET=
NODE_ENV=development
ENCRYPTION_SECRET=
ADMIN_SECRET=| Method | Endpoint | Description |
|---|---|---|
POST |
/api/auth/signup |
Register a new user. |
POST |
/api/auth/signin |
Login and receive tokens. |
POST |
/api/auth/refresh |
Refresh access token using cookie. |
POST |
/api/auth/logout |
Clear HTTP-only cookies. |
| Method | Endpoint | Description |
|---|---|---|
GET |
/api/user |
Fetch current user details. |
PATCH |
/api/user |
Update profile (Username, Email, Name). |
| Method | Endpoint | Description |
|---|---|---|
GET |
/api/tasks |
Get all tasks. |
POST |
/api/tasks |
Create a new task. |
PATCH |
/api/tasks/:id |
Update task (Status/Content). |
DELETE |
/api/tasks/:id |
Delete a task. |
Endpoints follow the standard CRUD pattern for /api/logs and /api/sleep.
Contributions are welcome!
- 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.
Distributed under the MIT License. See LICENSE for more information.
Made with 💙 by Shivendra Devadhe