Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
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
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Baseimage
FROM python:3.12.5-slim-bookworm
FROM python:3.13.2-slim-bookworm

# Update Packages
RUN apt update
Expand Down
12 changes: 12 additions & 0 deletions flask_app/CrewAI-Studio.code-workspace
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{
"folders": [
{
"path": ".."
}
],
"settings": {
"githubPullRequests.ignoredPullRequestBranches": [
"main"
]
}
}
74 changes: 74 additions & 0 deletions flask_app/app.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,74 @@
from flask import Flask, render_template, jsonify, request
from flask_cors import CORS
import json

app = Flask(__name__)
CORS(app)

crews = []
tools = []
agents = []
tasks = []
tools_state = []

@app.route('/')
def index():
return render_template('index.html')

@app.route('/api/crews', methods=['GET', 'POST'])
def get_crews():
if request.method == 'GET':
return jsonify(crews)
elif request.method == 'POST':
new_crew = request.get_json()
crews.append(new_crew)
return jsonify({'message': 'Crew added'}), 201

@app.route('/api/tools', methods=['GET', 'POST'])
def get_tools():
if request.method == 'GET':
return jsonify(tools)
elif request.method == 'POST':
new_tool = request.get_json()
tools.append(new_tool)
return jsonify({'message': 'Tool added'}), 201

@app.route('/api/agents', methods=['GET', 'POST'])
def get_agents():
if request.method == 'GET':
return jsonify(agents)
elif request.method == 'POST':
new_agent = request.get_json()
agents.append(new_agent)
return jsonify({'message': 'Agent added'}), 201

@app.route('/api/tasks', methods=['GET', 'POST'])
def get_tasks():
if request.method == 'GET':
return jsonify(tasks)
elif request.method == 'POST':
new_task = request.get_json()
tasks.append(new_task)
return jsonify({'message': 'Task added'}), 201

@app.route('/api/tools/state', methods=['GET'])
def get_tools_state():
return jsonify(tools_state)

@app.route('/api/crews/<int:crew_id>/run', methods=['POST'])
def run_crew(crew_id):
return jsonify({'message': f'Crew {crew_id} started'})

@app.route('/api/crews/<int:crew_id>/export', methods=['GET'])
def export_crew(crew_id):
# Placeholder for exporting crew data
return jsonify({'message': f'Crew {crew_id} exported'})

@app.route('/api/crews/import', methods=['POST'])
def import_crew():
# Placeholder for importing crew data
return jsonify({'message': 'Crew imported'})


if __name__ == '__main__':
app.run(debug=True, host='0.0.0.0', port=5000)
5 changes: 5 additions & 0 deletions flask_app/requirements.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
flask==2.3.3
flask-cors==4.0.0
werkzeug==2.3.7
crewai_tools

268 changes: 268 additions & 0 deletions flask_app/static/css/style.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,268 @@
:root {
--primary-color: #2196F3;
--secondary-color: #1976D2;
--background-color: #f5f5f5;
--sidebar-bg: #fff;
--text-color: #333;
--border-color: #e0e0e0;
}

* {
margin: 0;
padding: 0;
box-sizing: border-box;
}

html {
font-size: 16px;
}

body {
font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
background-color: var(--background-color);
color: var(--text-color);
line-height: 1.5;
}

/* Mobile First Layout */
.app-container {
display: flex;
flex-direction: column;
min-height: 100vh;
}

/* Mobile Navigation */
.sidebar {
position: fixed;
bottom: 0;
left: 0;
right: 0;
background-color: var(--sidebar-bg);
box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.1);
z-index: 1000;
}

.logo-container {
display: none; /* Hidden on mobile */
}

.nav-links {
list-style: none;
display: flex;
justify-content: space-around;
padding: 0.5rem;
}

.nav-links li {
display: flex;
flex-direction: column;
align-items: center;
padding: 0.5rem;
font-size: 0.75rem;
cursor: pointer;
}

.nav-links li i {
font-size: 1.5rem;
margin-bottom: 0.25rem;
}

.nav-links li span {
display: none;
}

/* Main Content */
.main-content {
flex: 1;
padding: 1rem;
margin-bottom: 4rem; /* Space for bottom navigation */
}

.page {
display: none;
max-width: 100%;
margin: 0 auto;
}

.page.active {
display: block;
}

h1 {
font-size: 1.5rem;
margin-bottom: 1rem;
padding: 0.5rem;
}

h2 {
font-size: 1.25rem;
margin-bottom: 0.75rem;
}

/* Cards */
.crew-item, .tool-item, .agent-item, .task-item {
background: white;
border-radius: 0.5rem;
padding: 1rem;
margin-bottom: 1rem;
box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

/* Buttons */
.add-btn, .kickoff-btn, .export-btn, .import-btn {
width: 100%;
background-color: var(--primary-color);
color: white;
border: none;
padding: 1rem;
border-radius: 0.5rem;
font-size: 1rem;
display: flex;
align-items: center;
justify-content: center;
gap: 0.5rem;
margin: 1rem 0;
cursor: pointer;
transition: background-color 0.3s;
}

.add-btn:hover, .kickoff-btn:hover, .export-btn:hover, .import-btn:hover {
background-color: var(--secondary-color);
}

/* Form Elements */
select, input[type="file"] {
width: 100%;
padding: 0.75rem;
margin-bottom: 1rem;
border: 1px solid var(--border-color);
border-radius: 0.5rem;
font-size: 1rem;
}

/* Containers */
.crews-container, .tools-container, .agents-container, .tasks-container {
padding: 1rem;
}

.execution-output {
background: white;
padding: 1rem;
border-radius: 0.5rem;
margin-top: 1rem;
overflow-x: auto;
}

.export-container {
display: grid;
gap: 1rem;
}

.export-section, .import-section {
background: white;
padding: 1rem;
border-radius: 0.5rem;
}

/* Action buttons within items */
.crew-actions, .tool-actions, .agent-actions, .task-actions {
display: flex;
gap: 0.5rem;
margin-top: 0.5rem;
}

.crew-actions button, .tool-actions button, .agent-actions button, .task-actions button {
padding: 0.5rem;
border: none;
background: none;
cursor: pointer;
color: var(--primary-color);
}

/* Tablet and up */
@media (min-width: 768px) {
.app-container {
flex-direction: row;
}

.sidebar {
position: static;
width: 250px;
padding: 1rem 0;
}

.logo-container {
display: block;
padding: 1rem;
margin-bottom: 2rem;
}

.nav-links {
flex-direction: column;
}

.nav-links li {
flex-direction: row;
padding: 1rem;
font-size: 1rem;
}

.nav-links li span {
display: inline;
margin-left: 0.5rem;
}

.main-content {
margin-bottom: 0;
padding: 2rem;
}

.export-container {
grid-template-columns: repeat(2, 1fr);
}

.add-btn, .kickoff-btn, .export-btn, .import-btn {
width: auto;
}
}

/* Desktop */
@media (min-width: 1024px) {
.main-content {
padding: 2rem 3rem;
}

.page {
max-width: 1200px;
}

.crew-list, .tool-list, .agent-list, .task-list {
display: grid;
grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
gap: 1rem;
}

h1 {
font-size: 2rem;
}
}

/* Dark mode support */
@media (prefers-color-scheme: dark) {
:root {
--background-color: #121212;
--sidebar-bg: #1e1e1e;
--text-color: #ffffff;
--border-color: #333333;
}

.crew-item, .tool-item, .agent-item, .task-item,
.export-section, .import-section, .execution-output {
background: #1e1e1e;
}

select, input[type="file"] {
background: #1e1e1e;
color: white;
}
}
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading