Develop a full-stack web application named 'AscendNet' for early-career professionals in startups. The application should be built using Next.js 14+ with the App Router, TypeScript, Tailwind CSS, and Drizzle ORM for PostgreSQL. Implement a robust authentication system using NextAuth.js. The goal is to create a community and networking platform to combat professional isolation, foster peer learning, mentorship, and provide opportunities for side projects and new roles.
The application must include the following multi-page structures and functionalities:
1. **Authentication System:**
* User registration (`/auth/register`) and login (`/auth/login`) with email/password.
* Session management and logout.
* Protected routes for authenticated users.
2. **User Profiles:**
* Create, Read, Update (CRUD) for user profiles (`/profile/[id]`, `/profile/edit`).
* Profile fields: name, email, bio, skills (multi-select), interests (multi-select), current role, company, location, extroversion level (slider/radio), seeking (mentor, mentee, peer, project), what they offer (skills, experience).
* Public profile view for other users.
3. **Events Management:**
* View all upcoming events (`/events`).
* Create new events (`/events/new`) with title, description, location (physical/online), date/time, max attendees.
* View single event details (`/events/[id]`) with option to RSVP.
* List of attendees for an event.
* Organizers can edit/delete their own events.
4. **Peer Group Management:**
* View all available peer groups (`/groups`).
* Create new groups (`/groups/new`) with name, description, primary topic.
* View single group details (`/groups/[id]`) with option to join/leave.
* Group member list and activity feed (simple messages).
* Group creators can manage group settings and members.
5. **Project Board:**
* Browse available side projects (`/projects`).
* Create new projects (`/projects/new`) with title, description, required skills, estimated duration, compensation type (unpaid, paid, equity).
* View single project details (`/projects/[id]`) with option to apply.
* Project creators can view and manage applications.
6. **Mentorship Module:**
* Browse profiles of users offering mentorship (`/mentors`).
* Request mentorship from a specific user (`/mentors/[id]`) with an introductory message.
* Manage mentorship requests (accept/reject) and track active mentorship relationships.
* Schedule basic 1-on-1 sessions within the platform (e.g., date, time, notes).
**Database Schema (using Drizzle ORM):**
* `users`: id (PK), name, email (unique), password_hash, role (user/admin), bio, skills (jsonb array), interests (jsonb array), location, is_extrovert (boolean), looking_for (jsonb array), offers (jsonb array), created_at, updated_at.
* `events`: id (PK), title, description, location, event_date, organizer_id (FK to users), max_attendees, created_at, updated_at.
* `event_attendees`: event_id (FK), user_id (FK), status (enum: 'rsvp', 'attended'), PRIMARY KEY (event_id, user_id).
* `groups`: id (PK), name, description, topic, creator_id (FK to users), created_at, updated_at.
* `group_members`: group_id (FK), user_id (FK), role (enum: 'admin', 'member'), PRIMARY KEY (group_id, user_id).
* `projects`: id (PK), title, description, creator_id (FK to users), required_skills (jsonb array), duration_months, compensation_type (enum: 'unpaid', 'paid', 'equity'), status (enum: 'open', 'closed'), created_at, updated_at.
* `project_applications`: id (PK), project_id (FK), applicant_id (FK to users), message, status (enum: 'pending', 'accepted', 'rejected'), created_at.
* `mentorship_requests`: id (PK), mentor_id (FK to users), mentee_id (FK to users), message, status (enum: 'pending', 'accepted', 'rejected'), created_at.
* `mentor_sessions`: id (PK), mentorship_request_id (FK), session_date, session_time, location_type (enum: 'online', 'in-person'), notes, created_at.
**API Routes:**
Implement necessary API routes using Next.js API Routes (within `app/api`) for all CRUD operations, ensuring proper authentication and authorization checks. For example:
* `/api/users/[id]` (GET, PUT, DELETE)
* `/api/events` (GET, POST)
* `/api/events/[id]` (GET, PUT, DELETE)
* `/api/events/[id]/rsvp` (POST)
* `/api/groups` (GET, POST)
* `/api/groups/[id]/join` (POST)
* `/api/projects` (GET, POST)
* `/api/projects/[id]/apply` (POST)
* `/api/mentorship/request` (POST)
**Styling:** Utilize Tailwind CSS for all styling.
**Data Flow:** Ensure proper data fetching and mutations using React Server Components/Actions where appropriate, and client-side fetches for interactive components.
**Error Handling:** Implement basic error handling and loading states for user feedback.
**Environment Variables:** Configure necessary environment variables for database connection, NextAuth secret, etc.
The AI should provide a fully functional MVP with the specified technologies and database schema, ready for deployment. Focus on clean code, modular structure, and adherence to best practices for a Next.js App Router project.