front end test & backup

This commit is contained in:
5t4l1n
2025-07-25 13:57:14 +05:30
parent 35efa955ad
commit f00cb56fad
5 changed files with 50 additions and 472 deletions
+6 -4
View File
@@ -1,10 +1,12 @@
from flask import Flask, jsonify, request
from flask import Flask, jsonify
from flask_cors import CORS
from dotenv import load_dotenv
import os
import asyncio
from mongo_service import MongoService
from web3_service import Web3Service
# Import all route blueprints
from routes import auth, test_flow, certificate, dashboard
load_dotenv()
@@ -14,10 +16,10 @@ CORS(app)
# Configuration
app.config['SECRET_KEY'] = os.getenv('SECRET_KEY', 'your-secret-key')
app.config['MONGODB_URI'] = os.getenv('MONGODB_URI', 'mongodb://localhost:27017/openlearnx')
app.config['MONGODB_URI'] = os.getenv('MONGODB_URI')
app.config['WEB3_PROVIDER_URL'] = os.getenv('WEB3_PROVIDER_URL', 'http://127.0.0.1:8545')
app.config['CONTRACT_ADDRESS'] = os.getenv('CONTRACT_ADDRESS')
app.config['IPFS_GATEWAY'] = os.getenv('IPFS_GATEWAY', 'https://ipfs.infura.io:5001')
app.config['MINTER_PRIVATE_KEY'] = os.getenv('MINTER_PRIVATE_KEY')
# Initialize services
mongo_service = MongoService(app.config['MONGODB_URI'])
@@ -27,7 +29,7 @@ web3_service = Web3Service(app.config['WEB3_PROVIDER_URL'], app.config['CONTRACT
app.config['MONGO_SERVICE'] = mongo_service
app.config['WEB3_SERVICE'] = web3_service
# Register blueprints
# Register all blueprints
app.register_blueprint(auth.bp, url_prefix='/api/auth')
app.register_blueprint(test_flow.bp, url_prefix='/api/test')
app.register_blueprint(certificate.bp, url_prefix='/api/certificate')