Quick Start
Prerequisites
Before setting up HCG AI, ensure you have the following installed on your local machine:
- Node.js: Version 16.0 or higher.
- PostgreSQL: A running instance of Postgres.
- Git: For version control and cloning.
1. Installation
Clone the repository and install the project dependencies using npm:
# Clone the repository
git clone https://github.com/UditAkhourii/hcgai.git
cd hcgai
# Install dependencies
npm install
2. Database Setup
Create the Database
Ensure PostgreSQL is running, then create a new database for the application:
createdb hcgai_db
Install PostgreSQL (if required)
- macOS (Homebrew):
brew install postgresql && brew services start postgresql - Ubuntu/Debian:
sudo apt update && sudo apt install postgresql postgresql-contrib - Windows: Download the PostgreSQL installer.
3. Environment Configuration
Create a .env file in the root directory and populate it with your credentials. This file is required for database connectivity, authentication, and AI features.
# Database connection string
DATABASE_URL=postgresql://username:password@localhost:5432/hcgai_db
# OpenAI API Key for chatbot features
OPENAI_API_KEY=your_openai_api_key_here
# SMTP credentials for password resets
SMTP_PASS=your_smtp_password_here
# Security
SESSION_SECRET=your_secure_session_secret_here
PORT=5000
Note: Without a valid
OPENAI_API_KEY, the AI Chatbot feature will be disabled. WithoutSMTP_PASS, email-based password recovery will not function.
4. Initialize Database Schema
The application uses Drizzle ORM for database management. Push the schema to your local database to create the necessary tables (users, entries, sessions):
# Push the schema to the database
npm run db:push
# If you are resetting an existing database
npm run db:push --force
5. Launch the Application
Once the database is initialized, start the Express server:
# Start the production-ready server
npm start
Alternatively, for development/testing:
node simple-app-server.js
6. Access the Dashboard
Open your web browser and navigate to: http://localhost:5000
From here, you can register a new account to begin tracking HCG blood tests, analyzing ultrasound scans, and utilizing the medical risk assessment tools.
Troubleshooting
| Issue | Solution |
| :--- | :--- |
| Database Connection | Run pg_isready to verify Postgres is running. Ensure your DATABASE_URL matches your local Postgres credentials. |
| Port Conflict | If port 5000 is occupied, run lsof -i :5000 to find the process ID and kill -9 <PID>, or change the PORT in your .env. |
| Missing AI Responses | Verify your OPENAI_API_KEY is active and has sufficient credits. |