mirror of
https://github.com/ershisan99/vacancies-trends-front.git
synced 2026-01-31 21:02:07 +00:00
initial commit
This commit is contained in:
56
app/services/vacancies/vacancies.constants.ts
Normal file
56
app/services/vacancies/vacancies.constants.ts
Normal file
@@ -0,0 +1,56 @@
|
||||
export const KEYWORDS = {
|
||||
BACKEND: [
|
||||
'.net',
|
||||
'asp.net',
|
||||
'django',
|
||||
'express',
|
||||
'go',
|
||||
'java',
|
||||
'laravel',
|
||||
'nest.js',
|
||||
'nestjs',
|
||||
'node.js',
|
||||
'php',
|
||||
],
|
||||
DATABASES: ['mysql', 'cassandra', 'firebase', 'mongodb', 'postgres', 'redis', 'sqlite'],
|
||||
DEVOPS: ['ansible', 'jenkins', 'docker', 'kubernetes', 'terraform'],
|
||||
get FRONTEND() {
|
||||
return [
|
||||
...new Set([
|
||||
...this.FRONTEND_FRAMEWORK,
|
||||
...this.STYLES,
|
||||
...this.STATE_MANAGEMENT,
|
||||
...this.TESTING,
|
||||
'fsd',
|
||||
]),
|
||||
]
|
||||
},
|
||||
FRONTEND_FRAMEWORK: [
|
||||
'angular',
|
||||
'jquery',
|
||||
'next.js',
|
||||
'nextjs',
|
||||
'nuxt',
|
||||
'react',
|
||||
'remix',
|
||||
'svelte',
|
||||
'vue',
|
||||
],
|
||||
MOBILE: ['flutter', 'kotlin', 'swift', 'react native', 'xamarin'],
|
||||
ORM: ['prisma', 'sequelize', 'drizzle', 'typeorm'],
|
||||
STATE_MANAGEMENT: [
|
||||
'effector',
|
||||
'mobx',
|
||||
'react-query',
|
||||
'redux toolkit query',
|
||||
'redux toolkit',
|
||||
'redux',
|
||||
'rtk',
|
||||
],
|
||||
STYLES: ['material ui', 'mui', 'styled-components', 'tailwind', 'bootstrap', 'css', 'sass'],
|
||||
TESTING: ['cypress', 'jasmine', 'playwright', 'puppeteer', 'selenium', 'vitest', 'jest', 'mocha'],
|
||||
} as const
|
||||
|
||||
export const ALL_KEYWORDS = [...new Set(Object.values(KEYWORDS).flat().sort())]
|
||||
|
||||
export type Keyword = (typeof ALL_KEYWORDS)[number]
|
||||
23
app/services/vacancies/vacancies.service.ts
Normal file
23
app/services/vacancies/vacancies.service.ts
Normal file
@@ -0,0 +1,23 @@
|
||||
import { Vacancies, VacancyData } from '~/services/vacancies/vacancies.types'
|
||||
|
||||
export class VacanciesService {
|
||||
async getAll(): Promise<Vacancies> {
|
||||
return await fetch('http://localhost:4321/vacancies').then(res => res.json())
|
||||
}
|
||||
async getAggregateByCreatedAt(): Promise<VacancyData> {
|
||||
return await fetch('http://localhost:4321/vacancies/aggregated')
|
||||
.then(res => res.json())
|
||||
.then(this.formatDateOnData)
|
||||
}
|
||||
|
||||
formatDateOnData(data: VacancyData): VacancyData {
|
||||
return data.map(item => {
|
||||
return {
|
||||
...item,
|
||||
date: new Date(item.date).toLocaleTimeString('ru'),
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
export const vacanciesService = new VacanciesService()
|
||||
11
app/services/vacancies/vacancies.types.ts
Normal file
11
app/services/vacancies/vacancies.types.ts
Normal file
@@ -0,0 +1,11 @@
|
||||
export type Vacancies = VacancyDataEntry[]
|
||||
|
||||
export interface VacancyDataEntry {
|
||||
createdAt: string
|
||||
id: number
|
||||
technology: string
|
||||
updatedAt: string
|
||||
vacancies: number
|
||||
}
|
||||
|
||||
export type VacancyData = Array<{ date: string; [key: string]: string | number }>
|
||||
Reference in New Issue
Block a user