Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
B
BACKEND CHALLENGES
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Phạm Quang Bảo
BACKEND CHALLENGES
Commits
7fa65f43
Commit
7fa65f43
authored
May 26, 2026
by
Phạm Quang Bảo
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix: deploy with tsx compiler
parent
1810af78
Changes
8
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
13 additions
and
20 deletions
+13
-20
package.json
backend/package.json
+2
-3
pnpm-lock.yaml
backend/pnpm-lock.yaml
+3
-3
index.ts
backend/src/index.ts
+1
-7
authentication.ts
backend/src/middlewares/authentication.ts
+3
-3
sequelize-config.ts
backend/src/models/sequelize-config.ts
+1
-1
schedulerService.ts
backend/src/services/schedulerService.ts
+1
-1
tsconfig.json
backend/tsconfig.json
+1
-1
tsconfig.tsbuildinfo
backend/tsconfig.tsbuildinfo
+1
-1
No files found.
backend/package.json
View file @
7fa65f43
...
...
@@ -7,11 +7,10 @@
"main"
:
"./src/index.ts"
,
"scripts"
:
{
"dev"
:
"tsx ./src/scripts/database-gen.ts && tsx ./src/scripts/swagger-gen.ts && tsx watch ./src/index.ts"
,
"test"
:
"echo
\"
Error: no test specified
\"
&& exit 1"
,
"gen:db"
:
"tsx src/scripts/database-gen.ts"
,
"gen:swagger"
:
"tsx src/scripts/swagger-gen.ts"
,
"build"
:
"tsx ./src/scripts/database-gen.ts && tsc && tsx ./src/scripts/swagger-gen.ts && cpx
\"
./src/docs/swagger/swagger-output.json
\"
./dist/docs/swagger"
,
"start"
:
"tsx ./
src/index.t
s"
"start"
:
"tsx ./
dist/index.j
s"
},
"imports"
:
{
"#models/*"
:
{
...
...
@@ -81,6 +80,7 @@
"node-cron"
:
"^4.2.1"
,
"nodemailer"
:
"^8.0.7"
,
"pg"
:
"^8.20.0"
,
"tsx"
:
"^4.21.0"
,
"pg-hstore"
:
"^2.3.4"
,
"sequelize"
:
"^6.37.8"
,
"sequelize-auto"
:
"^0.8.8"
,
...
...
@@ -99,7 +99,6 @@
"cpx"
:
"^1.5.0"
,
"esbuild"
:
"^0.28.0"
,
"ts-node"
:
"^10.9.2"
,
"tsx"
:
"^4.21.0"
,
"typescript"
:
"^6.0.3"
}
}
\ No newline at end of file
backend/pnpm-lock.yaml
View file @
7fa65f43
...
...
@@ -62,6 +62,9 @@ importers:
swagger-ui-express
:
specifier
:
^5.0.1
version
:
5.0.1(express@5.2.1)
tsx
:
specifier
:
^4.21.0
version
:
4.21.0
devDependencies
:
'
@types/bcrypt'
:
specifier
:
^6.0.0
...
...
@@ -96,9 +99,6 @@ importers:
ts-node
:
specifier
:
^10.9.2
version
:
10.9.2(@types/node@25.7.0)(typescript@6.0.3)
tsx
:
specifier
:
^4.21.0
version
:
4.21.0
typescript
:
specifier
:
^6.0.3
version
:
6.0.3
...
...
backend/src/index.ts
View file @
7fa65f43
...
...
@@ -2,14 +2,9 @@ import express from 'express';
import
{
resolve
}
from
'path'
;
import
_autoroutes
from
'express-automatic-routes'
;
import
swaggerUi
from
'swagger-ui-express'
;
import
dotenv
from
'dotenv'
;
import
response
from
'#middlewares/response'
;
import
emailCronJob
from
'#services/schedulerService'
;
import
{
createRequire
}
from
'module'
;
dotenv
.
config
();
const
require
=
createRequire
(
import
.
meta
.
url
);
import
swaggerFile
from
'#docs/swagger/swagger-output.json'
;
const
app
=
express
()
const
port
=
3000
...
...
@@ -18,7 +13,6 @@ app.use(express.json());
app
.
use
(
response
as
express
.
RequestHandler
);
const
mountRoutes
=
(
_autoroutes
as
any
).
default
||
_autoroutes
;
const
swaggerFile
=
require
(
'#docs/swagger/swagger-output.json'
);
mountRoutes
(
app
,
{
dir
:
resolve
(
import
.
meta
.
dirname
,
'./controllers'
),
...
...
backend/src/middlewares/authentication.ts
View file @
7fa65f43
...
...
@@ -2,10 +2,10 @@ import jwt from 'jsonwebtoken';
import
{
NextFunction
}
from
'express'
;
import
{
JWTPayload
,
Req
,
Res
}
from
'#interfaces/IApi'
;
//demo
const
JWT_SECRET
=
process
.
env
.
JWT_SECRET
||
''
;
export
const
authMiddleware
=
(
req
:
Req
,
res
:
Res
,
next
:
NextFunction
)
=>
{
const
JWT_SECRET
=
process
.
env
.
JWT_SECRET
||
''
;
const
authHeader
=
req
.
headers
.
authorization
;
if
(
!
authHeader
||
!
authHeader
.
startsWith
(
'Bearer '
))
{
...
...
backend/src/models/sequelize-config.ts
View file @
7fa65f43
import
{
Sequelize
}
from
'sequelize'
;
import
{
config
as
loadEnv
}
from
'dotenv'
;
import
{
initModels
}
from
'
#models
/init-models'
;
import
{
initModels
}
from
'
.
/init-models'
;
loadEnv
({
override
:
true
});
...
...
backend/src/services/schedulerService.ts
View file @
7fa65f43
import
cron
from
'node-cron'
;
import
{
MailService
}
from
'
#services
/mailService'
;
import
{
MailService
}
from
'
.
/mailService'
;
import
{
EnrollProvider
}
from
'#providers/EnrollProvider'
;
const
mailService
=
new
MailService
();
...
...
backend/tsconfig.json
View file @
7fa65f43
...
...
@@ -19,7 +19,7 @@
"sourceMap"
:
true
,
"outDir"
:
"./dist"
,
"rootDir"
:
"./src"
,
"incremental"
:
fals
e
,
"incremental"
:
tru
e
,
"noEmit"
:
false
,
"types"
:
[
"node"
...
...
backend/tsconfig.tsbuildinfo
View file @
7fa65f43
This source diff could not be displayed because it is too large. You can
view the blob
instead.
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment