core dependencies installed
This commit is contained in:
parent
31596e2478
commit
610955871f
11 changed files with 2111 additions and 19 deletions
5
.gitignore
vendored
5
.gitignore
vendored
|
|
@ -42,4 +42,7 @@ Thumbs.db
|
||||||
.nx/workspace-data
|
.nx/workspace-data
|
||||||
|
|
||||||
vite.config.*.timestamp*
|
vite.config.*.timestamp*
|
||||||
vitest.config.*.timestamp*
|
vitest.config.*.timestamp*
|
||||||
|
|
||||||
|
# Env Files
|
||||||
|
.env
|
||||||
|
|
|
||||||
2
apps/backend/.env.sample
Normal file
2
apps/backend/.env.sample
Normal file
|
|
@ -0,0 +1,2 @@
|
||||||
|
DATABASE_URL=postgres://USER:PASS@HOST:PORT/DB
|
||||||
|
SECRET=SECRET
|
||||||
10
apps/backend/drizzle.config.ts
Normal file
10
apps/backend/drizzle.config.ts
Normal file
|
|
@ -0,0 +1,10 @@
|
||||||
|
import { defineConfig } from 'drizzle-kit';
|
||||||
|
|
||||||
|
export default defineConfig({
|
||||||
|
out: './drizzle',
|
||||||
|
schema: './src/db/schema.ts',
|
||||||
|
dialect: 'postgresql',
|
||||||
|
dbCredentials: {
|
||||||
|
url: process.env.DATABASE_URL!,
|
||||||
|
},
|
||||||
|
});
|
||||||
7
apps/backend/drizzle/0000_nosy_khan.sql
Normal file
7
apps/backend/drizzle/0000_nosy_khan.sql
Normal file
|
|
@ -0,0 +1,7 @@
|
||||||
|
CREATE TABLE "users" (
|
||||||
|
"id" integer PRIMARY KEY GENERATED ALWAYS AS IDENTITY (sequence name "users_id_seq" INCREMENT BY 1 MINVALUE 1 MAXVALUE 2147483647 START WITH 1 CACHE 1),
|
||||||
|
"name" varchar(255) NOT NULL,
|
||||||
|
"email" varchar(255) NOT NULL,
|
||||||
|
"hashed_password" varchar(255) NOT NULL,
|
||||||
|
CONSTRAINT "users_email_unique" UNIQUE("email")
|
||||||
|
);
|
||||||
75
apps/backend/drizzle/meta/0000_snapshot.json
Normal file
75
apps/backend/drizzle/meta/0000_snapshot.json
Normal file
|
|
@ -0,0 +1,75 @@
|
||||||
|
{
|
||||||
|
"id": "ab4786f8-f96f-4950-b271-caa6ee1c5370",
|
||||||
|
"prevId": "00000000-0000-0000-0000-000000000000",
|
||||||
|
"version": "7",
|
||||||
|
"dialect": "postgresql",
|
||||||
|
"tables": {
|
||||||
|
"public.users": {
|
||||||
|
"name": "users",
|
||||||
|
"schema": "",
|
||||||
|
"columns": {
|
||||||
|
"id": {
|
||||||
|
"name": "id",
|
||||||
|
"type": "integer",
|
||||||
|
"primaryKey": true,
|
||||||
|
"notNull": true,
|
||||||
|
"identity": {
|
||||||
|
"type": "always",
|
||||||
|
"name": "users_id_seq",
|
||||||
|
"schema": "public",
|
||||||
|
"increment": "1",
|
||||||
|
"startWith": "1",
|
||||||
|
"minValue": "1",
|
||||||
|
"maxValue": "2147483647",
|
||||||
|
"cache": "1",
|
||||||
|
"cycle": false
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"name": {
|
||||||
|
"name": "name",
|
||||||
|
"type": "varchar(255)",
|
||||||
|
"primaryKey": false,
|
||||||
|
"notNull": true
|
||||||
|
},
|
||||||
|
"email": {
|
||||||
|
"name": "email",
|
||||||
|
"type": "varchar(255)",
|
||||||
|
"primaryKey": false,
|
||||||
|
"notNull": true
|
||||||
|
},
|
||||||
|
"hashed_password": {
|
||||||
|
"name": "hashed_password",
|
||||||
|
"type": "varchar(255)",
|
||||||
|
"primaryKey": false,
|
||||||
|
"notNull": true
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"indexes": {},
|
||||||
|
"foreignKeys": {},
|
||||||
|
"compositePrimaryKeys": {},
|
||||||
|
"uniqueConstraints": {
|
||||||
|
"users_email_unique": {
|
||||||
|
"name": "users_email_unique",
|
||||||
|
"nullsNotDistinct": false,
|
||||||
|
"columns": [
|
||||||
|
"email"
|
||||||
|
]
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"policies": {},
|
||||||
|
"checkConstraints": {},
|
||||||
|
"isRLSEnabled": false
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"enums": {},
|
||||||
|
"schemas": {},
|
||||||
|
"sequences": {},
|
||||||
|
"roles": {},
|
||||||
|
"policies": {},
|
||||||
|
"views": {},
|
||||||
|
"_meta": {
|
||||||
|
"columns": {},
|
||||||
|
"schemas": {},
|
||||||
|
"tables": {}
|
||||||
|
}
|
||||||
|
}
|
||||||
13
apps/backend/drizzle/meta/_journal.json
Normal file
13
apps/backend/drizzle/meta/_journal.json
Normal file
|
|
@ -0,0 +1,13 @@
|
||||||
|
{
|
||||||
|
"version": "7",
|
||||||
|
"dialect": "postgresql",
|
||||||
|
"entries": [
|
||||||
|
{
|
||||||
|
"idx": 0,
|
||||||
|
"version": "7",
|
||||||
|
"when": 1743489468386,
|
||||||
|
"tag": "0000_nosy_khan",
|
||||||
|
"breakpoints": true
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
11
apps/backend/src/db/index.ts
Normal file
11
apps/backend/src/db/index.ts
Normal file
|
|
@ -0,0 +1,11 @@
|
||||||
|
import 'dotenv/config';
|
||||||
|
import { drizzle } from 'drizzle-orm/node-postgres';
|
||||||
|
|
||||||
|
const db = drizzle({
|
||||||
|
connection: {
|
||||||
|
connectionString: process.env.DATABASE_URL!,
|
||||||
|
ssl: true,
|
||||||
|
},
|
||||||
|
});
|
||||||
|
|
||||||
|
export default db;
|
||||||
8
apps/backend/src/db/schema.ts
Normal file
8
apps/backend/src/db/schema.ts
Normal file
|
|
@ -0,0 +1,8 @@
|
||||||
|
import { integer, pgTable, varchar } from 'drizzle-orm/pg-core';
|
||||||
|
|
||||||
|
export const usersTable = pgTable('users', {
|
||||||
|
id: integer().primaryKey().generatedAlwaysAsIdentity(),
|
||||||
|
name: varchar({ length: 255 }).notNull(),
|
||||||
|
email: varchar({ length: 255 }).notNull().unique(),
|
||||||
|
hashed_password: varchar({ length: 255 }).notNull(),
|
||||||
|
});
|
||||||
|
|
@ -1,4 +1,5 @@
|
||||||
import { Route, Routes, Link } from 'react-router-dom';
|
import { Route, Routes, Link } from 'react-router-dom';
|
||||||
|
import 'material-symbols';
|
||||||
|
|
||||||
export function App() {
|
export function App() {
|
||||||
return (
|
return (
|
||||||
|
|
@ -18,7 +19,10 @@ export function App() {
|
||||||
path="/"
|
path="/"
|
||||||
element={
|
element={
|
||||||
<div>
|
<div>
|
||||||
This is the generated root route.{' '}
|
<div className="flex italic">
|
||||||
|
<span className="material-symbols-outlined">house</span>
|
||||||
|
This is the generated root route.
|
||||||
|
</div>
|
||||||
<Link to="/page-2">Click here for page 2.</Link>
|
<Link to="/page-2">Click here for page 2.</Link>
|
||||||
</div>
|
</div>
|
||||||
}
|
}
|
||||||
|
|
|
||||||
1982
package-lock.json
generated
1982
package-lock.json
generated
File diff suppressed because it is too large
Load diff
11
package.json
11
package.json
|
|
@ -5,10 +5,17 @@
|
||||||
"scripts": {},
|
"scripts": {},
|
||||||
"private": true,
|
"private": true,
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
|
"argon2": "^0.41.1",
|
||||||
|
"axios": "^1.8.4",
|
||||||
|
"drizzle-orm": "^0.41.0",
|
||||||
"express": "^4.21.2",
|
"express": "^4.21.2",
|
||||||
|
"material-symbols": "^0.29.2",
|
||||||
|
"pg": "^8.14.1",
|
||||||
"react": "19.0.0",
|
"react": "19.0.0",
|
||||||
"react-dom": "19.0.0",
|
"react-dom": "19.0.0",
|
||||||
"react-router-dom": "6.29.0"
|
"react-router-dom": "6.29.0",
|
||||||
|
"zod": "^3.24.2",
|
||||||
|
"zustand": "^5.0.3"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@nx/esbuild": "20.6.4",
|
"@nx/esbuild": "20.6.4",
|
||||||
|
|
@ -23,11 +30,13 @@
|
||||||
"@swc/helpers": "~0.5.11",
|
"@swc/helpers": "~0.5.11",
|
||||||
"@types/express": "^4.17.21",
|
"@types/express": "^4.17.21",
|
||||||
"@types/node": "^20.0.0",
|
"@types/node": "^20.0.0",
|
||||||
|
"@types/pg": "^8.11.11",
|
||||||
"@types/react": "19.0.0",
|
"@types/react": "19.0.0",
|
||||||
"@types/react-dom": "19.0.0",
|
"@types/react-dom": "19.0.0",
|
||||||
"@vitejs/plugin-react": "^4.2.0",
|
"@vitejs/plugin-react": "^4.2.0",
|
||||||
"@vitest/ui": "^3.0.0",
|
"@vitest/ui": "^3.0.0",
|
||||||
"autoprefixer": "10.4.13",
|
"autoprefixer": "10.4.13",
|
||||||
|
"drizzle-kit": "^0.30.6",
|
||||||
"esbuild": "^0.19.2",
|
"esbuild": "^0.19.2",
|
||||||
"jiti": "2.4.2",
|
"jiti": "2.4.2",
|
||||||
"jsdom": "~22.1.0",
|
"jsdom": "~22.1.0",
|
||||||
|
|
|
||||||
Reference in a new issue