CaféStock is an inventory management system built with C++/CLI and Windows Forms for tracking cafeteria items, users, and capacity data.
This README explains how to set up the local SQL Server Express database and configure the environment file (.env) to run CaféStock without errors.
Before building CaféStock, install the following tools:
Download link:
➡️ https://www.microsoft.com/en-us/sql-server/sql-server-downloads
Download link:
➡️ https://aka.ms/ssms
Install the Desktop development with C++ workload.
- After installation, open SQL Server Management Studio.
- Connect to your server instance:
In SSMS, open a new query window and run:
CREATE DATABASE dboInventory;
GO
USE dboInventory;Users
CREATE TABLE dbo.Users (
Id INT IDENTITY(1,1) PRIMARY KEY,
username NVARCHAR(50) NOT NULL,
password NVARCHAR(50) NOT NULL,
datecreated DATETIME DEFAULT GETDATE()
);
GOItems
CREATE TABLE dbo.tblItems (
Item_ID INT IDENTITY(1,1) PRIMARY KEY,
Item_Name NVARCHAR(100) NOT NULL,
Item_Category NVARCHAR(50) NOT NULL,
Item_Quantity INT NOT NULL,
Date_Modified DATETIME DEFAULT GETDATE()
);
GOStep 3 Add an .env file for apikey and contents must be contain the Server Name, Database Name, User ID and Password:
Must be in this format in .env file:
"SQL_CONN=Data Source="Server Name";Initial Catalog="Database-Name";User ID="";Password="";"
Then add .env in Solution.
Output in SMSS:
Databases:
dboInventory
├── Tables
│ ├── dbo.Users
│ └── dbo.tblItems
Output in VS:
CafeStock/
├── EnvConfig.h
├── .env
├── Methods/
├── Pages/
├── CafeStock.sln
└── .gitignore