-
-
Save lejonmanen/d471f359f23ec9a7bd1c32c0545020ed to your computer and use it in GitHub Desktop.
Fullstack MERN with TypeScript
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Add your secrets here | |
CONNECTION_STRING=yes-here |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
npm init vite@latest | |
Välj React, TypeScript | |
cd mapp/ | |
npm i react-router-dom zustand cors express joi | |
npm i --save-dev @types/express | |
git init | |
Skapa filerna: .env, tsconfig.backend.json | |
Skapa mapparna: backendSrc, backendDist |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
"type": "module", | |
"scripts": { | |
"dev": "vite", | |
"build": "tsc -b && vite build", | |
"lint": "eslint .", | |
"preview": "vite preview", | |
"backend": "tsc --project tsconfig.backend.json && node --env-file .env ./backendDist/server.js" | |
}, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"compilerOptions": { | |
"target": "ES2022", | |
"lib": ["ES2023"], | |
"module": "ESNext", | |
"skipLibCheck": true, | |
/* Bundler mode */ | |
"moduleResolution": "bundler", | |
"isolatedModules": true, | |
"moduleDetection": "force", | |
"noEmit": false, | |
"outDir": "./backendDist/", | |
/* Linting */ | |
"strict": true, | |
"noUnusedLocals": true, | |
"noUnusedParameters": true, | |
"noFallthroughCasesInSwitch": true | |
}, | |
"include": ["backendSrc"] | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { defineConfig } from 'vite' | |
import react from '@vitejs/plugin-react-swc' | |
// https://vitejs.dev/config/ | |
export default defineConfig({ | |
plugins: [react()], | |
server: { | |
proxy: { | |
'/api': { | |
target: 'http://localhost:1337/' | |
} | |
} | |
} | |
}) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment