ForesTracker-0

ForesTracker

A comprehensive forest management application for tracking, monitoring, and managing forest inventory and resources.

🌲 Features

πŸ—οΈ Tech Stack

Frontend

Backend

πŸš€ Quick Start

Prerequisites

Installation

# Install dependencies
npm install

# Set up environment variables
# Copy .env.example to .env and configure your database

# Push database schema
npm run db:push

Development

# Start development server (runs both frontend and backend)
npm run dev

# Type checking
npm run check

Building

# Build for production (includes both frontend and backend)
npm run build

# Build frontend only for GitHub Pages
npm run build:gh

# Start production server
npm start

πŸ“¦ Deployment

GitHub Pages Deployment

This project is configured for automatic deployment to GitHub Pages.

Setup (One-time)

  1. Push code to GitHub:
    git push origin main
    
  2. Enable GitHub Pages in repository Settings:
    • Go to Settings β†’ Pages
    • Set Source to β€œGitHub Actions”

Automatic Deployment

Every push to main branch automatically triggers a deployment via GitHub Actions.

Live URL: https://lokeshpuma.github.io/ForesTracker-0/

Local Testing

# Build and test locally
npm run build:gh

# Preview build
cd dist/public
npx http-server

πŸ“ Project Structure

ForesTracker-0/
β”œβ”€β”€ client/                 # Frontend React application
β”‚   β”œβ”€β”€ src/
β”‚   β”‚   β”œβ”€β”€ components/    # React components
β”‚   β”‚   β”‚   β”œβ”€β”€ ui/        # UI components (shadcn/ui)
β”‚   β”‚   β”‚   β”œβ”€β”€ layouts/   # Layout components
β”‚   β”‚   β”‚   β”œβ”€β”€ error-boundary.tsx
β”‚   β”‚   β”‚   └── api-error-handler.tsx
β”‚   β”‚   β”œβ”€β”€ pages/         # Page components
β”‚   β”‚   β”œβ”€β”€ hooks/         # Custom React hooks
β”‚   β”‚   β”œβ”€β”€ lib/           # Utilities and helpers
β”‚   β”‚   β”œβ”€β”€ App.tsx        # Main app component
β”‚   β”‚   └── main.tsx       # Entry point
β”‚   └── index.html
β”œβ”€β”€ server/                 # Backend Express application
β”‚   β”œβ”€β”€ index.ts           # Server entry point
β”‚   β”œβ”€β”€ routes.ts          # API routes
β”‚   └── storage.ts         # Data storage logic
β”œβ”€β”€ shared/                 # Shared code
β”‚   └── schema.ts          # Database schema and types
β”œβ”€β”€ vite.config.ts         # Vite configuration
β”œβ”€β”€ tsconfig.json          # TypeScript configuration
β”œβ”€β”€ package.json           # Project dependencies
└── .github/
    └── workflows/
        └── deploy.yml     # GitHub Actions deployment workflow

πŸ”§ Error Handling

The application includes comprehensive error handling:

πŸ” Environment Variables

Create a .env file with the following variables:

DATABASE_URL=your_neon_database_url
NODE_ENV=development

πŸ“ Available Scripts

Script Purpose
npm run dev Start development server
npm run build Build for production (full stack)
npm run build:gh Build for GitHub Pages (frontend only)
npm run start Start production server
npm run check Run TypeScript type checking
npm run db:push Push database schema changes

🀝 Contributing

  1. Create a feature branch (git checkout -b feature/amazing-feature)
  2. Commit changes (git commit -m 'Add amazing feature')
  3. Push to branch (git push origin feature/amazing-feature)
  4. Open a Pull Request

πŸ“„ License

MIT License - see LICENSE file for details

πŸ“§ Support

For issues and questions, please open an issue on GitHub.


Repository: ForesTracker-0
Live Demo: ForesTracker on GitHub Pages