Prerequisites
Before you begin, ensure you have the following installed:- Node.js: Version 18.x or higher
- pnpm: Package manager (recommended) or npm/yarn
- MariaDB/MySQL: Version 10.6 or higher
- Git: For cloning the repository
This guide uses
pnpm as the package manager. You can also use npm or yarn by replacing pnpm commands accordingly.Getting Started
Follow these steps to get Beils Dashboard running on your local machine:Install Dependencies
Install all required packages using pnpm:This will install all dependencies including:
- Nuxt 4 framework and modules
- Prisma ORM and MariaDB adapter
- Vue Query for data fetching
- Authentication libraries (bcryptjs, jsonwebtoken)
- UI libraries (Tailwind CSS, DaisyUI, Lucide icons)
Configure Database
Create a MariaDB/MySQL database for the application:Create a
.env file in the project root with your database credentials:.env
Generate Prisma Client
Generate the Prisma client based on your schema:This creates the type-safe Prisma client for database operations.
Run Database Migrations
Apply the database schema to your MariaDB database:This creates all necessary tables, indexes, and relationships defined in the Prisma schema.
Seed the Database
Populate the database with sample data:This creates:
- 25 sample users (1 admin, 2 staff, 22 clients)
- 2 brands (Masglo, Bioline Jato)
- Client consents, questionnaires, and bookings
- Random appointments across past and future dates
Start the Development Server
Launch the Nuxt development server:The application will be available at
http://localhost:3000Log In to the Dashboard
Open your browser and navigate to
http://localhost:3000Use the admin credentials to log in:- Email:
[email protected] - Password:
password123
Your First Actions
Now that you’re logged in, here are some key actions to explore:1. View Clients
Navigate to Clientes (Clients) from the sidebar to see the list of seeded clients.Add a New Client
Click the “Add Client” button to create a new client profile with:
- Personal information (name, email, phone)
- Address and demographics
- Document type (DNI, Passport, NIE)
View Client Details
Click on any client to view their complete profile, including:
- Booking history
- Consent forms
- Questionnaires
- Debt status
2. Manage Appointments
Navigate to Agenda (Schedule) to view and manage appointments:- View upcoming and past bookings
- Create new appointments with client and staff assignment
- Update appointment status (pending, confirmed, completed, cancelled)
- Add notes for each booking
3. Browse the Product Catalog
Explore the Catálogo section:- Products
- Brands
- Categories
Manage your product inventory:
- Add products with SKU/barcode
- Set pricing and tax rates
- Track stock levels with minimum stock alerts
- Assign categories, subcategories, and brands
4. Create a Sale
Navigate to TPV (Point of Sale) to process transactions:The cart system automatically calculates subtotals, taxes, and final totals based on item prices and tax rates.
Available Scripts
Here are all the npm scripts available in Beils Dashboard:| Command | Description |
|---|---|
pnpm dev | Start development server with hot reload |
pnpm build | Build for production |
pnpm preview | Preview production build locally |
pnpm generate | Generate static site (SSG) |
pnpm postinstall | Prepare Nuxt (runs automatically after install) |
pnpm seed | Seed database with sample data |
pnpm prisma:generate | Generate Prisma client |
pnpm prisma:migrate | Run database migrations |
pnpm prisma:pull | Pull schema from existing database |
pnpm prisma:reset | Reset database and re-run migrations |
Understanding the Authentication Flow
Beils Dashboard uses JWT-based authentication:Credential Verification
Server validates credentials:
- Checks if user exists
- Verifies user status is “ON”
- Compares password hash using bcrypt
API Endpoints Overview
The platform exposes RESTful API endpoints organized by feature:Authentication
POST /api/auth/login- User loginGET /api/auth/me- Get current user profile
Clients
GET /api/clients- List all clients (with search)POST /api/clients- Create new clientPUT /api/clients/[id]- Update clientDELETE /api/clients/[id]- Delete client
Catalog
GET /api/catalog/brands- List brandsPOST /api/catalog/brands- Create brandGET /api/catalog/categories- List categoriesGET /api/catalog/products- List products
Agenda
GET /api/agenda/bookings- List bookingsPOST /api/agenda/bookings- Create bookingPUT /api/agenda/bookings/[id]- Update booking
Next Steps
Installation Guide
Learn about production deployment, environment variables, and advanced configuration
API Reference
Explore detailed API documentation for all endpoints
Troubleshooting
Database connection fails
Database connection fails
- Verify MariaDB/MySQL is running:
sudo systemctl status mariadb - Check database credentials in
.env - Ensure database exists:
SHOW DATABASES; - Check port is not blocked:
netstat -tuln | grep 3306
Prisma client errors
Prisma client errors
- Regenerate Prisma client:
pnpm prisma:generate - Clear node_modules and reinstall:
rm -rf node_modules && pnpm install - Check schema.prisma syntax for errors
Port 3000 already in use
Port 3000 already in use
- Change port in nuxt.config.ts:
- Or kill existing process:
lsof -ti:3000 | xargs kill
Login fails with correct credentials
Login fails with correct credentials
- Check JWT_SECRET is set in .env
- Verify user status is “ON” in database
- Check browser console for CORS or network errors
- Ensure seed script completed successfully