A full-stack web application built with Node.js (Nest.js) for the backend and React (Next.js) for the frontend, allowing users to browse and search recipes from TheMealDB API.
- Browse all available recipes
- Filter recipes by ingredient, country, or category
- View detailed recipe information including ingredients and instructions
- Responsive design with modern UI components using Shadcn UI
- Server-side rendering for better SEO and performance
The project is separated into two main folders:
backend/: A Nest.js application serving as the APIfrontend/: A Next.js application providing the user interface
- Node.js (v18 or later)
- npm (v8 or later)
- Docker and Docker Compose (optional, for containerized setup)
-
Navigate to the backend directory:
cd backend -
Install dependencies:
npm install
-
Create a
.envfile in the backend directory with the following content:PORT=3001 MEAL_DB_API_URL=https://www.themealdb.com/api/json/v1/1 FRONTEND_URL=http://localhost:3000 -
Start the development server:
npm run start:dev
The backend API will be available at http://localhost:3001.
-
Navigate to the frontend directory:
cd frontend -
Install dependencies:
npm install
-
Create a
.envfile in the frontend directory with the following content:NEXT_PUBLIC_API_URL=http://localhost:3001/api -
Start the development server:
npm run dev
The frontend application will be available at http://localhost:3000.
You can also run the application using Docker:
-
Make sure you have Docker and Docker Compose installed on your system.
-
From the root directory of the project, run:
docker-compose up
This will start both the backend and frontend services in containers:
- Backend will be available at
http://localhost:3001 - Frontend will be available at
http://localhost:3000
To stop the containers:
docker-compose downGET /api/recipes: Get all recipes or filter by ingredient, country, or category- Query parameters:
ingredient: Filter recipes by ingredientcountry: Filter recipes by country/cuisinecategory: Filter recipes by category
- Query parameters:
GET /api/recipes/:id: Get detailed information about a specific recipe
- Nest.js: Progressive Node.js framework
- TypeScript: Strongly typed JavaScript
- Axios: HTTP client for API requests
- Next.js: React framework with server-side rendering
- React: JavaScript library for building user interfaces
- TypeScript: Strongly typed JavaScript
- Shadcn UI: Beautifully designed components
- Tailwind CSS: Utility-first CSS framework
- ESLint: Code linting
- Prettier: Code formatting