Skip to content

Commit

Permalink
Server 0.2.4
Browse files Browse the repository at this point in the history
server\api\controllers\bazaar upgraded - now using some collections that need to be created and mapped out through models
  • Loading branch information
EdmundBerkmann committed Feb 24, 2024
1 parent 70dfe6a commit 8cb1ef3
Show file tree
Hide file tree
Showing 43 changed files with 4,166 additions and 874 deletions.
4 changes: 3 additions & 1 deletion .env.template
Original file line number Diff line number Diff line change
Expand Up @@ -29,4 +29,6 @@ IPFS_HOST=
IPFS_PORT=
IPFS_PROTOCOL=

ETH_GAS_STATION_API_KEY=
ETH_GAS_STATION_API_KEY=

STRIPE_SECRET_KEY=
Original file line number Diff line number Diff line change
Expand Up @@ -7,28 +7,35 @@ def write_to_file(content):
print(content, file=out_file)

# Print the title
write_to_file("List of Routes and Controllers")
write_to_file("Unified List of Routes and Controllers")

for root, dirs, files in os.walk(directory):
controller_files = [f for f in files if f.endswith('Controller.js')]
if controller_files:
write_to_file("\nFolder: " + os.path.relpath(root, directory).replace('\\', '/'))

for controller_file in controller_files:
write_to_file("---- File: " + controller_file)
write_to_file("-- File: " + controller_file)

with open(os.path.join(root, controller_file), 'r', encoding='utf-8') as file:
lines = file.readlines()
# Search for lines that contain either "router." or "exports."
relevant_lines = [line.strip() for line in lines if "router." in line or "exports." in line]
const_lines = [line.strip() for line in lines if line.strip().startswith('const')]
function_lines = [line.strip() for line in lines if "router." in line or "exports." in line]

if relevant_lines:
for relevant_line in relevant_lines:
write_to_file("-------- Relevant line: " + relevant_line)
if const_lines:
write_to_file("---- Constants:")
for const_line in const_lines:
write_to_file("------ " + const_line)

if function_lines:
write_to_file("---- Functions:")
for function_line in function_lines:
write_to_file("------ " + function_line)

# Define the directory to analyze and output file name
directory_to_analyse = "server/api/controllers"
output_file_name = "scripts/api_controllers_routes/controllers_and_routes_summary.txt"
output_file_name = "scripts/api_controllers_routes/prints/consolidated_prints.txt"

# Call the function with the directory of the controllers and the output file path
list_controllers_routes_and_functions_to_file(directory_to_analyse, output_file_name)
428 changes: 0 additions & 428 deletions scripts/api_controllers_routes/controllers_and_routes_summary.txt

This file was deleted.

336 changes: 336 additions & 0 deletions scripts/api_controllers_routes/prints/bazaar.txt

Large diffs are not rendered by default.

212 changes: 212 additions & 0 deletions scripts/api_controllers_routes/prints/common.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,212 @@
List of Routes and Controllers in common

