MealMap is a recipe discovery app designed to help you find delicious recipes based on your preferences and ingredients.
Current development roadmap here.
MealMap allows users to search, filter, and discover a wide variety of recipes. Users can also save their favorite recipes and create a personalized meal plan. The app leverages Fastify for the backend, Prisma as the ORM, and MongoDB for data storage, with TypeScript ensuring robust and maintainable code.
- Search for recipes by ingredients, cuisine, and dietary preferences
- Save and manage favorite recipes
- Create and customize meal plans
- User authentication and profile management
- Responsive design for a seamless experience across devices
- Frontend: Next.js, TypeScript, Tailwind CSS
- Backend: Fastify, TypeScript, Jest
- Database: PostgreSQL, MongoDB
- ORM: Prisma, Mongoose
- Others: Node.js, pnpm, Docker, GitHub Actions
| Field | Type | Description |
|---|---|---|
| id | String | Unique identifier |
| username | String | User's name |
| String | User's email address | |
| password | String | User's password (hashed) |
| favorites | Array of Recipe IDs | List of user's favorite recipes |
| mealPlans | Array of Meal Plan IDs | List of user's meal plans |
| Field | Type | Description |
|---|---|---|
| id | String | Unique identifier |
| name | String | Name of the recipe |
| ingredients | Array of Strings | List of ingredients |
| instructions | String | Step-by-step instructions |
| cuisine | String | Cuisine type |
| dietaryPreferences | Array of Strings | Dietary preferences (e.g., vegan, gluten-free) |
| Field | Type | Description |
|---|---|---|
| id | String | Unique identifier |
| userId | String | ID of the user who created the meal plan |
| name | String | Name of the meal plan |
| recipes | Array of Recipe IDs | List of recipes in the meal plan |
| Method | Endpoint | Description |
|---|---|---|
| POST | /api/users | Register a new user |
| POST | /api/users/login | User login |
| GET | /api/users/:id | Get user details |
| PUT | /api/users/:id | Update user details |
| DELETE | /api/users/:id | Delete user account |
| Method | Endpoint | Description |
|---|---|---|
| GET | /api/recipes | Get all recipes |
| GET | /api/recipes/:id | Get recipe by ID |
| POST | /api/recipes | Add a new recipe |
| PUT | /api/recipes/:id | Update a recipe |
| DELETE | /api/recipes/:id | Delete a recipe |
| Method | Endpoint | Description |
|---|---|---|
| GET | /api/mealplans | Get all meal plans |
| GET | /api/mealplans/:id | Get meal plan by ID |
| POST | /api/mealplans | Create a new meal plan |
| PUT | /api/mealplans/:id | Update a meal plan |
| DELETE | /api/mealplans/:id | Delete a meal plan |
-
Clone the repository:
git clone https://github.com/sreeharsha-rav/typescript-projects/tree/main/meal-map cd meal-map -
Install the dependencies:
pnpm install
-
Add environment variables to a
.envfile:PORT=3000 DATABASE_URL=postgres://user:password@host:port/db
-
Generate Prisma client:
pnpm prisma generate
-
Run database migrations:
pnpm prisma migrate dev
-
Seed the database with initial data:
pnpm seed
-
Start the development server:
pnpm dev
-
To build and start the production server:
pnpm build pnpm start
Run the unit tests:
pnpm testBuild the Docker image:
docker build -t meal-map-api .Configure the environment variables (PORT, HOST, DATABASE_URL) in docker-compose.yml and run the container:
docker-compose upAccess the API at http://localhost:3000.
View all the api usage examples and test cases here: Postman.
This project was realized with the help of the following resources: