Skip to content

Themaoqiu/Approval-MIS

Repository files navigation

Approval MIS

Getting Started

Install PostgreSQL 16

  1. Check the link: PostgreSQL 安装教程
  2. Verify Installation: Open cmd and run
psql --version
  1. Create a database: Open cmd and run
# Create a new database user 'app_user' with the password '12345'
psql -d postgres -c "CREATE USER app_user WITH PASSWORD '12345';"

# Transfer ownership of the 'approval_mis' database to 'app_user' so this user has full control
psql -d postgres -c "ALTER DATABASE approval_mis OWNER TO app_user;"

Install Bun

  1. Check the link: Bun 安装
  2. Verify Installation: Open cmd and run
bun --version

Create .env file

DATABASE_URL="postgresql://app_user:12345@localhost:5432/approval_mis"
BETTER_AUTH_SECRET="your_secret_key"
BETTER_AUTH_URL="http://localhost:3000"

Install and run:

  1. Initialize the database (one command):
# Install dependencies
bun install

# Apply migrations and seed database automatically
bunx prisma migrate dev --name init

# Insert test data
bunx tsx prisma/seed.ts
  1. Start development server:
bun dev
  1. (Optional) View the database in Prisma Studio:
bunx prisma studio

About

上海电力大学信管专业web2.0程序设计大作业

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages