A Next.js application built with Supabase for pregnant women to track their journey, manage symptoms, and access personalized resources.
- Authentication: Secure user signup, login, and session management
- Responsive Dashboard: Personalized user dashboard optimized for all devices
- Profile Management: Comprehensive user profile customization
- Health Tracking: Record and monitor pregnancy-related health metrics and symptoms
- Content Library: Educational resources tailored to pregnancy stages
- Journey Timeline: Visual week-by-week pregnancy journey tracking
- Dark Mode: Elegant toggle between light and dark themes
- Mobile Optimization: Fully responsive design for all screen sizes
- Framework: Next.js 15.1.7 with App Router
- Language: TypeScript
- Database & Auth: Supabase
- Styling: Tailwind CSS with shadcn/ui components
- State Management: React hooks and Zustand
- Form Handling: React Hook Form with Zod validation
- Data Fetching: TanStack Query for efficient data management
- Node.js 18+ and npm
- Supabase account and project
- Clone the repository
git clone https://github.com/VisionaryOS/preggo-app.git
cd preggo-app- Install dependencies
npm install- Set up environment variables
cp .env.example .env.local- Edit
.env.localand add your Supabase credentials:
NEXT_PUBLIC_SUPABASE_URL=your-supabase-url
NEXT_PUBLIC_SUPABASE_ANON_KEY=your-supabase-anon-key
SUPABASE_SERVICE_ROLE_KEY=your-service-role-key
- Start the development server
npm run devpreggo-app/
├── public/ # Static assets
├── src/
│ ├── app/ # Next.js app router pages
│ ├── components/ # Reusable UI components
│ │ ├── auth/ # Authentication components
│ │ ├── dashboard/ # Dashboard-specific components
│ │ ├── ui/ # Shadcn UI components
│ │ └── layout/ # Layout components
│ ├── hooks/ # Custom React hooks
│ ├── lib/ # Utility functions and shared logic
│ │ ├── supabase/ # Supabase client utilities
│ │ └── utils.ts # General utility functions
│ └── types/ # TypeScript type definitions
├── supabase/ # Supabase migrations and seed data
└── middleware.ts # NextJS middleware for auth & routing
- New users sign up with email and password
- Users are directed to their dashboard
- Users can view and update their profile
- Dashboard provides health tracking and informational content
The application uses Supabase Authentication with:
- Email/password authentication
- Secure session management
- Protected routes via middleware
The application uses Next.js middleware (middleware.ts) to manage authentication and route protection:
- Public routes:
/,/login,/signup, etc. - Protected routes:
/dashboard,/profile,/logs, etc. (require authentication) - Route protection: Unauthenticated users are redirected to login
-- Authentication information handled by Supabase Auth
-- User profiles
CREATE TABLE users (
id UUID NOT NULL PRIMARY KEY REFERENCES auth.users(id),
full_name TEXT,
due_date DATE,
created_at TIMESTAMP WITH TIME ZONE DEFAULT now() NOT NULL,
updated_at TIMESTAMP WITH TIME ZONE DEFAULT now() NOT NULL
);
-- Other tables as needed for health logs, etc.- Use React Server Components for better performance
- Pre-render static content where possible
- Use Incremental Static Regeneration for semi-dynamic content
- Implement code splitting with dynamic imports
- Optimize images with Next.js Image component
- Memoize expensive computations with useMemo and useCallback
- Use TanStack Query for data fetching with caching
- Use appropriate indexes on commonly queried fields
- Implement efficient pagination for large datasets
- Cache frequently accessed data
- Follow ESLint and Prettier configurations
- Run linting before commits:
npm run lint - Use TypeScript for all new code
- Create small, reusable components
- Use composition over inheritance
- Implement proper prop typing
- Handle loading states and errors gracefully
- Follow Next.js App Router patterns
- Keep authentication state consistent
- Handle form validation with Zod
- Use optimistic UI updates for better UX
The application is configured for deployment on Vercel:
npm run buildFor local development:
# Standard development server
npm run dev
# Alternative port (3001)
npm run dev:alt
# Clean start (kills existing processes on port 3000)
npm run dev:cleanSee CHANGELOG.md for a detailed history of changes.
This project is licensed under the MIT License - see the LICENSE file for details.
A comprehensive pregnancy tracking dashboard application built with Next.js.
-
Three-Column Layout:
- Left sidebar for navigation
- Main pregnancy tracker content in the center
- AI chat assistant on the right side
- Responsive design that adapts to different screen sizes
-
Pregnancy Tracker:
- Visual timeline of all 40 weeks
- Current week highlight with baby size comparison
- Weekly development highlights for baby and mother
- Progress indicators
-
AI Chat Assistant:
- Contextual help based on current pregnancy week
- Persistent chat history using local storage
- Simple conversational interface
- Next.js App Router
- React with TypeScript
- Tailwind CSS
- shadcn/ui components
- Framer Motion animations
- Supabase authentication
- Clone the repository
- Install dependencies:
npm install
- Set up environment variables:
Copy .env.example to .env.local and fill in required values - Run the development server:
npm run dev
- Open http://localhost:3000 in your browser
/src/app/dashboard- Dashboard page/src/components/dashboard- Dashboard-specific components:PregnancyTracker.tsx- Main pregnancy tracking UIAIChat.tsx- Chat interface for pregnancy assistantSideNav.tsx- Left sidebar navigation
- Uses a week-by-week data structure to display pregnancy information
- Shows baby size comparisons with fruit/vegetable emojis
- Provides developmental milestones and tips for each week
- Interactive week selector to view different weeks
- Simulated AI responses based on context
- Implements local storage for message persistence
- Collapsible interface for mobile responsiveness
- Collapsible sidebar with profile summary
- Simple navigation between main app sections
- Responsive design for mobile use
- Connect AI chat to a real AI model API
- Implement user account settings and personalization
- Add symptom tracking and appointment scheduling
- Expand weekly content with more detailed information
- Add community features for connecting with other expecting parents