Skip to content

Commit a98e2fa

Browse files
author
Dedakup
committed
refactor: Added Next.js and turbopack. In next commits planning to finaly refactor codebase. Initially Next.js will be deployed with Netlify or Vercel, then i will transition it to EC2
1 parent 2be8ac5 commit a98e2fa

File tree

21 files changed

+1535
-1760
lines changed

21 files changed

+1535
-1760
lines changed

frontend/.env.example

Lines changed: 20 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,20 @@
1-
DYNAMODB_TABLE_NAME=example-tasks
2-
VITE_API_BASE_URL=http://localhost:3000/example #https://example.execute-api.us-east-1.amazonaws.com/example
1+
# API Configuration
2+
NEXT_PUBLIC_API_BASE_URL=http://localhost:3000/dev
3+
NEXT_PUBLIC_PROD_API_URL=your_production_api_url
4+
5+
# Database Configuration
6+
NEXT_PUBLIC_DYNAMODB_TABLE_NAME=your_table_name
7+
8+
# Auth0 Configuration
9+
NEXT_PUBLIC_AUTH0_DOMAIN=your_auth0_domain
10+
NEXT_PUBLIC_AUTH0_CLIENT_ID=your_auth0_client_id
11+
NEXT_PUBLIC_AUTH0_AUDIENCE=your_auth0_audience
12+
13+
# Storybook Configuration
14+
NEXT_PUBLIC_CHROMATIC_PROJECT_TOKEN=your_chromatic_token
15+
16+
# Environment
17+
NEXT_PUBLIC_NODE_ENV=development
18+
19+
# AWS Configuration
20+
NEXT_PUBLIC_AWS_REGION=your_aws_region

frontend/.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,3 +32,6 @@ node_modules/
3232
*.sw?
3333

3434
*storybook.log
35+
36+
.next
37+
next-env.d.ts

frontend/eslint.config.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,8 +47,8 @@ export default [
4747
MutationObserver: true,
4848
CSS: true,
4949
process: 'readonly',
50-
__dirname: 'readonly'
51-
}
50+
__dirname: 'readonly',
51+
},
5252
},
5353
plugins: {
5454
'@typescript-eslint': tseslintPlugin,

frontend/index.html

Lines changed: 0 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +0,0 @@
1-
<!doctype html>
2-
<html lang="en">
3-
<head>
4-
<meta charset="UTF-8" />
5-
<link
6-
rel="icon"
7-
type="image/svg+xml"
8-
href="./public/focusflow-icon.svg"
9-
/>
10-
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
11-
<title>Focus Flow</title>
12-
</head>
13-
<body>
14-
<div id="root"></div>
15-
<script type="module" src="/src/index.jsx"></script>
16-
</body>
17-
</html>

frontend/next.config.mjs

Lines changed: 70 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,70 @@
1+
/** @type {import('next').NextConfig} */
2+
import process from 'process';
3+
4+
const nextConfig = {
5+
output: 'export',
6+
distDir: './build',
7+
experimental: {
8+
turbo: {
9+
rules: {
10+
// TypeScript/JavaScript
11+
'*.ts': {
12+
loaders: ['swc-loader'],
13+
as: '*.js',
14+
},
15+
'*.tsx': {
16+
loaders: ['swc-loader'],
17+
as: '*.js',
18+
},
19+
// CSS and Tailwind
20+
'*.css': {
21+
loaders: ['postcss-loader'],
22+
},
23+
'*.module.css': {
24+
loaders: ['postcss-loader'],
25+
},
26+
// Static assets
27+
'*.svg': {
28+
loaders: ['@svgr/webpack'],
29+
as: '*.js',
30+
},
31+
},
32+
33+
// Path aliases matching tsconfig
34+
resolveAlias: {
35+
'@': './src',
36+
'@app': './src/app',
37+
'@components': './src/components',
38+
'@features': './src/features',
39+
'@auth': './src/features/auth',
40+
'@background': './src/features/background',
41+
'@dashboard': './src/features/dashboard',
42+
'@music': './src/features/music',
43+
'@pomodoro': './src/features/pomodoro',
44+
'@sounds': './src/features/sounds',
45+
'@tasks': './src/features/tasks',
46+
'@shared': './src/shared',
47+
'@config': './src/shared/config',
48+
'@hooks': './src/shared/hooks',
49+
'@utils': './src/shared/utils',
50+
'@styles': './src/styles',
51+
},
52+
53+
resolveExtensions: [
54+
'.tsx',
55+
'.ts',
56+
'.jsx',
57+
'.js',
58+
'.json',
59+
'.css',
60+
'.module.css',
61+
],
62+
63+
moduleIdStrategy: process.env.NODE_ENV === 'development'
64+
? 'named'
65+
: 'deterministic',
66+
},
67+
},
68+
};
69+
70+
export default nextConfig;

0 commit comments

Comments
 (0)