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
Binary file added autoencoder_model.h5
Binary file not shown.
793,400 changes: 793,400 additions & 0 deletions autoencoder_model.json

Large diffs are not rendered by default.

10 changes: 8 additions & 2 deletions index.js
Original file line number Diff line number Diff line change
@@ -1,10 +1,14 @@
import express from 'express';
import mongoose from 'mongoose';
import cors from 'cors';
import predictFraudRouter from './predict-fraud.js';

const app = express();

app.use(cors());
app.use(express.json());

const MONGO_URL = 'mongodb://127.0.0.1:27017/safe-transactions';

mongoose.connect(MONGO_URL)
.then(() => {
console.log('Connected to MongoDB');
Expand All @@ -13,8 +17,10 @@ mongoose.connect(MONGO_URL)
console.error('Error connecting to MongoDB:', error);
});

app.use('/predict', predictFraudRouter);

const port = 3002;

app.listen(port, () =>
console.log(`server running on port ${port}`)
console.log(`Server running on port ${port}`)
);
18 changes: 18 additions & 0 deletions model/transaction.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
import mongoose from 'mongoose';

const transactionSchema = new mongoose.Schema({
cardType: String,
channel: String,
transactionType: String,
transactionTypeGroup: String,
entryMode: String,
outletId: String,
merchantCountry: String,
merchantActivity: String,
clientCode: String,
amountUSD: Number,
});

const Transaction = mongoose.model('Transaction', transactionSchema);

export default Transaction;
Loading