A modern React/Next.js frontend application for Scholar AI.
- Node.js 18+
- npm, yarn, or pnpm
- Docker (optional, for containerized deployment)
-
Clone and install dependencies
git clone <repository-url> cd Frontend npm install
-
Environment Setup
cp env.example .env
Configure your environment variables in
.env.local:NEXT_PUBLIC_DEV_API_URL- Development API URLNEXT_PUBLIC_GOOGLE_CLIENT_ID- Google OAuth client IDNEXT_PUBLIC_GITHUB_CLIENT_ID- GitHub OAuth client ID- B2 storage credentials (for PDF uploads)
-
Run the development server
npm run dev
The application will be available at
http://localhost:3000
The project includes a comprehensive Docker management script:
# Build and start the application
./scripts/docker.sh up
# View logs
./scripts/docker.sh logs
# Stop the application
./scripts/docker.sh stop
# Restart the application
./scripts/docker.sh restart
# Clean up containers and images
./scripts/docker.sh clean# Build the image
docker compose -f docker/docker-compose.yml build
# Start the application
docker compose -f docker/docker-compose.yml up -d
# Stop the application
docker compose -f docker/docker-compose.yml down./scripts/run_tests.sh# Unit tests only
./scripts/run_tests.sh unit
# End-to-end tests only
./scripts/run_tests.sh e2e
# E2E tests with UI
./scripts/run_tests.sh ui# Unit tests
npx jest --config tests/jest.config.ts
# E2E tests
npx playwright test --config tests/e2e/playwright.config.tsThe application supports multiple environments:
dev- Development environmentprod- Production environmentdocker- Docker containerized environment
Set NEXT_PUBLIC_ENV and ENV in your .env.local file to match your deployment environment.
npm run dev- Start development servernpm run build- Build for productionnpm run start- Start production servernpm run lint- Run ESLintnpm run type-check- Run TypeScript type checking
/app- Next.js app router pages and API routes/components- Reusable React components/lib- Utility functions and API clients/tests- Unit and E2E tests/docker- Docker configuration files/scripts- Build and deployment scripts