A Next.js TypeScript frontend application for the AWS ECS three-tier architecture.
- Next.js 15 with App Router
- TypeScript support
- Tailwind CSS for styling
- Docker containerization
- Health check endpoints
- Backend API integration
- AWS ECS deployment ready
- Node.js 20+
- npm or yarn
- Docker (optional)
- Clone the repository:
git clone git@github.com:sabiut/aws-ecs-frontend-react.git
cd aws-ecs-frontend-react
- Install dependencies:
npm install
- Set up environment variables:
# Create .env.local file
BACKEND_URL=http://localhost:8000
- Run development server:
npm run dev
The application will be available at http://localhost:3000
- Build and run with Docker:
docker build -t nextjs-frontend .
docker run -p 8080:8080 nextjs-frontend
GET /api/health
- Health check endpoint for load balancer- Frontend connects to Django backend at
/health/
and/api/
endpoints
BACKEND_URL
: URL of the Django backend API (default: http://localhost:8000)
The frontend automatically checks the backend status and displays:
- Connection status (connected/disconnected/error)
- Backend URL configuration
- Real-time status updates
- Standalone output for Docker deployment
- Health check endpoint for ECS
- Production-optimized build
This application is configured for deployment to AWS ECS using the CI/CD pipeline. The GitHub Actions workflow will:
- Run tests and linting
- Build optimized production bundle
- Build Docker image
- Push to Amazon ECR
- Deploy to ECS Fargate
- Perform health checks
npm run dev
- Start development server with Turbopacknpm run build
- Build production applicationnpm run start
- Start production servernpm run lint
- Run ESLint
The application follows Next.js App Router patterns:
src/app/page.tsx
- Main page componentsrc/app/api/health/route.ts
- Health check API routenext.config.ts
- Next.js configurationDockerfile
- Container configuration
- Create a feature branch
- Make your changes
- Test locally
- Submit a pull request
MIT License