Welcome to StockPro
StockPro is a complete inventory management and point-of-sale (POS) system built with Firebase. This guide will walk you through setting up the application from scratch to your first successful login.This application uses Firebase Authentication and Firestore for backend services. You’ll need a Firebase account to run the application.
Prerequisites
Before you begin, ensure you have the following installed:- Node.js (v14 or higher)
- npm (comes with Node.js)
- A Firebase account (free tier works perfectly)
- A modern web browser (Chrome, Firefox, Safari, or Edge)
# If using Git
git clone <repository-url>
cd source
# Or download and extract the ZIP file, then navigate to the directory
cd path/to/source
The application uses Firebase’s modular SDK (v10.12.2) via CDN imports for better tree-shaking and performance.
- Navigate to Authentication > Sign-in method
- Enable “Email/Password”
- Click Save
- Navigate to Firestore Database
- Click “Create database”
- Choose production mode or test mode
- Select your preferred location
Replace all placeholder values with your actual Firebase project credentials. You can find these in:
Firebase Console > Project Settings > General > Your apps > SDK setup and configuration
</>)StockPro currently requires manual user creation through the Firebase Console. User registration through the app interface is not implemented.
StockPro is a static web application that can be served with any HTTP server. Here are several options:
What’s Next?
Now that you have StockPro running locally, explore these features:Manage Inventory
Add, edit, and track products in your inventory system
Process Sales
Create new sales transactions and view sales history
Authentication
Learn about the authentication system and user management
Dashboard Metrics
Understand the dashboard metrics and reporting features
Troubleshooting
Login fails with 'Correo o contraseña incorrecta'
Login fails with 'Correo o contraseña incorrecta'
Possible causes:
- Incorrect email or password
- User doesn’t exist in Firebase Authentication
- Firebase configuration is incorrect
- Verify the user exists in Firebase Console > Authentication > Users
- Double-check your email and password
- Ensure your
firebaseConfiginfirebase.jsis correct
Page redirects to login.html immediately after login
Page redirects to login.html immediately after login
Cause: Authentication state is not persisting, or the auth check is redirecting authenticated users.Solution:
- Check browser console for JavaScript errors
- Verify that
auth.jsis properly loaded on protected pages - Clear browser cache and cookies
- Ensure Firebase is properly initialized
CORS or module import errors
CORS or module import errors
Cause: Browsers block ES6 module imports when opening HTML files directly (
file:// protocol).Solution:
Always use an HTTP server to serve the application (see Step 6). Never open HTML files directly in the browser.Firebase configuration errors
Firebase configuration errors
Cause: Missing or incorrect Firebase credentials.Solution:
- Verify all Firebase config values in
firebase.js - Ensure Authentication and Firestore are enabled in Firebase Console
- Check that your Firebase project is active and not deleted
Project Structure
Understanding the project structure will help you navigate and customize StockPro:Support
If you encounter issues not covered in this guide:- Check the browser console for error messages
- Review the Authentication documentation for login-related issues
- Verify your Firebase project configuration and quotas
- Ensure all dependencies are properly installed