This is a full-stack web application built with modern technologies, designed to manage various business operations efficiently. The application includes multiple pages for handling different aspects of business management, such as inventory, expenses, products, users, and settings.
- Home Page: Overview of the application's key metrics and insights.
- Dashboard: Provides analytical data and key performance indicators.
- Expenses Page: Tracks business expenses with detailed breakdowns.
- Inventory Page: Manages stock levels, incoming shipments, and product listings.
- Products Page: Lists available products with their details and pricing.
- Users Page: Handles user management, including roles and permissions.
- Settings Page: Configurations and preferences for customizing the application.
- React.js (with Next.js) – For building the client-side UI.
- Tailwind CSS – For modern, responsive styling.
- Vercel – For deployment and hosting.
- Node.js – Server-side runtime.
- Express.js – Web framework for building API endpoints.
- PostgreSQL– For data storage and management.
client/
├── public/ # Static assets like images
├── src/
├── app/
├── components/ # Reusable UI components
├── dashboard/ # Dashboard page
├── expenses/ # Expenses management
├── inventory/ # Inventory handling
├── products/ # Product listings
├── settings/ # User settings
├── users/ # User management
├── state/
├── api.ts # API calls and configurations
├── index.ts # State management setup
server/
├── routes/ # API route handlers
├── models/ # Database models
├── controllers/ # Business logic and API controllers
├── config/ # Configuration files
├── index.js # Entry point for backend
Environment Variables Setup
The project relies on environment variables for configuration. Follow the instructions below to set up the necessary environment variables:
Client-side Environment Variables
Create a .env file in the client directory and add the following variable:
NEXT_PUBLIC_API_BASE_URL="http://localhost:8000"
This variable defines the base URL for API requests in the client-side code.
Server-side Environment Variables
Create a .env file in the server directory and add the following variables:
DATABASE_URL="YOUR_POSTGRES_DATABASE_URL"
PORT=8000
Ensure to replace YOUR_MONGODB_URL with your actual MongoDB URL. The PORT variable specifies the port number for the server.
Note: Environment variables containing sensitive information like API keys, database credentials, or any other secrets should not be committed to version control. Ensure that the .env files are included in your project's .gitignore file to prevent accidental exposure of sensitive data.
-
Clone this repository to your local machine:
git clone https://github.com/divyalaldinani/StockPilot
-
Change to the project directory:
cd StockPilot
-
Install and run client dependencies:
cd client
npm install
npm run dev
-
Install and run server dependencies:
cd server
npm install
npm run dev
-
Open your web browser and visit http://localhost:3000 to see the website in action during development.