diff --git a/templates/index.html b/templates/index.html
new file mode 100644
index 0000000..94e6bca
--- /dev/null
+++ b/templates/index.html
@@ -0,0 +1,28 @@
+
+{% for row in csv %}
+
+ {% for col in row %}
+ {{ col }} |
+ {% endfor %}
+
+{% endfor %}
+
+
+
+
+
+
diff --git a/webserver.py b/webserver.py
new file mode 100644
index 0000000..9306ea2
--- /dev/null
+++ b/webserver.py
@@ -0,0 +1,78 @@
+from flask import Flask, render_template, request, redirect
+import csv
+
+HOST_NAME = "localhost"
+HOST_PORT = 5000
+app = Flask(__name__)
+
+@app.route("/")
+def mainpage():
+ with open("animelist.csv") as file:
+ reader = csv.reader(file)
+ enum = list(enumerate(list(reader)))
+ lista = []
+ for el in enum:
+ lista.append([el[0]]+el[1])
+ return render_template('index.html',csv=lista)
+
+@app.route("/new_animu", methods = ['POST', 'GET'])
+def new_animu():
+ if request.method == 'GET':
+ return redirect('/')
+ if request.method == 'POST':
+ form_data = request.form
+ #print(form_data)
+ if add_animu(form_data):
+ return f'Anime aggiunto con successo'
+ return f'Errore aggiungendo anime, hai inserito correttamente i valori?'
+
+@app.route("/del_animu", methods = ['POST', 'GET'])
+def del_animu():
+ if request.method == 'GET':
+ return redirect('/')
+ if request.method == 'POST':
+ form_data = request.form
+ print(form_data)
+ if del_animu(form_data):
+ return f'Anime rimosso con successo'
+ return f'Errore rimuovendo anime, hai inserito correttamente i valori?'
+
+def add_animu(form_data):
+ try:
+ if not (form_data['field_season'] and form_data['field_url'] and form_data['field_folder']):
+ return False
+ stagione = int(form_data['field_season'])
+ new_entry = [form_data['field_url'],
+ form_data['field_folder'] + '/Season ' + str(stagione),
+ 'Episode S' + format(stagione,'02d'),
+ 1,
+ 1]
+ with open("animelist.csv",mode='a') as animecsv: #link,cartella>
+ csvfile=csv.writer(animecsv)
+ csvfile.writerow(new_entry)
+ return True
+ except Exception as e:
+ print(e)
+ return False
+
+def del_animu(form_data):
+ try:
+ if not form_data['del_field']:
+ return False
+ data = []
+ with open("animelist.csv", 'r', newline='') as file:
+ csv_reader = csv.reader(file)
+ for index, row in enumerate(csv_reader):
+ if index != int(form_data['del_field']):
+ data.append(row)
+ # Write the remaining data back to the CSV file
+ with open("animelist.csv", 'w', newline='') as file:
+ csv_writer = csv.writer(file)
+ csv_writer.writerows(data)
+ return True
+ except Exception as e:
+ print(e)
+ return False
+
+if __name__ == "__main__":
+ app.run(HOST_NAME, HOST_PORT)