Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
24 commits
Select commit Hold shift + click to select a range
4834390
Setting up GitHub Classroom Feedback
github-classroom[bot] Sep 12, 2024
5b025b8
Create team.md
prayushik Sep 19, 2024
65f999a
Update team.md
roshnid08 Sep 19, 2024
c752c00
Update Team.md
roshnid08 Sep 19, 2024
9d33572
added a paragraph
jihocheon Sep 19, 2024
6485b1b
Update team.md
vignesh0122 Sep 19, 2024
788ce82
Introduction
dirghaj Sep 19, 2024
35dabb3
Added introduction about myself
anshulraj10 Sep 20, 2024
50af4b9
Merge pull request #2 from BUMETCS673/Lab1
anshulraj10 Sep 20, 2024
b14dd42
Updated README.md file
anshulraj10 Sep 26, 2024
2250a4e
Added required docs for iteration-0 submission
anshulraj10 Sep 27, 2024
034c7e5
Merge pull request #3 from BUMETCS673/iteration-0
anshulraj10 Sep 27, 2024
50ddaa6
Added starter code and dockerfiles for the project
anshulraj10 Oct 3, 2024
9a1bed3
Added dokcerfiles
anshulraj10 Oct 3, 2024
c70be9e
Updated the starter-code with new docker files, react template and Je…
anshulraj10 Oct 17, 2024
1c52dae
Updated Jenkinsfile
anshulraj10 Oct 17, 2024
216be4e
Merge pull request #4 from BUMETCS673/starter-code
anshulraj10 Oct 17, 2024
930a192
Fixed jenkinsfile
anshulraj10 Oct 17, 2024
c39dbd0
Fixed Jenkinsfile to use correct dockerfile
anshulraj10 Oct 17, 2024
2146d38
Fixed jenkinsfile
anshulraj10 Oct 17, 2024
2bfbdad
Fixed docker compose down command
anshulraj10 Oct 17, 2024
6a9a1db
Changed port for frontend as it was clashing with jenkins server ports
anshulraj10 Oct 17, 2024
5ef68ce
Added documentations for iteration-1 release
anshulraj10 Oct 18, 2024
b5df3b8
Merge pull request #6 from BUMETCS673/iteration-1
anshulraj10 Oct 18, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
39 changes: 39 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
# Node.js / Angular
node_modules/
dist/
npm-debug.log
yarn-error.log
package-lock.json
yarn.lock
coverage/
src/**/*.spec.ts
*.tsbuildinfo

# Python / Flask
__pycache__/
*.pyc
*.pyo
*.pyd
*.db
*.sqlite3
*.log
*.env
instance/
venv/
*.egg-info/
*.egg
*.whl
.Python
*.py[cod]

# System Files
.DS_Store
Thumbs.db
ehthumbs.db
*.swp
*.swo

# IDE Files
.vscode/
.idea/
*.iml
62 changes: 60 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,2 +1,60 @@
# GroupProjectTemplate
Please make sure to modify this readme file as well as the "about" property of the project!
# MenuMatch

## Overview
This project focuses on building a restaurant review platform tailored for users with specific dietary needs such as vegan, gluten-free, and halal. The platform aims to make it easier for users to find suitable dining options based on their dietary preferences. Users can filter restaurant reviews according to their needs and view curated ratings for specific food categories, ensuring they choose the best dining option.

## Motivation
The idea for this project emerged from the challenges faced by international students and others with dietary restrictions, particularly in Boston. General restaurant reviews often lack specific information about how suitable a restaurant is for particular diets. This platform addresses that gap, offering users a way to filter restaurants and reviews to meet their unique requirements.

### JIRA Link: https://menumatch.atlassian.net/browse/MENUMATCH
## Features
### Essential Features
- **Food Type Selection**: Users can filter restaurants based on dietary preferences such as vegan, gluten-free, and halal.
- **Overall Restaurant Review**: Users can view the overall rating of a restaurant.
- **Curated Reviews Based on User Choices**: Reviews will be tailored to the user's selected dietary preference.
- **User-Submitted Reviews**: Users can submit reviews for specific food types.
- **Mobile & Web Accessibility**: The platform is accessible on both web and mobile devices.
- **User Registration & Profile Management**: Users can sign up, log in, and manage their profile.

### Desirable Features
- **User Nationality Input**: Users can add their nationality to help others with similar taste preferences find relevant reviews.

### Optional Features
- **Food Flavor Descriptions**: Users can describe the flavors of dishes (e.g., sweet, spicy, savory).
- **Food Photo Uploads**: Users can upload photos of the food they ordered.

## Non-functional Requirements
- **Security & Privacy**: Data encryption via HTTPS to ensure user privacy and secure communication.
- **Performance**: The platform can handle up to 10,000 concurrent users, with search results returning within 2-3 seconds.
- **Scalability**: Horizontal and vertical scaling for future growth.
- **Availability**: Minimum 99.9% uptime with proper notifications for scheduled maintenance.
- **Usability**: Intuitive and responsive design for both web and mobile versions.
- **Compliance**: Adherence to GDPR for users in the European Union.

## Technology Stack
- **Frontend**: Angular
- **Backend**: Flask
- **Database**: MongoDB / MySQL (TBD)
- **Version Control**: Git/GitHub
- **CI/CD**: Jenkins
- **Hosting**: AWS (EC2)
- **Containerization**: Docker
- **Task Management**: JIRA

## Installation & Setup
### Prerequisites
- Python 3.x
- Docker (optional for containerization)
- TODO: Add further Prerequisites as decided

### TODO: Add steps to setup the project


### Branching Strategy
We follow the **GitHub Flow** strategy:
- Create feature branches from the `main` branch.
- Submit a pull request after peer review and passing tests.
- The main branch is always deployable.

