Skip to content
Snippets Groups Projects
Commit 57a51a2f authored by satwikShresth's avatar satwikShresth
Browse files

adding information right inside the justfile

parent 87bee17b
Branches
No related tags found
No related merge requests found
# Tool Dependency Checker and Project Setup
# Usage: just check-all or just setup-all
# Default recipe (runs when just is called with no arguments)
default:
@echo "Available commands:"
......@@ -99,6 +100,11 @@ start-development: setup-all
@echo "Starting development environment..."
docker compose up --build --watch
# Start testing environment
start-testing:
@echo "Starting testing environment..."
docker compose up --build
# Clean Docker containers, builds and volumes
clean:
@echo "Cleaning Docker resources..."
......@@ -133,14 +139,43 @@ gen-backend-client:
@echo "New client for backend generated"
# Generate a custom migration
gen-auth-client:
@echo "Generating new client for auth..."
cd frontend && npm run gen:auth:client
@echo "New client for auth generated"
#Print Admin
print-admin:
@echo "Email: admin@example.com"
@echo "Password: Password123"
# Function to open link
open *ARGS:
{{ browser_cmd }} {{ ARGS }}
# Function to open drizzle studio
open-drizzle-studio:
{{ browser_cmd }} {{ drizzle_studio }}
# Function to open redis insight
open-redis-insight:
{{ browser_cmd }} {{ redis_insight }}
# Function to open frontend
open-frontend:
{{ browser_cmd }} {{ frontend }}
# Function to open frontend
open-minio:
{{ browser_cmd }} {{ minio }}
# Individual checks available as separate commands
npm := "check-npm"
node := "check-node"
deno := "check-deno"
docker := "check-docker"
browser_cmd := if os_family() == "windows" { "start" } else if os() == "macos" { "open" } else { "xdg-open" }
drizzle_studio := "https://local.drizzle.studio"
redis_insight := "https://localhost:5540"
frontend := "https://localhost"
minio := "https://localhost:9001"
......@@ -2,6 +2,8 @@ import { Hono } from 'hono';
import * as path from '@std/path';
import { auth } from './auth/index.ts';
import { FilecontentRoutes, UserRoutes, WorkOrderRoutes } from '../routes/index.ts';
import { db, users } from '@db/index.ts';
import { eq } from 'drizzle-orm';
export const devHook = async (app: any, routes: any) => {
const { generateSpecs, openAPISpecs } = await import('hono-openapi');
......@@ -22,8 +24,27 @@ export const devHook = async (app: any, routes: any) => {
},
};
app.get('/openapi', openAPISpecs(routes, options));
auth.api
.createUser({
body: {
email: 'admin@example.com',
name: 'Admin',
password: 'Password123',
role: 'Admin',
},
})
.then(async ({ user }) => {
console.error('User has been created:', user);
return await db
.update(users)
.set({ emailVerified: true })
.where(eq(users.id, user.id))
.then(() => console.log('User created and verified successfully'))
.catch((error) => console.error('Error verifying user email:', error));
})
.catch(console.error);
app.get('/openapi', openAPISpecs(routes, options));
auth.api.generateOpenAPISchema()
.then((spec) =>
Deno.writeTextFileSync(
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment