-
Notifications
You must be signed in to change notification settings - Fork 0
02‐ Installation Guide
Dorgham edited this page Aug 15, 2025
·
1 revision
This guide will walk you through installing and setting up Bilten on your local development environment.
Before you begin, ensure you have the following installed on your system:
- Node.js 18.0.0 or higher
- npm 9.0.0 or higher (comes with Node.js)
- PostgreSQL 15.0 or higher
- Redis 7.0 or higher
- Git 2.30.0 or higher
- Docker 20.10.0 or higher (for containerized setup)
- Docker Compose 2.0.0 or higher
- VS Code or your preferred code editor
- RAM: 4GB
- Storage: 10GB free space
- CPU: 2 cores
- OS: Windows 10+, macOS 10.15+, or Ubuntu 20.04+
- RAM: 8GB or more
- Storage: 20GB free space
- CPU: 4 cores or more
- OS: Latest stable version
# Clone the main repository
git clone https://github.com/iDorgham/Bilten.git
cd Bilten
# Verify the clone
ls -la# Install backend dependencies
npm install
# Install frontend dependencies
cd bilten-frontend
npm install
cd ..
# Install scanner app dependencies
cd bilten-scanner
npm install
cd ..# Start PostgreSQL and Redis with Docker
docker-compose up -d postgres redis
# Verify containers are running
docker-compose psPostgreSQL Setup:
# Ubuntu/Debian
sudo apt update
sudo apt install postgresql postgresql-contrib
# macOS (using Homebrew)
brew install postgresql
brew services start postgresql
# Windows
# Download and install from https://www.postgresql.org/download/windows/Redis Setup:
# Ubuntu/Debian
sudo apt install redis-server
sudo systemctl start redis-server
# macOS (using Homebrew)
brew install redis
brew services start redis
# Windows
# Download and install from https://redis.io/download# Copy environment template
cp .env.example .env
# Copy frontend environment template
cp bilten-frontend/.env.example bilten-frontend/.env
# Copy scanner app environment template
cp bilten-scanner/.env.example bilten-scanner/.envEdit the .env file with your configuration:
# Database Configuration
DB_HOST=localhost
DB_PORT=5432
DB_NAME=bilten_db
DB_USER=bilten_user
DB_PASSWORD=your_secure_password
# Redis Configuration
REDIS_HOST=localhost
REDIS_PORT=6379
REDIS_PASSWORD=
# JWT Configuration
JWT_SECRET=your_jwt_secret_key_here
JWT_EXPIRES_IN=24h
# AWS Configuration (for file storage)
AWS_ACCESS_KEY_ID=your_aws_access_key
AWS_SECRET_ACCESS_KEY=your_aws_secret_key
AWS_REGION=us-east-1
AWS_S3_BUCKET=bilten-files
# Stripe Configuration
STRIPE_SECRET_KEY=sk_test_your_stripe_test_key
STRIPE_WEBHOOK_SECRET=whsec_your_webhook_secret
# Email Configuration
SMTP_HOST=smtp.gmail.com
SMTP_PORT=587
SMTP_USER=[email protected]
SMTP_PASS=your_app_password
# Frontend URL
FRONTEND_URL=http://localhost:3000
# API Base URL
API_BASE_URL=http://localhost:3001/v1# Create database and run migrations
npm run migrate
# Seed the database with sample data
npm run seed# Test the backend API
npm run dev
# In a new terminal, test the frontend
cd bilten-frontend
npm start
# In another terminal, test the scanner app
cd bilten-scanner
npm run devIf you prefer to use Docker for everything:
# Clone the repository
git clone https://github.com/iDorgham/Bilten.git
cd Bilten
# Copy environment files
cp .env.example .env
cp bilten-frontend/.env.example bilten-frontend/.env
cp bilten-scanner/.env.example bilten-scanner/.env
# Start all services with Docker
docker-compose up -d
# Run database migrations
docker-compose exec backend npm run migrate
# Seed the database
docker-compose exec backend npm run seedAfter installation, verify that everything is working:
curl http://localhost:3001/healthExpected response:
{
"success": true,
"message": "Bilten API Server is running",
"timestamp": "2025-08-15T10:00:00.000Z",
"environment": "development"
}Open your browser and navigate to http://localhost:3000
Open your browser and navigate to http://localhost:3002
# Run backend tests
npm test
# Run frontend tests
cd bilten-frontend
npm test
# Run scanner app tests
cd bilten-scanner
npm test# Check if PostgreSQL is running
sudo systemctl status postgresql
# Check if Redis is running
sudo systemctl status redis
# Test database connection
psql -h localhost -U bilten_user -d bilten_dbIf you get port conflicts, check what's using the ports:
# Check what's using port 3000
lsof -i :3000
# Check what's using port 3001
lsof -i :3001
# Check what's using port 3002
lsof -i :3002# Fix npm permissions (Linux/macOS)
sudo chown -R $USER:$GROUP ~/.npm
sudo chown -R $USER:$GROUP ~/.config# Check Node.js version
node --version
# If you need to update Node.js, use nvm:
curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.0/install.sh | bash
nvm install 18
nvm use 18After successful installation:
- Read the Quick Start Guide to get familiar with the platform
- Explore the API Documentation to understand the endpoints
- Check the Development Guide for development workflows
- Review the Testing Guide to run tests
If you encounter issues during installation:
- Check the Common Issues page
- Search existing GitHub Issues
- Create a new issue with detailed information about your problem
- Join our Discussions for community support
Need help? Don't hesitate to reach out to our community or create an issue on GitHub!