Quick Start
⏱️ Quick Start
Get HCG AI up and running on your local machine in under 5 minutes.
1. Prerequisites
Ensure you have the following installed:
- Node.js (v16 or higher)
- PostgreSQL (v14 or higher)
- Git
2. Installation
Clone the repository and install the project dependencies:
# Clone the repository
git clone https://github.com/UditAkhourii/hcgai.git
cd hcgai
# Install NPM packages
npm install
3. Database Setup
- Start PostgreSQL: Ensure your local PostgreSQL service is running.
- Create Database: Create a new database named
hcgai_db.createdb hcgai_db
4. Configuration
Create a .env file in the root directory and add your credentials. This file is required for database connectivity and AI features.
# Database Connection
DATABASE_URL=postgresql://username:password@localhost:5432/hcgai_db
# Security
SESSION_SECRET=your_secure_random_string
# AI Features (Optional, required for Chatbot)
OPENAI_API_KEY=sk-your-openai-key-here
# Email Features (Optional, required for Password Reset)
SMTP_PASS=your_smtp_password
# Server Settings
PORT=5000
5. Initialize Schema
HCG AI uses Drizzle ORM. Push the schema to your local database to create the necessary tables (users, entries, sessions):
# Synchronize database schema
npm run db:push
6. Launch the Application
Start the development server:
npm start
Your application is now running at http://localhost:5000.
🛠️ Core Commands Reference
| Command | Action |
| :--- | :--- |
| npm install | Installs all backend and frontend dependencies. |
| npm run db:push | Pushes the Drizzle schema to your PostgreSQL instance. |
| npm start | Launches the Express server on the configured PORT. |
| node simple-app-server.js | Alternative way to start the standalone production server. |
🔑 Initial Usage
- Register: Create a new account via the "Register" button in the navigation bar.
- HCG Tracking: Use the Home tab to log β-hCG blood test values.
- AI Analysis: Navigate to the "AI Chat" tab to ask questions about your logged data (requires
OPENAI_API_KEY).