A comprehensive web application for planning and managing trips, complete with expense tracking and weather forecasting.
Key Features • How To Run • Architecture • Backend • Frontend •
- Trip Planning: Create, manage and search trips with destinations, participants and date ranges
- Destination Management: Store and search destinations with descriptions, images and activities
- Expense Tracking: Track trip expenses by category with participant payment attribution (only backend)
- Weather Forecasting: Get destination weather forecasts for planned travel dates
Before you begin, ensure you have the following installed:
Get a API Key
If you want to test the Freestyle Task #2 weather api integration, you need to provide an api-key in the docker-compose.yml as WEATHER_API_KEY.
Please sign up for a free api-key at VisualCrossing API Sign-Up. You can copy your api-key if you are signed in at VisualCrossing API account page.
Note
The free api-key will be limited. To avoid being rate-limited, please do not select large date ranges for your destinations in trips.
Clone the repository and run the application using Docker Compose:
# Build and run the application using Docker Compose
docker-compose up --buildThe application consists of:
- Frontend: React application served with Nginx
- Backend: Node.js API server
- Database: PostgreSQL
The backend defines a OpenAPI specification for the API through annotations in the source code. I wrote a script to generate a openapispec.yml:
pnpm --filter="./backend" run generate:api-docsThe frontend uses the OpenAPI specification to generate TypeScript types for the API responses and requests. This can be done with the following command:
pnpm --filter="./frontend" run generate:apiYou can also directly use the OpenAPI spec in the Swagger UI at http://localhost:3000/api-docs to explore and test the API.
For explicit documentation of the backend, please refer to the backend README.
Once deployed, you can access the backend at:
- backend: http://localhost:3000/api
- backend swagger: http://localhost:3000/api-docs
For explicit documentation of the frontend, please refer to the frontend README.
Access the frontend at: http://localhost/