first commit

This commit is contained in:
kicap1992
2025-10-26 22:53:17 +08:00
commit a2573c8307
1555 changed files with 648419 additions and 0 deletions

19
models/guru_model.ts Normal file
View File

@ -0,0 +1,19 @@
import mongoose from "mongoose";
const matapelajaranSchema = new mongoose.Schema({
matpel: { type: String, required: true }
} , { _id: false });
const guruSchema = new mongoose.Schema({
nig: { type: String, required: true },
nama: { type: String, required: true },
jk: { type: String, required: true },
no_telpon: { type: String, required: true },
password: { type: String, default: '12345678' },
listmatapelajaran: [matapelajaranSchema]
}, {
timestamps: true,
collection: 'guru'
});
export const GuruModel = mongoose.model('Guru', guruSchema);

23
models/jawaban_model.ts Normal file
View File

@ -0,0 +1,23 @@
// create jawaban model using mongoose
import mongoose, { Document, Schema } from 'mongoose';
export interface Jawaban extends Document {
nis: string;
jawaban: string;
soal: string;
waktu: Date;
}
const JawabanSchema = new Schema(
{
nis: { type: String, required: true },
jawaban: { type: String, required: true },
soal: { type: String, required: true },
waktu: { type: Date, required: true },
},
{
collection: 'jawaban_soal'
}
);
export const JawabanSoalModel = mongoose.model<Jawaban>('Jawaban', JawabanSchema);

29
models/siswa_model.ts Normal file
View File

@ -0,0 +1,29 @@
import mongoose, { Document, Schema } from 'mongoose';
export interface Siswa extends Document {
readonly nis: string;
readonly nama: string;
readonly kelas: string;
readonly jurusan: string;
readonly jk: string;
readonly password: string;
readonly createdAt: Date;
readonly updatedAt: Date;
}
const SiswaSchema = new Schema(
{
nis: { type: String, required: true },
nama: { type: String, required: true },
kelas: { type: String, required: true },
jurusan: { type: String, required: true },
jk: { type: String, required: true },
password: { type: String, default: '12345678' },
},
{
timestamps: true,
collection: 'siswa'
}
);
export const SiswaModel = mongoose.model<Siswa>('Siswa', SiswaSchema);