
- Node.js 18+
- pnpm (v9.12.3 or newer)
- MongoDB instance
- Clone the repository
git clone <repository-url>
cd aiha-app
- Install dependencies
pnpm install
- Set up environment variables
cp .env.example .env
For Maintainers Contact Team for credentials(env variables)
Fill in the following variables in .env
:
AUTH_SECRET
- Generate usingnpx auth secret
AUTH_GITHUB_ID
- Your GitHub Client IDAUTH_GITHUB_SECRET
- Your GitHub Client SecretMONGODB_URI
- Your MongoDB connection stringAZURE_STORAGE_CONNECTION_STRING
- Your Azure Blob Storage Connection StringIMAGES_BASE_URL
- Your Image Directory Azure Blob Storage URLAZURE_RESOURCE_NAME
- Your Azure OpenAI Resource NameAZURE_API_KEY
- Your Azure OpenAI API Key- Other auth provider credentials as needed
- Set up Atlas Vector Search Index
node create-vector-index.js
- Run the development server
pnpm dev
The app will be available at http://localhost:3000
- Use pnpm for package management
- Use
pnpm format:check
andpnpm format:write
to check and apply formatting before committing
MongoDB schemas are defined in src/server/models/
. Example schema:
Project
(src/server/models/project.ts
)
- Uses NextAuth.js with JWT strategy
- Currently supports HKU email domains (
@connect.hku.hk
,@hku.hk
,@cs.hku.hk
) - Configuration in
src/server/auth/
├── src/
│ ├── app/ # Next.js 13+ App Router
│ ├── server/ # Server-side code
│ │ ├── actions/ # Server actions
│ │ ├── auth/ # Auth configuration
│ │ ├── models/ # MongoDB schemas
│ ├── styles/ # Global styles
├── public/ # Static assets
pnpm dev
- Start development serverpnpm build
- Build for productionpnpm start
- Start production serverpnpm preview
- Preview production build locally
This project uses the T3 Stack, which includes:
- Next.js - React framework for production
- NextAuth.js - Authentication system
- MongoDB - Database (with Mongoose ODM)
- Mongoose - MongoDB ODM
- Tailwind CSS - Utility-first CSS framework
- TypeScript - Type safety