Skip to content

bounswe/bounswe2025group9

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

Visit our website πŸ‘‡

Nutrihub Logo

Or watch our website and mobile demos.


About Us

We are Computer Engineering students studying at Boğaziçi University.
We are taking the course CmpE 352: Introduction to Software Engineering together.
To learn more about the team and the project, visit our Wiki Page.

bounswe2025group9

Installation

Project Overview

NutriHub is a comprehensive platform that helps users discover and manage affordable and healthy food options. The project consists of three main components:

  • Frontend (React + TypeScript)
  • Backend (Django)
  • Mobile App (React Native)

Prerequisites

  • Docker and Docker Compose
  • Node.js (v20 or later)
  • Python (3.11 or later)
  • MySQL (8.0)

Quick Start with Docker

The easiest way to run the entire project is using Docker Compose:

  1. Clone the repository:
git clone https://github.com/bounswe/bounswe2025group9.git
cd bounswe2025group9
  1. Start all services:
docker-compose up --build -d

This will start:

FatSecret API Integration

To use the food data features, you need to set up FatSecret API credentials:

  1. Go to FatSecret Platform API
  2. Create a new account to get your API credentials
  3. Add the following environment variables to your environment variables in the backend directory:
    FATSECRET_CONSUMER_KEY=your_consumer_key
    FATSECRET_CONSUMER_SECRET=your_consumer_secret
    

Note: The API credentials are required for:

  • Food search functionality
  • Nutritional information retrieval
  • Food database integration

Manual Setup

Backend Setup

  1. Navigate to the backend directory:
cd backend
  1. Create and activate a virtual environment:
python -m venv venv
source venv/bin/activate  # On Windows: venv\Scripts\activate
  1. Install dependencies:
pip install -r requirements-dev.txt
  1. Set up environment variables:
source setup.sh  # On Windows: .\setup.sh
  1. Run migrations:
python manage.py makemigrations
python manage.py migrate
  1. Start the development server:
python manage.py runserver 9000

Frontend Setup

  1. Navigate to the frontend directory:
cd frontend
  1. Install dependencies:
npm install
  1. Start the development server:
npm start

Mobile App Setup

  1. Navigate to the mobile directory:
cd mobile/nutrihub
  1. Install dependencies:
npm install
  1. Start the development server:
npm run dev

Database Setup

The project uses MySQL as the database. When running with Docker, the database is automatically configured. For manual setup:

  1. Create a MySQL database named mydb
  2. Create a user with the following credentials:
    • Username: django
    • Password: djangopass

Running Tests

Backend Tests

cd backend
python manage.py test

Frontend Tests

cd frontend
npm test

Mobile App Tests

cd mobile/nutrihub
npm test

Development Tools

Code Formatting

The project uses Black for Python code formatting:

cd backend
black .

Pre-commit Hooks

Pre-commit hooks are set up for the backend:

cd backend
pre-commit install

Project Structure

bounswe2025group9/
β”œβ”€β”€ backend/           # Django backend
β”œβ”€β”€ frontend/         # React frontend
β”œβ”€β”€ mobile/           # React Native mobile app
└── docker-compose.yml

Contributing

  1. Create a new branch for your feature
  2. Make your changes
  3. Run tests
  4. Submit a pull request

License

This project is part of the CmpE 352 course at Boğaziçi University.