Skip to content
Merged
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
24 changes: 24 additions & 0 deletions eslint.config.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -161,6 +161,30 @@ export default tseslint.config(
},
},

{
files: ['src/app/ui/**/*.{ts,tsx}', 'src/modules/ui/**/*.{ts,tsx}'],
rules: {
'no-restricted-imports': [
'error',
{
patterns: ['@api/*'],
},
],
},
},

{
files: ['src/app/api/**/*.{ts,tsx}', 'src/modules/api/**/*.{ts,tsx}'],
rules: {
'no-restricted-imports': [
'error',
{
patterns: ['@ui/*'],
},
],
},
},

{
files: ['**/*.test.ts', '**/*.spec.ts', '**/*.test.tsx', '**/*.spec.tsx'],
plugins: {jest: eslintPluginJest},
Expand Down
17 changes: 0 additions & 17 deletions prisma/schema.prisma
Original file line number Diff line number Diff line change
Expand Up @@ -7,20 +7,3 @@ datasource db {
provider = "postgresql"
url = env("DATABASE_URL")
}

model MasterAccount {
id String @id @default(uuid())
email String @unique
password String
createdAt DateTime @default(now())
credentials Credential[]
}

model Credential {
id String @id @default(uuid())
label String
secret String
createdAt DateTime @default(now())
masterAccount MasterAccount @relation(fields: [masterAccountId], references: [id], onDelete: Cascade)
masterAccountId String
}
File renamed without changes.
1 change: 0 additions & 1 deletion public/file.svg

This file was deleted.

1 change: 0 additions & 1 deletion public/globe.svg

This file was deleted.

1 change: 0 additions & 1 deletion public/next.svg

This file was deleted.

1 change: 0 additions & 1 deletion public/vercel.svg

This file was deleted.

1 change: 0 additions & 1 deletion public/window.svg

This file was deleted.

39 changes: 0 additions & 39 deletions src/app/api/users/route.ts

This file was deleted.

15 changes: 0 additions & 15 deletions src/app/ui/hello-world/layout.tsx

This file was deleted.

38 changes: 0 additions & 38 deletions src/app/ui/hello-world/page.tsx

This file was deleted.

39 changes: 12 additions & 27 deletions src/app/ui/layout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@ import type { Metadata } from 'next';
import type { JSX } from 'react';
import React from 'react';
import ThemeRegistry from '@ui/providers/ThemeRegistry';
import { AppBar, Box, Container, Toolbar, Typography } from '@mui/material';
import { AppBar, Container, Toolbar, Typography } from '@mui/material';
import PageContainer from '@ui/components/common/PageContainer';

export const metadata: Metadata = {
title: {
Expand All @@ -19,34 +20,18 @@ export default function RootLayout({
}): JSX.Element {
return (
// eslint-disable-next-line no-restricted-syntax
<html lang="en">
<html lang="en" style={{ height: '100%' }}>
{/* eslint-disable-next-line no-restricted-syntax */}
<body>
<body style={{ height: '100%', margin: 0 }}>
<ThemeRegistry>
<Box className="foobarbaz">
<AppBar position="static" component="header">
<Toolbar>
<Typography variant="h6">Locklite</Typography>
</Toolbar>
</AppBar>
<Container
component="main"
maxWidth="md"
sx={{ flexGrow: 1, py: 4 }}
>
{children}
</Container>
<Box
component="footer"
sx={{
py: 2,
textAlign: 'center',
bgcolor: 'grey.100',
}}
>
© {new Date().getFullYear()} Locklite
</Box>
</Box>
<AppBar position={'sticky'} component="header">
<Toolbar>
<Typography variant="h6">Locklite</Typography>
</Toolbar>
</AppBar>
<Container component="main">
<PageContainer>{children}</PageContainer>
</Container>
</ThemeRegistry>
</body>
</html>
Expand Down
7 changes: 1 addition & 6 deletions src/app/ui/page.tsx
Original file line number Diff line number Diff line change
@@ -1,11 +1,6 @@
import React from 'react';
import type { JSX } from 'react';
import { Box, Typography } from '@mui/material';

export default function Home(): JSX.Element {
return (
<Box>
<Typography>homepage</Typography>
</Box>
);
return <></>;
}
Empty file.
17 changes: 0 additions & 17 deletions src/modules/api/adapters/user.adapter.ts

This file was deleted.

8 changes: 0 additions & 8 deletions src/modules/api/errors/users-not-found.error.ts

This file was deleted.

Empty file.
10 changes: 0 additions & 10 deletions src/modules/api/repositories/user.repository.ts

This file was deleted.

Empty file.
27 changes: 0 additions & 27 deletions src/modules/api/usecases/users/get-all-users.usecase.ts

This file was deleted.

10 changes: 7 additions & 3 deletions src/modules/api/utils/handle-api-request.ts
Original file line number Diff line number Diff line change
@@ -1,16 +1,20 @@
import { HttpError } from '@api/errors/http-error';
import { HttpError } from '@api/errors/abstract/http-error';
import { StatusCodes } from 'http-status-codes';

export async function handleApiRequest<T>(
callback: () => Promise<T>
): Promise<Response> {
try {
const data: Awaited<T> = await callback();
return Response.json(data, { status: 200 });
return Response.json(data, { status: StatusCodes.OK });
} catch (error) {
if (error instanceof HttpError) {
return Response.json({ error: error.message }, { status: error.status });
}
console.error(error);
return Response.json({ error: 'Internal Server Error' }, { status: 500 });
return Response.json(
{ error: 'Internal Server Error' },
{ status: StatusCodes.INTERNAL_SERVER_ERROR }
);
}
}
Empty file.
25 changes: 0 additions & 25 deletions src/modules/shared/dto/models/user.model.dto.ts

This file was deleted.

18 changes: 0 additions & 18 deletions src/modules/shared/dto/responses/get-all-users.response.dto.ts

This file was deleted.

Loading