## License
This project is licensed under the MIT License.
103 changes: 103 additions & 0 deletions code/Jenkinsfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,103 @@
pipeline {
agent {
label 'develop'
}

environment {
DOCKER_COMPOSE_DEV = 'docker-compose.dev.yml'
DOCKER_COMPOSE_PROD = 'docker-compose.prod.yml'
}

stages {
stage('Build Backend') {
steps {
script {
// Build the backend container (Flask)
sh '''
cd code/server
docker build -f Dockerfile.dev -t menumatch-backend .
'''
}
}
}

stage('Build Frontend') {
steps {
script {
// Build the frontend container (React)
sh '''
cd code/menumatch
docker build -f Dockerfile.dev -t menumatch-frontend .
'''
}
}
}

stage('Run Tests') {
parallel {
stage('Backend Tests') {
steps {
// Run tests for backend (if any)
sh '''
cd code/server
echo "Backend Tests to be run here"
'''
}
}

stage('Frontend Tests') {
steps {
// Run tests for frontend (if any)
sh '''
cd code/menumatch
echo 'Frontend Tests to be run here'
'''
}
}
}
}

stage('Deploy to Development') {
steps {
script {
// Deploy the app to development environment
sh '''
cd code
docker-compose -f $DOCKER_COMPOSE_DEV up -d
'''
}
}
}

stage('Build and Deploy to Production') {
agent {
label 'production'
}
when {
branch 'main'
}
steps {
script {
// Build and deploy for production
sh '''
cd code
docker-compose -f $DOCKER_COMPOSE_PROD up -d --build
'''
}
}
}
}

post {
always {
// Clean up Docker containers and networks
sh 'cd code && docker-compose down'
}
success {
echo 'Pipeline succeeded!'
}
failure {
echo 'Pipeline failed.'
}
}
}
130 changes: 129 additions & 1 deletion code/Readme.md
Original file line number Diff line number Diff line change
@@ -1 +1,129 @@
This folder contains all source code and test code.

# MenuMatch | Code

## Overview

**MenuMatch** is a restaurant review platform designed specifically for users with special dietary needs. It allows users to filter restaurant reviews based on their dietary preferences (e.g., vegan, halal, gluten-free), making it easier to find dining options that fit their requirements.

The project consists of two components:
1. **Backend (Flask)**: This handles the API and business logic.
2. **Frontend (React)**: This is the user interface for the platform.

## Prerequisites

Before running the project, make sure you have the following installed:

- [Node.js](https://nodejs.org/) (for running the React frontend locally)
- [Python 3.x](https://www.python.org/) (for running the Flask backend locally)
- [Docker](https://www.docker.com/) (for running the project using Docker)
- [Docker Compose](https://docs.docker.com/compose/) (to orchestrate multi-container Docker applications)

---

## Running the Project Using Docker

You can run the entire project (both frontend and backend) using Docker in two different environments: **development** and **production**.

### 1. Development Environment

In the development environment, the backend Flask app runs in development mode, and the React app runs with hot-reloading.

#### Steps:

1. Build and start the containers:

```bash
docker-compose -f docker-compose.dev.yml up --build
```
2. The services should now be accessible at:

- **Frontend (React)**: http://localhost:8000
- **Backend (Flask)**: http://localhost:8080
#### Notes:

- Any changes you make to the source code will be reflected immediately due to the volume mappings in the development setup.

### 2. Production Environment

In the production environment, the Flask app is served via `gunicorn`, and the React app is built and served using `nginx`.

#### Steps:

1. Build and start the containers in detached mode:
```bash
docker-compose -f docker-compose.prod.yml up --build -d
```

2. The services should now be accessible at:

- **Frontend (React)**: http://localhost:80
- **Backend (Flask)**: http://localhost:5000

#### Notes:

- In production mode, the frontend is optimized and served by Nginx.
-----
## Running the Project Locally

If you prefer to run the project locally without Docker, you can run the backend and frontend independently. Below are the steps for both.

### 1. Backend (Flask) Setup

#### Steps:

1. Navigate to the `server` directory:
```bash
cd server
```
2. - Create a virtual environment (optional but recommended):
```bash
python3 -m venv venv
source venv/bin/activate
```

- Install dependencies:
```bash
pip install -r requirements.txt
```

- Run the Flask app:
```bash
python run.py
```

- The backend should now be running at: http://localhost:8000

### 2. Frontend (React) Setup

#### Steps:

1. Navigate to the `menumatch` directory:
```bash
cd menumatch
```

2. Install dependencies:
```bash
npm install
```

3. Start the React development server:
```bash
npm start
```

4. The frontend should now be running at: http://localhost:8080

## Docker Tips

### Building and Rebuilding Containers

- To **build** or **rebuild** a Docker container, use the following command:
```bash
docker-compose up --build
```

- To **stop** and **remove** containers, networks, and volumes:
```bash
docker-compose down
```
23 changes: 23 additions & 0 deletions code/docker-compose.dev.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
version: '3'
services:
backend:
build:
context: ./server
dockerfile: Dockerfile.dev
ports:
- "8000:5000"
volumes:
- ./server:/app
environment:
- FLASK_ENV=development

frontend:
build:
context: ./menumatch
dockerfile: Dockerfile.dev
ports:
- "3000:3000"
volumes:
- ./menumatch:/app
environment:
- CHOKIDAR_USEPOLLING=true
17 changes: 17 additions & 0 deletions code/docker-compose.prod.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
version: '3'
services:
backend:
build:
context: ./server
dockerfile: Dockerfile.prod
ports:
- "8000:5000"
environment:
- FLASK_ENV=production

frontend:
build:
context: ./menumatch
dockerfile: Dockerfile.prod
ports:
- "8080:80"
Loading
Loading