A web application for visualizing sunrise and sunset times across different locations worldwide.
- Sunrise/sunset calendar with daylight visualization
- City search with timezone support
- Solstice handling
- Responsive design
- Print support
- Clean UI
The application consists of two main parts:
- REST API built with Express
- City search functionality using all-the-cities database
- Timezone handling with geo-tz
- Sun calculations with suncalc
- Built with Next.js and React
- Tailwind CSS for styling
- Responsive grid layout
- Print-friendly design
- Node.js (v18 or newer)
- npm
s1. Navigate to backend directory:
bash
cd backend
- Install dependencies:
bash
npm install
- Start the development server:
bash
npm run dev
The frontend will start on http://localhost:3000
No environment variables needed by default. Server runs on port 4000.
Create a .env.local
file in the frontend directory:
NEXT_PUBLIC_API_URL=http://localhost:4000
The application uses TypeScript for both frontend and backend. Key files:
src/index.ts
- Main server filesrc/routes/cities.ts
- City search endpoints
src/components/Calendar.tsx
- Main calendar componentsrc/components/CommandPanel.tsx
- Control panelsrc/components/CitySearch.tsx
- City search component
bash
npm run build
npm start
bash
npm run build
npm start