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
18 changes: 18 additions & 0 deletions amplify.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
version: 1
applications:
- appRoot: frontend # ← path to App
frontend:
phases:
preBuild:
commands:
- npm ci
build:
commands:
- npm run build # runs "tsc -b && vite build"
artifacts:
baseDirectory: dist
files:
- '**/*'
cache:
paths:
- node_modules/**/*
22 changes: 22 additions & 0 deletions backend/dist-ts/backend/src/app.module.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
"use strict";
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
return c > 3 && r && Object.defineProperty(target, key, r), r;
};
Object.defineProperty(exports, "__esModule", { value: true });
exports.AppModule = void 0;
const common_1 = require("@nestjs/common");
const auth_module_1 = require("./auth/auth.module");
const user_module_1 = require("./user/user.module");
const grant_module_1 = require("./grant/grant.module");
const notification_module_1 = require("./notifications/notification.module");
let AppModule = class AppModule {
};
AppModule = __decorate([
(0, common_1.Module)({
imports: [auth_module_1.AuthModule, user_module_1.UserModule, grant_module_1.GrantModule, notification_module_1.NotificationsModule],
})
], AppModule);
exports.AppModule = AppModule;
77 changes: 77 additions & 0 deletions backend/dist-ts/backend/src/auth/auth.controller.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,77 @@
"use strict";
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
return c > 3 && r && Object.defineProperty(target, key, r), r;
};
var __metadata = (this && this.__metadata) || function (k, v) {
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
};
var __param = (this && this.__param) || function (paramIndex, decorator) {
return function (target, key) { decorator(target, key, paramIndex); }
};
Object.defineProperty(exports, "__esModule", { value: true });
exports.AuthController = void 0;
const common_1 = require("@nestjs/common");
const auth_service_1 = require("./auth.service");
let AuthController = class AuthController {
constructor(authService) {
this.authService = authService;
}
async register(username, password, email) {
await this.authService.register(username, password, email);
return { message: 'User registered successfully' };
}
async login(username, password) {
return await this.authService.login(username, password);
}
async setNewPassword(newPassword, session, username, email) {
return await this.authService.setNewPassword(newPassword, session, username, email);
}
async updateProfile(username, email, position_or_role) {
await this.authService.updateProfile(username, email, position_or_role);
return { message: 'Profile has been updated' };
}
};
__decorate([
(0, common_1.Post)('register'),
__param(0, (0, common_1.Body)('username')),
__param(1, (0, common_1.Body)('password')),
__param(2, (0, common_1.Body)('email')),
__metadata("design:type", Function),
__metadata("design:paramtypes", [String, String, String]),
__metadata("design:returntype", Promise)
], AuthController.prototype, "register", null);
__decorate([
(0, common_1.Post)('login'),
__param(0, (0, common_1.Body)('username')),
__param(1, (0, common_1.Body)('password')),
__metadata("design:type", Function),
__metadata("design:paramtypes", [String, String]),
__metadata("design:returntype", Promise)
], AuthController.prototype, "login", null);
__decorate([
(0, common_1.Post)('set-password'),
__param(0, (0, common_1.Body)('newPassword')),
__param(1, (0, common_1.Body)('session')),
__param(2, (0, common_1.Body)('username')),
__param(3, (0, common_1.Body)('email')),
__metadata("design:type", Function),
__metadata("design:paramtypes", [String, String, String, String]),
__metadata("design:returntype", Promise)
], AuthController.prototype, "setNewPassword", null);
__decorate([
(0, common_1.Post)('update-profile'),
__param(0, (0, common_1.Body)('username')),
__param(1, (0, common_1.Body)('email')),
__param(2, (0, common_1.Body)('position_or_role')),
__metadata("design:type", Function),
__metadata("design:paramtypes", [String, String, String]),
__metadata("design:returntype", Promise)
], AuthController.prototype, "updateProfile", null);
AuthController = __decorate([
(0, common_1.Controller)('auth'),
__metadata("design:paramtypes", [auth_service_1.AuthService])
], AuthController);
exports.AuthController = AuthController;
28 changes: 28 additions & 0 deletions backend/dist-ts/backend/src/auth/auth.module.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
"use strict";
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
return c > 3 && r && Object.defineProperty(target, key, r), r;
};
Object.defineProperty(exports, "__esModule", { value: true });
exports.AuthModule = void 0;
const common_1 = require("@nestjs/common");
const jwt_1 = require("@nestjs/jwt");
const auth_controller_1 = require("./auth.controller");
const auth_service_1 = require("./auth.service");
let AuthModule = class AuthModule {
};
AuthModule = __decorate([
(0, common_1.Module)({
imports: [
jwt_1.JwtModule.register({
secret: process.env.JWT_SECRET,
signOptions: { expiresIn: '1h' },
}),
],
controllers: [auth_controller_1.AuthController],
providers: [auth_service_1.AuthService],
})
], AuthModule);
exports.AuthModule = AuthModule;
Loading