Sub-folder: admin
-- File: contentControlController.js
---- Constants:
------ const express = require('express');
------ const AdminService = require('../../../services/AdminService'); // Assuming the path
------ const router = express.Router();
------ const control = await AdminService.controlContent(req.params.id, req.body);
---- Functions:
------ router.put('/:id/contentControl', async (req, res) => {
-- File: moderationController.js
---- Constants:
------ const express = require('express');
------ const AdminService = require('../../../services/AdminService'); // Assuming the path
------ const router = express.Router();
------ const moderation = await AdminService.moderateContent(req.params.id, req.body);
---- Functions:
------ router.put('/:id/moderate', async (req, res) => {
-- File: systemSettingController.js
---- Constants:
------ const express = require('express');
------ const AdminService = require('../../../services/AdminService'); // Assuming the path
------ const router = express.Router();
------ const settings = await AdminService.updateSystemSettings(req.params.id, req.body);
---- Functions:
------ router.put('/:id/systemSetting', async (req, res) => {

Sub-folder: analytics
-- File: adminReportController.js
---- Constants:
------ const express = require('express');
------ const AnalyticsService = require('../../../services/AnalyticsService'); // Assuming the path
------ const router = express.Router();
------ const report = await AnalyticsService.generateAdminReport(req.params.id);
---- Functions:
------ router.get('/:id/adminReport', async (req, res) => {
-- File: engagementController.js
---- Constants:
------ const express = require('express');
------ const AnalyticsService = require('../../../services/AnalyticsService'); // Assuming the path
------ const router = express.Router();
------ const engagement = await AnalyticsService.getEngagementData(req.params.id);
---- Functions:
------ router.get('/:id/engagement', async (req, res) => {
-- File: featureUsageController.js
---- Constants:
------ const express = require('express');
------ const AnalyticsService = require('../../../services/AnalyticsService'); // Assuming the path
------ const router = express.Router();
------ const usage = await AnalyticsService.getFeatureUsageData(req.params.id);
---- Functions:
------ router.get('/:id/featureUsage', async (req, res) => {

Sub-folder: auth
-- File: authController.js
---- Constants:
------ const express = require('express');
------ const router = express.Router();
------ const AuthService = require('../../../services/AuthService'); // Assuming the path
------ const web3Service = require('../../../services/web3Service'); // Assuming the path
------ const jwt = require('jsonwebtoken');
------ const { validateWeb3Token } = require('../../../middleware/authMiddleware'); // Assuming the path
------ const { email, password, blockchainAddress } = req.body;
------ const userCredential = await AuthService.register(email, password);
------ const token = jwt.sign({ uid: userCredential.user.uid }, process.env.JWT_SECRET, { expiresIn: '1h' });
------ const { email, password } = req.body;
------ const userCredential = await AuthService.login(email, password);
------ const token = jwt.sign({ uid: userCredential.user.uid }, process.env.JWT_SECRET, { expiresIn: '1h' });
------ const newToken = jwt.sign({ uid: req.user.uid }, process.env.JWT_SECRET, { expiresIn: '1h' });
---- Functions:
------ router.post('/register', async (req, res) => {
------ router.post('/login', async (req, res) => {
------ router.post('/token', validateWeb3Token, (req, res) => {

Sub-folder: help
-- File: FAQController.js
---- Constants:
------ const express = require('express');
------ const HelpService = require('../../../services/HelpService'); // Assuming the path
------ const router = express.Router();
------ const faqs = await HelpService.getFAQs();
---- Functions:
------ router.get('/faqs', async (req, res) => {
-- File: helpController.js
---- Constants:
------ const express = require('express');
------ const HelpService = require('../../../services/HelpService'); // Assuming the path
------ const router = express.Router();
------ const resources = await HelpService.getHelpResources();
---- Functions:
------ router.get('/resources', async (req, res) => {
-- File: ticketController.js
---- Constants:
------ const express = require('express');
------ const HelpService = require('../../../services/HelpService'); // Assuming the path
------ const router = express.Router();
------ const ticket = await HelpService.submitTicket(req.body);
---- Functions:
------ router.post('/ticket', async (req, res) => {

Sub-folder: notifications
-- File: eventController.js
---- Constants:
------ const express = require('express');
------ const NotificationService = require('../../../services/NotificationService'); // Assuming the path
------ const router = express.Router();
------ const events = await NotificationService.getEvents();
---- Functions:
------ router.get('/events', async (req, res) => {
-- File: notificationController.js
---- Constants:
------ const express = require('express');
------ const NotificationService = require('../../../services/NotificationService'); // Assuming the path
------ const router = express.Router();
------ const notifications = await NotificationService.getNotifications();
---- Functions:
------ router.get('/notifications', async (req, res) => {
-- File: updateController.js
---- Constants:
------ const express = require('express');
------ const NotificationService = require('../../../services/NotificationService'); // Assuming the path
------ const router = express.Router();
------ const updates = await NotificationService.getUpdates();
---- Functions:
------ router.get('/updates', async (req, res) => {

Sub-folder: payments
-- File: cryptoController.js
---- Constants:
------ const express = require('express');
------ const PaymentService = require('../../../services/PaymentService'); // Assuming the path
------ const router = express.Router();
------ const cryptoPayments = await PaymentService.getCryptoPayments();
---- Functions:
------ router.get('/crypto', async (req, res) => {
-- File: paymentController.js
---- Constants:
------ const express = require('express');
------ const PaymentService = require('../../../services/PaymentService'); // Assuming the path
------ const router = express.Router();
------ const payments = await PaymentService.getPayments();
---- Functions:
------ router.get('/payments', async (req, res) => {
-- File: walletController.js
---- Constants:
------ const express = require('express');
------ const PaymentService = require('../../../services/PaymentService'); // Assuming the path
------ const router = express.Router();
------ const wallet = await PaymentService.getWalletDetails();
---- Functions:
------ router.get('/wallet', async (req, res) => {

Sub-folder: userSettings
-- File: customisationController.js
---- Constants:
------ const express = require('express');
------ const UserSettingsService = require('../../../services/UserSettingsService'); // Assuming the path
------ const router = express.Router();
------ const customisation = await UserSettingsService.getCustomisation();
---- Functions:
------ router.get('/customisation', async (req, res) => {
-- File: preferencesController.js
---- Constants:
------ const express = require('express');
------ const UserSettingsService = require('../../../services/UserSettingsService'); // Assuming the path
------ const router = express.Router();
------ const preferences = await UserSettingsService.getPreferences();
---- Functions:
------ router.get('/preferences', async (req, res) => {
-- File: settingsController.js
---- Constants:
------ const express = require('express');
------ const UserSettingsService = require('../../../services/UserSettingsService'); // Assuming the path
------ const router = express.Router();
------ const settings = await UserSettingsService.getSettings();
---- Functions:
------ router.get('/settings', async (req, res) => {

Sub-folder: utils
-- File: commonController.js
---- Constants:
------ const express = require('express');
------ const UtilsService = require('../../../services/UtilsService'); // Assuming the path
------ const router = express.Router();
------ const commonUtils = await UtilsService.getCommonUtils();
---- Functions:
------ router.get('/common', async (req, res) => {
-- File: filterController.js
---- Constants:
------ const express = require('express');
------ const UtilsService = require('../../../services/UtilsService'); // Assuming the path
------ const router = express.Router();
------ const filters = await UtilsService.getFilters();
---- Functions:
------ router.get('/filters', async (req, res) => {
-- File: searchController.js
---- Constants:
------ const express = require('express');
------ const UtilsService = require('../../../services/UtilsService'); // Assuming the path
------ const router = express.Router();
------ const searchResults = await UtilsService.getSearchResults(req.query);
---- Functions:
------ router.get('/search', async (req, res) => {
-- File: sortController.js
---- Constants:
------ const express = require('express');
------ const UtilsService = require('../../../services/UtilsService'); // Assuming the path
------ const router = express.Router();
------ const sortedResults = await UtilsService.getSortedResults(req.query);
---- Functions:
------ router.get('/sort', async (req, res) => {
Loading

0 comments on commit 8cb1ef3

Please sign in to comment.