Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
93 commits
Select commit Hold shift + click to select a range
e45674e
Updating nest.js with old implementation but with updated packages/fr…
digitalnomad91 Jul 21, 2025
2fe3ced
Merge branch 'devops/docker-implementation'
digitalnomad91 Jul 21, 2025
9092140
Deleting prisma folder to re-add as sub-module.
digitalnomad91 Jul 21, 2025
00406af
Add prisma as a git submodule
digitalnomad91 Jul 21, 2025
cf9c3fc
Fixing workflow to run on custom action worker on home server.
digitalnomad91 Jul 21, 2025
64cee01
Updated runs-on runner to use org-wide runner.
digitalnomad91 Jul 21, 2025
c582ffc
Updated runs-on.
digitalnomad91 Jul 21, 2025
58b26f5
Removing unnecessary variable checks.
digitalnomad91 Jul 21, 2025
440b1e8
Updating docker container name & workflow deploymnent.
digitalnomad91 Jul 21, 2025
865f25f
Fixing workflow.
digitalnomad91 Jul 21, 2025
04906f3
Adding pnpm to fix worfklow.
digitalnomad91 Jul 21, 2025
ed3ead3
Updated Dockerfile to work with pnpm.
digitalnomad91 Jul 21, 2025
fb7e4c0
Fixing Dockerfile.
digitalnomad91 Jul 21, 2025
2340247
Updated package.json license to Do Whatever The Fuck You Want.
digitalnomad91 Jul 21, 2025
da9873e
Added prisma generate to workflow.
digitalnomad91 Jul 21, 2025
c9ed963
Fixing workflow npx prisma error.
digitalnomad91 Jul 21, 2025
e84a262
Fixing workflow npx prisma error.
digitalnomad91 Jul 21, 2025
aa0f1b4
Fixing workflow.
digitalnomad91 Jul 21, 2025
404e68f
Fixed container name.
digitalnomad91 Jul 21, 2025
e4bf853
Added prisma to dockerfile.
digitalnomad91 Jul 21, 2025
d423054
Added prisma to dockerfile.
digitalnomad91 Jul 21, 2025
6fdadf1
Fixing prisma error.
digitalnomad91 Jul 21, 2025
00d15c3
Updated Dockerfile to be multi-stage.
digitalnomad91 Jul 21, 2025
c72b3b4
Prisma fix.
digitalnomad91 Jul 21, 2025
3f975bd
Added default start for docker entrypoint.
digitalnomad91 Jul 22, 2025
883d46a
Debugging workflow error.
digitalnomad91 Jul 22, 2025
458a185
Upgraded prisma packages & removed unusedp lugin.
digitalnomad91 Jul 22, 2025
c906546
Added dockerignore with prisma dbml folder.
digitalnomad91 Jul 22, 2025
e9fb709
Added env file support & consistency with other containers.
digitalnomad91 Jul 22, 2025
dfa85ae
Fixed type error.
digitalnomad91 Jul 22, 2025
08f7cf3
Formatting.
digitalnomad91 Jul 22, 2025
bb161d3
Updated db service to match docker-compose from next.js frontend
digitalnomad91 Jul 22, 2025
0fa5bd4
Updated version.
digitalnomad91 Jul 22, 2025
9bb8bda
Debugging container early exit.
digitalnomad91 Jul 22, 2025
da9a9d5
Fixing exiting container.
digitalnomad91 Jul 22, 2025
56589e2
Fix for redis config object/string error.
digitalnomad91 Aug 5, 2025
2cb9b87
Moved metadata model to job model file to fix circular dependency error.
digitalnomad91 Aug 5, 2025
0df7393
Deleted job-metadata model file.
digitalnomad91 Aug 5, 2025
25fbf14
Updated aut-generated files.
digitalnomad91 Aug 5, 2025
28e9d77
Fixed circular dependency error.
digitalnomad91 Aug 5, 2025
f34ed0c
Removed graphql job models for now.
digitalnomad91 Aug 6, 2025
a2de2e8
Re-generated metadata w/ job models removed.
digitalnomad91 Aug 6, 2025
0de9d64
Added redis-server container to docker container stack.
digitalnomad91 Aug 6, 2025
1a757de
Updated redis factory to use config values + ssl / password.
digitalnomad91 Aug 6, 2025
669a073
Added vebugging to check where nestjs process is making it to in docker.
digitalnomad91 Aug 7, 2025
8827d6c
Debugging why container isn't starting nestjs.
digitalnomad91 Aug 7, 2025
c26f997
Added external to volume for pg db.
digitalnomad91 Aug 7, 2025
cab63f9
Added step in workflow to check if postgres docker volume exists & cr…
digitalnomad91 Aug 7, 2025
4a17897
Moved volume creation to before container creation.
digitalnomad91 Aug 7, 2025
39c4fc1
Fixing redis dependency issue by adding redis module to global common…
digitalnomad91 Aug 7, 2025
e35f5a0
Updated docker forwarding port to 4001.
digitalnomad91 Aug 7, 2025
0110190
Prettier + Added google authentication validation + A LOT of other ch…
digitalnomad91 Aug 27, 2025
b37e72a
Prettier + Added google authentication validation + A LOT of other ch…
digitalnomad91 Aug 27, 2025
71dfc4d
Update prisma sub-module to latest commit.
digitalnomad91 Sep 3, 2025
a8346aa
Added prisma submodule check to fix docker build cache issue when cop…
digitalnomad91 Sep 3, 2025
90c0923
Updated prisma build flow (again).
digitalnomad91 Sep 3, 2025
dbd3543
Trying to fix prisma sub-module + docker + action workflow + typescri…
digitalnomad91 Sep 3, 2025
ddce9f3
Disabling cache on docker build for now (f*** it).
digitalnomad91 Sep 3, 2025
d974fe0
Re-added stupid chatgpt forgetfulness (copy prisma folder).
digitalnomad91 Sep 3, 2025
c48b1a1
Fix prisma schema issues by recursively checking out submodules in Gi…
digitalnomad91 Sep 3, 2025
9b44971
Updated database servce to extend prisma & added super init.
digitalnomad91 Sep 8, 2025
37af2fa
Updated port to 4000.
digitalnomad91 Sep 8, 2025
be3e8d7
Updated port to 4000.
digitalnomad91 Sep 8, 2025
b1e5e1b
Moved auth module to project root folder.
digitalnomad91 Sep 8, 2025
d2f60d2
Moved auth files.
digitalnomad91 Sep 8, 2025
4a80f09
Updated auth import to new path.
digitalnomad91 Sep 8, 2025
c704888
Updated import path for auth.
digitalnomad91 Sep 8, 2025
a970392
New generated metadata file (import path updates for auth).
digitalnomad91 Sep 8, 2025
6ccf76a
Updated import path.
digitalnomad91 Sep 8, 2025
863c3a6
Auto-generated again to fix old path error.
digitalnomad91 Sep 8, 2025
8157241
config: add .env.local precedence and adjust default port to 4000
digitalnomad91 Sep 11, 2025
c5d0688
decorators: introduce unified Api decorator with envelope/pagination …
digitalnomad91 Sep 11, 2025
e26a6b7
pagination: add unified PageInfo, PaginatedResponse factory, and pagi…
digitalnomad91 Sep 11, 2025
a951be2
response: add ResponseEnvelopeInterceptor and standardize error envel…
digitalnomad91 Sep 11, 2025
01c1c48
jobs: refactor controllers/services to use unified pagination and aut…
digitalnomad91 Sep 11, 2025
5ec1600
notifications: introduce global notifications module and migrate job …
digitalnomad91 Sep 11, 2025
faa0842
controllers: apply envelope option to auth, user, and root controller…
digitalnomad91 Sep 11, 2025
d226aad
style: format changed files with Prettier and exclude .vscode/setting…
digitalnomad91 Sep 11, 2025
619891c
feat: add location and errors endpoints (formatted)
digitalnomad91 Sep 11, 2025
50a3897
feat(jobs,notifications): add job existence short-circuiting and subs…
digitalnomad91 Sep 11, 2025
bc1ad79
chore(gitignore): ignore vscode settings and google service account key
digitalnomad91 Sep 11, 2025
5c1de52
fix: remove early stop logic in Reddit job fetching to process all ne…
digitalnomad91 Sep 18, 2025
13e32f8
fix: remove early stop logic in Web3Career job fetching to process al…
digitalnomad91 Sep 18, 2025
f916f1b
fix: add automatic string-to-number transformation for pagination par…
digitalnomad91 Sep 18, 2025
7c63357
refactor: remove redundant manual pagination parameter parsing from j…
digitalnomad91 Sep 18, 2025
19d2420
Apply suggestion from @Copilot
digitalnomad91 Sep 19, 2025
dd4e617
Apply suggestion from @Copilot
digitalnomad91 Sep 19, 2025
6e7d2d1
Update src/wss/wss.gateway.ts
digitalnomad91 Sep 19, 2025
a6c892c
Update src/wss/wss.gateway.ts
digitalnomad91 Sep 19, 2025
dad9625
Update src/wss/wss.gateway.ts
digitalnomad91 Sep 19, 2025
9be1b7e
Update src/events/events.gateway.ts
digitalnomad91 Sep 19, 2025
eb4b460
Update src/users/user.controller.ts
digitalnomad91 Sep 19, 2025
aece33d
Merge branch 'main' into fix/job-fetching-and-pagination
digitalnomad91 Sep 19, 2025
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
4 changes: 4 additions & 0 deletions src/common/pagination/pagination.args.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
import { ArgsType } from '@nestjs/graphql';
import { Type } from 'class-transformer';
import { Field } from '../decorators/field.decorator';

