Next.js-based React application for the Epitrello project management platform.
| Component | Technology |
|---|---|
| Framework | Next.js 16 (App Router) |
| Language | TypeScript |
| Styling | Tailwind CSS |
| Package Manager | pnpm |
- Node.js 20 or higher
- pnpm (package manager)
- Backend API running (see backend README)
pnpm installCreate a .env.local file in the frontend directory:
NEXT_PUBLIC_API_URL=http://localhost:4000/graphqlConfiguration Scenarios:
If your backend is running in Docker and frontend is local:
-
Backend Docker Configuration (in your
.envfile at project root):PORT=4000 FRONTEND_URL=http://localhost:3000
-
Frontend Local Configuration (in
frontend/.env.local):NEXT_PUBLIC_API_URL=http://localhost:4000/graphql
Important: Use
localhost(notpostgresor container name) because you're accessing the backend from outside Docker. The port mapping${PORT}:4000indocker-compose.ymlexposes the backend onlocalhost:4000. -
Start the backend in Docker:
# From project root docker-compose up -d backend -
Verify backend is accessible:
curl http://localhost:4000/graphql
If both are running locally (not in Docker):
-
Frontend Configuration (in
frontend/.env.local):NEXT_PUBLIC_API_URL=http://localhost:4000/graphql
-
Backend Configuration (in
backend/.env):PORT=4000 FRONTEND_URL=http://localhost:3000
pnpm devOpen http://localhost:3000 with your browser to see the result.
The page auto-updates as you edit the files.
pnpm build
pnpm start| Command | Description |
|---|---|
pnpm dev |
Start development server with hot-reload |
pnpm build |
Build the application for production |
pnpm start |
Start the production server |
pnpm lint |
Run ESLint to check code quality |
frontend/
├── app/ # Next.js App Router pages and layouts
├── public/ # Static assets
├── .env.local # Environment variables (not committed)
└── package.json # Dependencies and scripts
If port 3000 is already in use, you can change it:
pnpm dev -- -p 3001-
Verify backend is running:
curl http://localhost:4000/graphql
-
Check environment variables:
- Frontend:
NEXT_PUBLIC_API_URLinfrontend/.env.localshould behttp://localhost:4000/graphql - Backend (Docker):
FRONTEND_URLin root.envshould behttp://localhost:3000 - Backend (Local):
FRONTEND_URLinbackend/.envshould behttp://localhost:3000
- Frontend:
-
CORS errors:
- If you see CORS errors, verify that
FRONTEND_URLin the backend matches your frontend URL - For Docker backend: Check the
FRONTEND_URLvariable in your root.envfile - The backend CORS is configured to accept requests from
FRONTEND_URL(default:http://localhost:3000)
- If you see CORS errors, verify that
-
Backend in Docker not accessible:
- Check if the port is mapped correctly:
docker psshould show0.0.0.0:4000->4000/tcp - Verify the backend container is running:
docker-compose ps - Check backend logs:
docker-compose logs backend
- Check if the port is mapped correctly:
frontend/
├── app/ # Next.js App Router pages and layouts
│ ├── layout.tsx # Root layout
│ ├── page.tsx # Home page
│ └── globals.css # Global styles
├── public/ # Static assets
├── .env.local # Environment variables (not committed)
└── package.json # Dependencies and scripts
For production deployment, see the main README.md and DOCKER.md for Docker-based deployment instructions.