-
Notifications
You must be signed in to change notification settings - Fork 1
Express to Nestjs #79
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Changes from 2 commits
bcee356
fd485db
6555007
0e1f22d
6e854f0
3861c5f
e85a174
d33d2c0
c1658a0
d7a440f
1503475
ce54dff
1f53bbc
3b90807
3cc292b
2d43bc1
427ae1b
aa231bb
ddfd2ec
0b4fe57
33e5c95
919b090
05e0824
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,56 @@ | ||
node_modules/* | ||
dist/* | ||
package-lock.json | ||
id_rsa | ||
id_rsa.pub | ||
# compiled output | ||
/dist | ||
/node_modules | ||
/build | ||
|
||
# Logs | ||
logs | ||
*.log | ||
npm-debug.log* | ||
pnpm-debug.log* | ||
yarn-debug.log* | ||
yarn-error.log* | ||
lerna-debug.log* | ||
|
||
# OS | ||
.DS_Store | ||
|
||
# Tests | ||
/coverage | ||
/.nyc_output | ||
|
||
# IDEs and editors | ||
/.idea | ||
.project | ||
.classpath | ||
.c9/ | ||
*.launch | ||
.settings/ | ||
*.sublime-workspace | ||
|
||
# IDE - VSCode | ||
.vscode/* | ||
!.vscode/settings.json | ||
!.vscode/tasks.json | ||
!.vscode/launch.json | ||
!.vscode/extensions.json | ||
|
||
# dotenv environment variable files | ||
.env | ||
.env.development.local | ||
.env.test.local | ||
.env.production.local | ||
.env.local | ||
|
||
# temp directory | ||
.temp | ||
.tmp | ||
|
||
# Runtime data | ||
pids | ||
*.pid | ||
*.seed | ||
*.pid.lock | ||
|
||
# Diagnostic reports (https://nodejs.org/api/report.html) | ||
report.[0-9]*.[0-9]*.[0-9]*.[0-9]*.json |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,4 @@ | ||
<<<<<<< HEAD | ||
IntegerAlex marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
# Flexr | ||
|
||
<p align="center"> | ||
|
@@ -120,3 +121,103 @@ This program is free software: you can redistribute it and/or modify it under th | |
--- | ||
Made with ❤️ by Akshat Kotpalliwar (alias IntegerAlex on GitHub) | ||
``` | ||
======= | ||
IntegerAlex marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
<p align="center"> | ||
<a href="http://nestjs.com/" target="blank"><img src="https://nestjs.com/img/logo-small.svg" width="120" alt="Nest Logo" /></a> | ||
</p> | ||
|
||
[circleci-image]: https://img.shields.io/circleci/build/github/nestjs/nest/master?token=abc123def456 | ||
[circleci-url]: https://circleci.com/gh/nestjs/nest | ||
|
||
<p align="center">A progressive <a href="http://nodejs.org" target="_blank">Node.js</a> framework for building efficient and scalable server-side applications.</p> | ||
<p align="center"> | ||
<a href="https://www.npmjs.com/~nestjscore" target="_blank"><img src="https://img.shields.io/npm/v/@nestjs/core.svg" alt="NPM Version" /></a> | ||
<a href="https://www.npmjs.com/~nestjscore" target="_blank"><img src="https://img.shields.io/npm/l/@nestjs/core.svg" alt="Package License" /></a> | ||
<a href="https://www.npmjs.com/~nestjscore" target="_blank"><img src="https://img.shields.io/npm/dm/@nestjs/common.svg" alt="NPM Downloads" /></a> | ||
<a href="https://circleci.com/gh/nestjs/nest" target="_blank"><img src="https://img.shields.io/circleci/build/github/nestjs/nest/master" alt="CircleCI" /></a> | ||
<a href="https://discord.gg/G7Qnnhy" target="_blank"><img src="https://img.shields.io/badge/discord-online-brightgreen.svg" alt="Discord"/></a> | ||
<a href="https://opencollective.com/nest#backer" target="_blank"><img src="https://opencollective.com/nest/backers/badge.svg" alt="Backers on Open Collective" /></a> | ||
<a href="https://opencollective.com/nest#sponsor" target="_blank"><img src="https://opencollective.com/nest/sponsors/badge.svg" alt="Sponsors on Open Collective" /></a> | ||
<a href="https://paypal.me/kamilmysliwiec" target="_blank"><img src="https://img.shields.io/badge/Donate-PayPal-ff3f59.svg" alt="Donate us"/></a> | ||
<a href="https://opencollective.com/nest#sponsor" target="_blank"><img src="https://img.shields.io/badge/Support%20us-Open%20Collective-41B883.svg" alt="Support us"></a> | ||
<a href="https://twitter.com/nestframework" target="_blank"><img src="https://img.shields.io/twitter/follow/nestframework.svg?style=social&label=Follow" alt="Follow us on Twitter"></a> | ||
</p> | ||
<!--[](https://opencollective.com/nest#backer) | ||
[](https://opencollective.com/nest#sponsor)--> | ||
IntegerAlex marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
|
||
## Description | ||
|
||
[Nest](https://github.com/nestjs/nest) framework TypeScript starter repository. | ||
|
||
## Project setup | ||
|
||
```bash | ||
$ npm install | ||
``` | ||
|
||
## Compile and run the project | ||
|
||
```bash | ||
# development | ||
$ npm run start | ||
|
||
# watch mode | ||
$ npm run start:dev | ||
|
||
# production mode | ||
$ npm run start:prod | ||
``` | ||
|
||
## Run tests | ||
|
||
```bash | ||
# unit tests | ||
$ npm run test | ||
|
||
# e2e tests | ||
$ npm run test:e2e | ||
|
||
# test coverage | ||
$ npm run test:cov | ||
``` | ||
|
||
## Deployment | ||
|
||
When you're ready to deploy your NestJS application to production, there are some key steps you can take to ensure it runs as efficiently as possible. Check out the [deployment documentation](https://docs.nestjs.com/deployment) for more information. | ||
|
||
If you are looking for a cloud-based platform to deploy your NestJS application, check out [Mau](https://mau.nestjs.com), our official platform for deploying NestJS applications on AWS. Mau makes deployment straightforward and fast, requiring just a few simple steps: | ||
|
||
```bash | ||
$ npm install -g mau | ||
$ mau deploy | ||
``` | ||
|
||
With Mau, you can deploy your application in just a few clicks, allowing you to focus on building features rather than managing infrastructure. | ||
|
||
## Resources | ||
|
||
Check out a few resources that may come in handy when working with NestJS: | ||
|
||
- Visit the [NestJS Documentation](https://docs.nestjs.com) to learn more about the framework. | ||
- For questions and support, please visit our [Discord channel](https://discord.gg/G7Qnnhy). | ||
- To dive deeper and get more hands-on experience, check out our official video [courses](https://courses.nestjs.com/). | ||
- Deploy your application to AWS with the help of [NestJS Mau](https://mau.nestjs.com) in just a few clicks. | ||
- Visualize your application graph and interact with the NestJS application in real-time using [NestJS Devtools](https://devtools.nestjs.com). | ||
- Need help with your project (part-time to full-time)? Check out our official [enterprise support](https://enterprise.nestjs.com). | ||
- To stay in the loop and get updates, follow us on [X](https://x.com/nestframework) and [LinkedIn](https://linkedin.com/company/nestjs). | ||
- Looking for a job, or have a job to offer? Check out our official [Jobs board](https://jobs.nestjs.com). | ||
|
||
## Support | ||
|
||
Nest is an MIT-licensed open source project. It can grow thanks to the sponsors and support by the amazing backers. If you'd like to join them, please [read more here](https://docs.nestjs.com/support). | ||
|
||
## Stay in touch | ||
|
||
- Author - [Kamil Myśliwiec](https://twitter.com/kammysliwiec) | ||
- Website - [https://nestjs.com](https://nestjs.com/) | ||
- Twitter - [@nestframework](https://twitter.com/nestframework) | ||
|
||
## License | ||
|
||
Nest is [MIT licensed](https://github.com/nestjs/nest/blob/master/LICENSE). | ||
|
||
>>>>>>> 4728644 (update @1) |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
// @ts-check | ||
import eslint from '@eslint/js'; | ||
import eslintPluginPrettierRecommended from 'eslint-plugin-prettier/recommended'; | ||
import globals from 'globals'; | ||
import tseslint from 'typescript-eslint'; | ||
|
||
export default tseslint.config( | ||
{ | ||
ignores: ['eslint.config.mjs'], | ||
}, | ||
eslint.configs.recommended, | ||
...tseslint.configs.recommendedTypeChecked, | ||
eslintPluginPrettierRecommended, | ||
{ | ||
languageOptions: { | ||
globals: { | ||
...globals.node, | ||
...globals.jest, | ||
}, | ||
ecmaVersion: 5, | ||
IntegerAlex marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
sourceType: 'module', | ||
IntegerAlex marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
parserOptions: { | ||
projectService: true, | ||
tsconfigRootDir: import.meta.dirname, | ||
}, | ||
}, | ||
}, | ||
{ | ||
rules: { | ||
'@typescript-eslint/no-explicit-any': 'off', | ||
'@typescript-eslint/no-floating-promises': 'warn', | ||
'@typescript-eslint/no-unsafe-argument': 'warn' | ||
}, | ||
}, | ||
); |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
document.getElementById('loginForm')?.addEventListener('submit', async (e: Event) => { | ||
e.preventDefault(); | ||
const loginButton = document.getElementById('loginButton') as HTMLButtonElement; | ||
const errorMessage = document.getElementById('errorMessage') as HTMLDivElement; | ||
|
||
// Reset UI state | ||
errorMessage.style.display = 'none'; | ||
loginButton.disabled = true; | ||
loginButton.textContent = 'Logging in...'; | ||
|
||
const githubUsername = (document.getElementById('githubUsername') as HTMLInputElement).value; | ||
const passKey = (document.getElementById('passKey') as HTMLInputElement).value; | ||
|
||
try { | ||
const response = await fetch('/login', { | ||
IntegerAlex marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
method: 'POST', | ||
headers: { | ||
'Content-Type': 'application/json', | ||
}, | ||
body: JSON.stringify({ githubUsername, passKey }), | ||
credentials: 'same-origin' | ||
}); | ||
IntegerAlex marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
|
||
if (response.ok) { | ||
window.location.href = '/'; // Redirect to the dashboard | ||
} else { | ||
const data = await response.json(); | ||
errorMessage.textContent = data.message || 'Invalid credentials'; | ||
errorMessage.style.display = 'block'; | ||
} | ||
} catch (error) { | ||
errorMessage.textContent = 'Connection error. Please try again.'; | ||
errorMessage.style.display = 'block'; | ||
} finally { | ||
loginButton.disabled = false; | ||
loginButton.textContent = 'Login'; | ||
} | ||
}); |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
{ | ||
"$schema": "https://json.schemastore.org/nest-cli", | ||
"collection": "@nestjs/schematics", | ||
"sourceRoot": "src", | ||
"compilerOptions": { | ||
"deleteOutDir": true | ||
} | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,52 +1,75 @@ | ||
{ | ||
"name": "flexr", | ||
"version": "1.0.0", | ||
"main": "dist/server/setup.js", | ||
{ "name": "fenrir", | ||
"version": "0.0.1", | ||
"description": "", | ||
"author": "", | ||
"private": true, | ||
"license": "UNLICENSED", | ||
"scripts": { | ||
"dev": "nodemon --exec ts-node server/setup.ts", | ||
"build": "tsc", | ||
"start": "node dist/server/setup.js", | ||
"lint": "eslint . --ext .ts", | ||
"build": "nest build", | ||
"format": "prettier --write \"src/**/*.ts\" \"test/**/*.ts\"", | ||
"start": "nest start", | ||
"start:dev": "nest start --watch", | ||
"start:debug": "nest start --debug --watch", | ||
"start:prod": "node dist/main", | ||
"lint": "eslint \"{src,apps,libs,test}/**/*.ts\" --fix", | ||
"test": "jest", | ||
"db:migrate": "node dist/db/create.js" | ||
"test:watch": "jest --watch", | ||
"test:cov": "jest --coverage", | ||
"test:debug": "node --inspect-brk -r tsconfig-paths/register -r ts-node/register node_modules/.bin/jest --runInBand", | ||
"test:e2e": "jest --config ./test/jest-e2e.json" | ||
}, | ||
"keywords": [ | ||
"deployment", | ||
"containers", | ||
"podman", | ||
"nodejs" | ||
], | ||
"author": "Akshat Kotpalliwar", | ||
"license": "GPL-3.0", | ||
"description": "", | ||
"dependencies": { | ||
"cloudflare": "^3.5.0", | ||
"compression": "^1.7.4", | ||
"cookie-parser": "^1.4.7", | ||
"cors": "^2.8.5", | ||
"dotenv": "^16.4.5", | ||
"express": "^4.19.2", | ||
"helmet": "^7.1.0", | ||
"htmx": "^0.0.2", | ||
"pg": "^8.12.0", | ||
"redis": "^4.7.0", | ||
"uuid": "^11.1.0", | ||
"winston": "^3.11.0" | ||
"@nestjs/common": "^11.0.1", | ||
"@nestjs/core": "^11.0.1", | ||
"@nestjs/platform-express": "^11.0.1", | ||
"@nestjs/typeorm": "^11.0.0", | ||
"pg": "^8.14.1", | ||
"reflect-metadata": "^0.2.2", | ||
"rxjs": "^7.8.1", | ||
"typeorm": "^0.3.21" | ||
}, | ||
"devDependencies": { | ||
"@types/cookie-parser": "^1.4.8", | ||
"@types/cors": "^2.8.17", | ||
"@types/express": "^4.17.21", | ||
"@types/jest": "^29.5.0", | ||
"@types/node": "^20.14.12", | ||
"@types/pg": "^8.11.6", | ||
"@types/uuid": "^10.0.0", | ||
"@typescript-eslint/eslint-plugin": "^6.0.0", | ||
"@typescript-eslint/parser": "^6.0.0", | ||
"eslint": "^8.57.0", | ||
"@eslint/eslintrc": "^3.2.0", | ||
"@eslint/js": "^9.18.0", | ||
"@nestjs/cli": "^11.0.0", | ||
"@nestjs/schematics": "^11.0.0", | ||
"@nestjs/testing": "^11.0.1", | ||
"@swc/cli": "^0.6.0", | ||
"@swc/core": "^1.10.7", | ||
"@types/express": "^5.0.0", | ||
"@types/jest": "^29.5.14", | ||
"@types/node": "^22.10.7", | ||
"@types/supertest": "^6.0.2", | ||
"eslint": "^9.18.0", | ||
"eslint-config-prettier": "^10.0.1", | ||
"eslint-plugin-prettier": "^5.2.2", | ||
"globals": "^16.0.0", | ||
"jest": "^29.7.0", | ||
"nodemon": "^3.0.0", | ||
"ts-jest": "^29.1.0", | ||
"ts-node": "^10.9.2" | ||
"prettier": "^3.4.2", | ||
"source-map-support": "^0.5.21", | ||
"supertest": "^7.0.0", | ||
"ts-jest": "^29.2.5", | ||
"ts-loader": "^9.5.2", | ||
"ts-node": "^10.9.2", | ||
"tsconfig-paths": "^4.2.0", | ||
"typescript": "^5.7.3", | ||
"typescript-eslint": "^8.20.0" | ||
}, | ||
"jest": { | ||
"moduleFileExtensions": [ | ||
"js", | ||
"json", | ||
"ts" | ||
], | ||
"rootDir": "src", | ||
"testRegex": ".*\\.spec\\.ts$", | ||
"transform": { | ||
"^.+\\.(t|j)s$": "ts-jest" | ||
}, | ||
"collectCoverageFrom": [ | ||
"**/*.(t|j)s" | ||
], | ||
"coverageDirectory": "../coverage", | ||
"testEnvironment": "node" | ||
} | ||
} |
Uh oh!
There was an error while loading. Please reload this page.