diff --git a/financial-tracker/analytics-service/Dockerfile b/financial-tracker/analytics-service/Dockerfile index 46b134b197f35e75e0784bedbf94a8dd124693b1..4f670aa8e5d304c3c28a86e1c3c741fdd686d9be 100644 --- a/financial-tracker/analytics-service/Dockerfile +++ b/financial-tracker/analytics-service/Dockerfile @@ -1 +1,16 @@ -ÿþ \ No newline at end of file +FROM python:3.12 + +WORKDIR /app + +# Copy requirements.txt from the root context (now accessible) +COPY requirements.txt . + +# Install dependencies globally +RUN pip install --no-cache-dir -r requirements.txt + +# Copy only the current service's code +COPY ./analytics-service/app /app + +EXPOSE 5004 + +CMD ["python", "app.py"] diff --git a/financial-tracker/analytics-service/app.py b/financial-tracker/analytics-service/app/app.py similarity index 100% rename from financial-tracker/analytics-service/app.py rename to financial-tracker/analytics-service/app/app.py diff --git a/financial-tracker/api-gateway/Dockerfile b/financial-tracker/api-gateway/Dockerfile index 46b134b197f35e75e0784bedbf94a8dd124693b1..36bf6f5936bf23fa9525f7d6c0a5cdf872022f59 100644 --- a/financial-tracker/api-gateway/Dockerfile +++ b/financial-tracker/api-gateway/Dockerfile @@ -1 +1,18 @@ -ÿþ \ No newline at end of file +FROM python:3.12 + +WORKDIR /app + +# Copy requirements.txt from the root directory +COPY requirements.txt . + +# Install dependencies globally (no need for venv inside Docker) +RUN pip install --no-cache-dir -r requirements.txt + +# Copy only the necessary files +COPY ./api-gateway/app /app + +# Expose API Gateway port +EXPOSE 8000 + +# Run the API Gateway +CMD ["python", "app.py"] diff --git a/financial-tracker/api-gateway/app.py b/financial-tracker/api-gateway/app/app.py similarity index 100% rename from financial-tracker/api-gateway/app.py rename to financial-tracker/api-gateway/app/app.py diff --git a/financial-tracker/budget-service/Dockerfile b/financial-tracker/budget-service/Dockerfile index 46b134b197f35e75e0784bedbf94a8dd124693b1..27fbb9ddde8306a386d7a79ee4b59d802d071ff1 100644 --- a/financial-tracker/budget-service/Dockerfile +++ b/financial-tracker/budget-service/Dockerfile @@ -1 +1,16 @@ -ÿþ \ No newline at end of file +FROM python:3.12 + +WORKDIR /app + +# Copy requirements.txt from the root context (now accessible) +COPY requirements.txt . + +# Install dependencies globally +RUN pip install --no-cache-dir -r requirements.txt + +# Copy only the current service's code +COPY ./budget-service/app /app + +EXPOSE 5003 + +CMD ["python", "app.py"] diff --git a/financial-tracker/budget-service/app.py b/financial-tracker/budget-service/app.py deleted file mode 100644 index 4a88b738dd6db98053b135b36645d060cc689f14..0000000000000000000000000000000000000000 Binary files a/financial-tracker/budget-service/app.py and /dev/null differ diff --git a/financial-tracker/budget-service/app/app.py b/financial-tracker/budget-service/app/app.py new file mode 100644 index 0000000000000000000000000000000000000000..94dd4d9890fdafbaecea6a295c0ab7cf5a9a6f8d --- /dev/null +++ b/financial-tracker/budget-service/app/app.py @@ -0,0 +1,10 @@ +from flask import Flask, jsonify, request + +app = Flask(__name__) + +@app.route('/budgets', methods=['GET']) +def get_budgets(): + return jsonify({"message": "Budget service active"}), 200 + +if __name__ == '__main__': + app.run(host='0.0.0.0', port=5003) diff --git a/financial-tracker/docker-compose.yml b/financial-tracker/docker-compose.yml index e69de29bb2d1d6434b8b29ae775ad8c2e48c5391..426342507ff593c7e22eb3a65c8406362929fd7f 100644 --- a/financial-tracker/docker-compose.yml +++ b/financial-tracker/docker-compose.yml @@ -0,0 +1,58 @@ +version: '3.8' + +services: + api-gateway: + build: + context: . + dockerfile: api-gateway/Dockerfile + ports: + - "8000:8000" + depends_on: + - user-service + - transaction-service + - budget-service + - analytics-service + - notification-service + + user-service: + build: + context: . + dockerfile: user-service/Dockerfile + ports: + - "5001:5001" + + transaction-service: + build: + context: . + dockerfile: transaction-service/Dockerfile + ports: + - "5002:5002" + + budget-service: + build: + context: . + dockerfile: budget-service/Dockerfile + ports: + - "5003:5003" + + analytics-service: + build: + context: . + dockerfile: analytics-service/Dockerfile + ports: + - "5004:5004" + + notification-service: + build: + context: . + dockerfile: notification-service/Dockerfile + ports: + - "5005:5005" + + frontend: + build: + context: ./frontend + ports: + - "3000:3000" + depends_on: + - api-gateway diff --git a/financial-tracker/frontend/Dockerfile b/financial-tracker/frontend/Dockerfile new file mode 100644 index 0000000000000000000000000000000000000000..d03806e1f93a5dc5586f3319ac9092c1a58fe987 --- /dev/null +++ b/financial-tracker/frontend/Dockerfile @@ -0,0 +1,17 @@ +# Use Node.js as base image +FROM node:20 + +WORKDIR /app + +# Copy package.json and install dependencies +COPY package*.json ./ +RUN npm install + +# Copy all frontend code +COPY . . + +# Expose frontend port +EXPOSE 3000 + +# Start the React app +CMD ["npm", "start"] diff --git a/financial-tracker/notification-service/Dockerfile b/financial-tracker/notification-service/Dockerfile index 46b134b197f35e75e0784bedbf94a8dd124693b1..1d43ede7c1d5a44c44b404909e2038bf324c2e8a 100644 --- a/financial-tracker/notification-service/Dockerfile +++ b/financial-tracker/notification-service/Dockerfile @@ -1 +1,16 @@ -ÿþ \ No newline at end of file +FROM python:3.12 + +WORKDIR /app + +# Copy requirements.txt from the root context (now accessible) +COPY requirements.txt . + +# Install dependencies globally +RUN pip install --no-cache-dir -r requirements.txt + +# Copy only the current service's code +COPY ./notification-service/app /app + +EXPOSE 5005 + +CMD ["python", "app.py"] diff --git a/financial-tracker/notification-service/app.py b/financial-tracker/notification-service/app.py deleted file mode 100644 index c7e58b182bc794d05bf7d63bd32ce986e39be171..0000000000000000000000000000000000000000 Binary files a/financial-tracker/notification-service/app.py and /dev/null differ diff --git a/financial-tracker/notification-service/app/app.py b/financial-tracker/notification-service/app/app.py new file mode 100644 index 0000000000000000000000000000000000000000..408c3178997ed8f681e96626fd0cf9158fbab997 --- /dev/null +++ b/financial-tracker/notification-service/app/app.py @@ -0,0 +1,10 @@ +from flask import Flask, jsonify + +app = Flask(__name__) + +@app.route('/notifications', methods=['GET']) +def get_notifications(): + return jsonify({"message": "Notification service active"}), 200 + +if __name__ == '__main__': + app.run(host='0.0.0.0', port=5005) diff --git a/financial-tracker/requirements.txt b/financial-tracker/requirements.txt new file mode 100644 index 0000000000000000000000000000000000000000..78ca6876d16a7bf17ae773396e67e2a24ce35302 Binary files /dev/null and b/financial-tracker/requirements.txt differ diff --git a/financial-tracker/transaction-service/Dockerfile b/financial-tracker/transaction-service/Dockerfile index 46b134b197f35e75e0784bedbf94a8dd124693b1..ef5a3f2d4e7ffc02207e1625a6b1f09696008355 100644 --- a/financial-tracker/transaction-service/Dockerfile +++ b/financial-tracker/transaction-service/Dockerfile @@ -1 +1,16 @@ -ÿþ \ No newline at end of file +FROM python:3.12 + +WORKDIR /app + +# Copy requirements.txt from the root context (now accessible) +COPY requirements.txt . + +# Install dependencies globally +RUN pip install --no-cache-dir -r requirements.txt + +# Copy only the current service's code +COPY ./transaction-service/app /app + +EXPOSE 5002 + +CMD ["python", "app.py"] diff --git a/financial-tracker/transaction-service/app.py b/financial-tracker/transaction-service/app.py deleted file mode 100644 index b2bbb1625fe06b3cac8cb5d53385fccf20261034..0000000000000000000000000000000000000000 Binary files a/financial-tracker/transaction-service/app.py and /dev/null differ diff --git a/financial-tracker/transaction-service/app/app.py b/financial-tracker/transaction-service/app/app.py new file mode 100644 index 0000000000000000000000000000000000000000..8b37a7fc7a61b0eae0d7d86f3572e3091df78653 --- /dev/null +++ b/financial-tracker/transaction-service/app/app.py @@ -0,0 +1,10 @@ +from flask import Flask, jsonify, request + +app = Flask(__name__) + +@app.route('/transactions', methods=['GET']) +def get_transactions(): + return jsonify({"message": "Transaction service active"}), 200 + +if __name__ == '__main__': + app.run(host='0.0.0.0', port=5002) diff --git a/financial-tracker/user-service/Dockerfile b/financial-tracker/user-service/Dockerfile index 46b134b197f35e75e0784bedbf94a8dd124693b1..7ad94b56275749c48c5ee08163c67306efdf5cc1 100644 --- a/financial-tracker/user-service/Dockerfile +++ b/financial-tracker/user-service/Dockerfile @@ -1 +1,16 @@ -ÿþ \ No newline at end of file +FROM python:3.12 + +WORKDIR /app + +# Copy requirements.txt from the root context (now accessible) +COPY requirements.txt . + +# Install dependencies globally +RUN pip install --no-cache-dir -r requirements.txt + +# Copy all service files from the app directory +COPY ./user-service/app /app + +EXPOSE 5001 + +CMD ["python", "app.py"] diff --git a/financial-tracker/user-service/app.py b/financial-tracker/user-service/app.py deleted file mode 100644 index ac81c7554bb0799f4bbda4996f3fa6aa7e21fc63..0000000000000000000000000000000000000000 Binary files a/financial-tracker/user-service/app.py and /dev/null differ diff --git a/financial-tracker/user-service/app/app.py b/financial-tracker/user-service/app/app.py new file mode 100644 index 0000000000000000000000000000000000000000..8cd3d9e899268a19fcfdfb3fa7dd35170c674889 --- /dev/null +++ b/financial-tracker/user-service/app/app.py @@ -0,0 +1,10 @@ +from flask import Flask, jsonify, request + +app = Flask(__name__) + +@app.route('/users', methods=['GET']) +def get_users(): + return jsonify({"message": "User service active"}), 200 + +if __name__ == '__main__': + app.run(host='0.0.0.0', port=5001)