A modern web application built with Next.js for managing and visualizing data through an interactive dashboard with multi-tenant support.
- Node.js 18+ and npm/yarn/pnpm
- PostgreSQL database (local or remote)
- Clone the repository
git clone [repository-url]
cd pluraedge- Install dependencies
npm install
# or
yarn install
# or
pnpm install- Set up environment variables
# Create a .env file in the root directory
cp .env.example .env- Configure the database connection in
.env:
DATABASE_URL="postgres://user:password@localhost:5432/pluraedge?sslmode=disable"
NEXTAUTH_SECRET="your-nextauth-secret"
NEXTAUTH_URL="http://localhost:3000"- Run database migrations
# Generate migrations (if you've made schema changes)
npm run db:generate
# Apply migrations
npm run db:migrate- Start the development server
npm run dev
# or
yarn dev
# or
pnpm dev- Open http://localhost:3000 in your browser
pluraedge/
├── public/ # Static assets
│ ├── file.svg
│ ├── globe.svg
│ ├── next.svg
│ └── vercel.svg
├── src/
│ ├── app/ # Next.js 13+ App Router
│ │ ├── (auth)/ # Authentication routes
│ │ ├── (dashboard)/ # Protected dashboard routes
│ │ └── api/ # API routes
│ ├── components/ # Reusable UI components
│ │ ├── auth/ # Authentication components
│ │ ├── dashboard/ # Dashboard specific components
│ │ └── shared/ # Shared UI components
│ ├── config/ # Application configuration
│ ├── constants/ # Application constants
│ ├── lib/
│ │ └── db/ # Database configuration and schema
│ │ ├── index.ts # Database client and utilities
│ │ └── schema.ts # Database schema definitions
│ └── styles/ # Global styles
├── drizzle/
│ └── migrations/ # Database migration files
├── .eslintrc.json # ESLint configuration
├── next.config.js # Next.js configuration
├── package.json # Project dependencies and scripts
└── tsconfig.json # TypeScript configuration
The application uses PostgreSQL with Drizzle ORM for database operations.
Key tables include:
subscription_plans- Available subscription plansorganizations- Tenant/organization informationusers- User accountsroles- User roles and permissionsapi_keys- API keys for programmatic accessaudit_logs- System audit trailuser_sessions- User session management
npm run db:generate- Generate new migration filesnpm run db:migrate- Run pending migrationsnpm run db:push- Push schema changes to databasenpm run db:studio- Launch Drizzle Studio for database management
Create a .env file in the root directory with the following variables:
# Database
DATABASE_URL="postgres://user:password@localhost:5432/pluraedge?sslmode=disable"
# Authentication
NEXTAUTH_SECRET="your-secret-key"
NEXTAUTH_URL="http://localhost:3000"
# Optional: For production
NODE_ENV="development"npm run dev- Start development servernpm run build- Build for productionnpm start- Start production servernpm run lint- Run ESLintnpm run db:studio- Launch Drizzle Studio (database GUI)
This project is licensed under the MIT License. │ │ ├── api/ # API routes │ │ ├── _components/ # App-specific components │ │ ├── _lib/ # App-specific utilities │ │ ├── globals.css # Global styles │ │ └── layout.tsx # Root layout │ │ │ ├── components/ # Reusable UI components │ │ ├── auth/ # Auth components │ │ ├── dashboard/ # Dashboard components │ │ │ ├── features/ # Feature-specific components │ │ │ ├── layout/ # Layout components │ │ │ └── widgets/ # Reusable widgets │ │ ├── ui/ # Base UI components │ │ └── shared/ # Shared components │ │ │ ├── config/ # App configuration │ ├── constants/ # App constants │ ├── context/ # React context providers │ ├── hooks/ # Custom React hooks │ ├── lib/ # Shared utilities │ ├── styles/ # Global styles and themes │ ├── types/ # TypeScript type definitions │ └── utils/ # Utility functions │ ├── .gitignore ├── README.md ├── components.json # UI components configuration ├── eslint.config.mjs # ESLint configuration ├── next.config.ts # Next.js configuration ├── package-lock.json ├── package.json # Project dependencies ├── postcss.config.mjs # PostCSS configuration └── tsconfig.json # TypeScript configuration
## 🛠️ Development
### Available Scripts
- `dev` - Start development server
- `build` - Build for production
- `start` - Start production server
- `lint` - Run ESLint
## 📋 Todo / In Progress
- [ ] Complete authentication flow
- [ ] Implement dashboard layout and navigation
- [ ] Add data visualization components
- [ ] Set up API routes for data fetching
- [ ] Implement user settings page
- [ ] Add responsive design improvements
- [ ] Write unit and integration tests
## 📄 License
This project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details.