@ArgsType()
export class PaginationArgs {
@Type(() => Number)
@Field({
name: 'skip',
description: 'Number of records to skip (offset based pagination).',
Expand Down Expand Up @@ -36,6 +38,7 @@ export class PaginationArgs {
})
before?: string;

@Type(() => Number)
@Field({
name: 'first',
description: 'Max number of items to return going forward from the cursor.',
Expand All @@ -47,6 +50,7 @@ export class PaginationArgs {
})
first?: number;

@Type(() => Number)
@Field({
name: 'last',
description: 'Max number of items to return going backward from the cursor.',
Expand Down
10 changes: 1 addition & 9 deletions src/events/events.gateway.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,26 +32,22 @@ export class EventsGateway implements OnGatewayConnection, OnGatewayDisconnect {
server: Server;

private getClientQuery(client: Socket): Record<string, unknown> {
console.log('wtf121212');
return client.handshake.query;
}

public broadcastAll(event_name: string, message: Record<string, unknown>) {
console.log('assdasda');
this.server.emit(event_name, message);
}

public handleConnection(client: Socket) {
console.log('whaaaat');
const { user_id } = this.getClientQuery(client);

console.log('WssGateway: handleConnection', { user_id });

return this.broadcastAll('event', { connected: user_id });
}

public handleDisconnect(client: Socket) {
console.log('hwathwat');
const { user_id } = this.getClientQuery(client);

console.log('WssGateway: handleDisconnect', { user_id });
Expand All @@ -61,21 +57,17 @@ export class EventsGateway implements OnGatewayConnection, OnGatewayDisconnect {

@SubscribeMessage('tick')
handleEvent(@MessageBody() data: unknown, @ConnectedSocket() client: Socket): WsResponse<unknown> {
console.log('wtf111');
const event = 'events';
return { event, data };
}

@SubscribeMessage('tick')
findAll(@MessageBody() data: any): Observable<WsResponse<number>> {
console.log('wtf222");');
return from([1, 2, 3]).pipe(map((item) => ({ event: 'events', data: item })));
}

@SubscribeMessage('identity')
identity(@MessageBody() data: number): number {
console.log('wtf23232');

return data;
}
}
36 changes: 3 additions & 33 deletions src/jobs/job.controller.ts
Original file line number Diff line number Diff line change
Expand Up @@ -101,18 +101,8 @@ export class JobController {
async findByCompany(
@Param('companyId', ParseIntPipe) companyId: number,
@Query() paginationArgs: PaginationArgs,
@Query() orderBy: JobOrderByDto,
@Query('skip') skipParam?: string,
@Query('first') firstParam?: string
@Query() orderBy: JobOrderByDto
) {
// Ensure pagination parameters are properly converted to numbers
if (skipParam) {
paginationArgs.skip = parseInt(skipParam, 10);
}
if (firstParam) {
paginationArgs.first = parseInt(firstParam, 10);
}

return this.jobService.findByCompany(companyId, paginationArgs, orderBy);
}

Expand All @@ -132,18 +122,8 @@ export class JobController {
async findByTag(
@Param('tagName') tagName: string,
@Query() paginationArgs: PaginationArgs,
@Query() orderBy: JobOrderByDto,
@Query('skip') skipParam?: string,
@Query('first') firstParam?: string
@Query() orderBy: JobOrderByDto
) {
// Ensure pagination parameters are properly converted to numbers
if (skipParam) {
paginationArgs.skip = parseInt(skipParam, 10);
}
if (firstParam) {
paginationArgs.first = parseInt(firstParam, 10);
}

return this.jobService.findByTag(tagName, paginationArgs, orderBy);
}

Expand Down Expand Up @@ -187,18 +167,8 @@ export class JobController {
@Query('companyId', new ParseIntPipe({ optional: true })) companyId?: number,
@Query('location') location?: string,
@Query('isRemote') isRemote?: boolean,
@Query('tags') tags?: string,
@Query('skip') skipParam?: string,
@Query('first') firstParam?: string
@Query('tags') tags?: string
) {
// Ensure pagination parameters are properly converted to numbers
if (skipParam) {
paginationArgs.skip = parseInt(skipParam, 10);
}
if (firstParam) {
paginationArgs.first = parseInt(firstParam, 10);
}

console.log('Pagination params:', { skip: paginationArgs.skip, first: paginationArgs.first });

return this.jobService.findAll({
Expand Down
7 changes: 3 additions & 4 deletions src/jobs/reddit.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -72,12 +72,11 @@ export class RedditService {
data: post,
},
};
// EARLY STOP: if this job already exists we assume all subsequent
// posts are older (API returns newest first) and can stop processing.
// Check if job already exists - if so, skip it but continue processing others
const exists = await this.jobService.jobExists(post.url);
if (exists) {
this.logger.log(`Encountered existing Reddit job ${post.url}; stopping further processing.`);
break;
this.logger.log(`Skipping existing Reddit job ${post.url}`);
continue;
}
const upsertedJob = await this.jobService.upsertJob(jobInput);
// Send notifications for new jobs
Expand Down
6 changes: 3 additions & 3 deletions src/jobs/web3career.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -52,11 +52,11 @@ export class Web3CareerService {
data: job,
},
};
// EARLY STOP: if job already exists assume remaining are older.
// Check if job already exists - if so, skip it but continue processing others
const exists = await this.jobService.jobExists(job.apply_url);
if (exists) {
this.logger.log(`Encountered existing Web3Career job ${job.apply_url}; stopping further processing.`);
break;
this.logger.log(`Skipping existing Web3Career job ${job.apply_url}`);
continue;
}
const upserted = await this.jobService.upsertJob(jobInput);
newJobs.push(upserted);
Expand Down
2 changes: 1 addition & 1 deletion src/users/user.controller.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ export class UserController {
@UseGuards(RedisAuthGuard)
@Get('/wallet/:token/sell')
@Api({ summary: 'Example secured endpoint', description: 'Placeholder user wallet endpoint.', envelope: true })
walletTokenSell(@Param('username') _username: string) {
walletTokenSell(@Param('token') token: string) {
return { message: 'Not yet implemented' };
}
}
2 changes: 1 addition & 1 deletion src/users/user.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ export class UserService {
const hashedPassword = await this.passwordService.hashPassword(changePassword.newPassword);

return this.prisma.user.update({
data: {},
data: { password: hashedPassword },
where: { id: userId },
});
}
Expand Down
1 change: 0 additions & 1 deletion src/wss/wss.adapter.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@ export class CustomRedisIoAdapter extends IoAdapter {
}

public createIOServer(port: number, options?: ServerOptions): Server {
//console.log('wut the fuck');
const server = super.createIOServer(port, {
...options,
cors: cors_options_delegate,
Expand Down
6 changes: 1 addition & 5 deletions src/wss/wss.gateway.ts
Original file line number Diff line number Diff line change
Expand Up @@ -35,18 +35,14 @@ export class WssGateway implements OnGatewayConnection, OnGatewayDisconnect {
constructor(private readonly logService: LogService) {}

private getClientQuery(client: io.Socket): { [key: string]: string } {
console.log('ASDASDASD');
return client.handshake.query as { [key: string]: string };
}

public broadcastAll(event_name: string, message: Record<string, unknown>) {
console.log('sadadsdasdasd');
this.server.emit(event_name, message);
}

handleConnection(client: io.Socket) {
console.log('wtf');
client.join('msgRoom');
handleConnection(client: io.Socket) { client.join('msgRoom');
const { user_id } = this.getClientQuery(client);

this.logService.info(`WssGateway: handleConnection ${user_id}`);
Expand Down