This project is a modern web application built with React and TypeScript, managed through npm. Follow the steps below to set up your development environment and start building.
Before you begin, ensure you have the following installed on your system:
- Node.js (version 16 or higher)
- npm (comes with Node.js)
- Git for version control
Choose your preferred method to clone the repository:
# SSH (recommended if you have SSH keys set up)
git clone git@github.com:pphatdev/v4.git && cd ./v4
# HTTPS (works without SSH setup)
git clone https://github.com/pphatdev/v4.git && cd ./v4Install dependencies and launch the development server:
cp .env.example .env && npm install && npm run devThis will:
- Install all required packages and dependencies
- Start the development server with hot-reload
- Open your application in the browser (typically at
http://localhost:3000)
When you're ready to deploy:
npm run build && npm startThis command will:
- Create an optimized production build
- Start the production server
This project includes Docker configuration for containerized deployment with nginx as a reverse proxy.
- Docker (version 20.10 or higher)
- Docker Compose (version 2.0 or higher)
- Copy the environment file:
cp .env.example .env- Build and start the containers:
docker compose up -d --build- Access the application at
http://v4.stackdev.cloud(ensure DNS is configured)
# Build and start containers
docker compose up -d --build
# View logs
docker compose logs -f
# Stop containers
docker compose down
# Rebuild and restart
docker compose up -d --build --force-recreate- Dockerfile: Multi-stage build for optimized Next.js production image
- docker-compose.yml: Orchestrates the Next.js app and nginx services
- nginx/conf.d/v4.stackdev.cloud.conf: nginx configuration with
server_name v4.stackdev.cloud
To enable HTTPS:
- Add your SSL certificates to
nginx/ssl/v4.stackdev.cloud/ - Uncomment the SSL configuration in
nginx/conf.d/v4.stackdev.cloud.conf - Restart the nginx container
💡 Quick Tip: The development server includes TypeScript type checking and React Fast Refresh for an improved developer experience.