Skip to content

DN-75/Term-1-Project

Repository files navigation

InternConnect

Instructions to run the frontend and backend (dev and production) for this repository.

Overview

This project runs a single Node/Express server that serves both the API and the client app. During development the server starts Vite in middleware mode so one command runs both the frontend and backend together. The client app is located in the client/ folder and Vite's build output is placed under dist/public (served by the server in production).

Prerequisites

  • Node.js (v18+ recommended)
  • npm (or yarn/pnpm)

Install dependencies

From the project root run:

npm install

(or yarn / pnpm install if you prefer)

Development (recommended)

The repository includes a dev script in package.json, but the script sets environment variables using Unix syntax which may not work on Windows shells. The server entrypoint is server/index.ts and uses tsx for running TypeScript directly.

Choose one of the options below depending on your shell.

  • Windows (cmd.exe):
set NODE_ENV=development&& npx tsx server/index.ts
  • PowerShell:
$env:NODE_ENV = "development"; npx tsx server/index.ts
  • WSL, Git Bash, macOS, Linux (POSIX shells):
NODE_ENV=development npx tsx server/index.ts

Notes:

  • The dev server will start Express and mount Vite middleware so the client (React) will be served via the same port as the API.
  • Default port is 5000 (see Environment Variables below).

Build and run (production)

  1. Build the client and bundle the server:
npm run build

This runs Vite to build the client into dist/public and bundles the server entrypoint into dist/index.js.

  1. Run the production server. Because the start script in package.json uses Unix-style env var syntax, use one of the commands below depending on your shell:
  • Windows (cmd.exe):
set NODE_ENV=production&& set PORT=5000&& node dist/index.js
  • PowerShell:
$env:NODE_ENV = "production"; $env:PORT = "5000"; node dist/index.js
  • POSIX shells:
NODE_ENV=production PORT=5000 node dist/index.js

If you prefer, you can also run npm run start on POSIX shells; on Windows that may not correctly set NODE_ENV unless you add a cross-platform helper like cross-env to the project.

Environment variables

  • PORT (optional) — port the Express server listens on. Default: 5000.
  • NODE_ENV — affects whether Vite runs in middleware mode (development) or the server serves static files from dist/public (production).

Notes:

  • No database / external services are required to run the project in its current state. The server uses an in-memory storage implementation (server/storage.ts -> MemStorage) by default so data will not persist between restarts.
  • The codebase contains dependencies and scripts (e.g. drizzle-kit) that suggest a future or alternate database-backed storage, but that is not required for the app to run as-is.

Database / Migrations (optional)

If you later configure a database and Drizzle, the repository includes a script:

npm run db:push

This runs drizzle-kit push (see package.json). You will need to set the appropriate database env vars (e.g., DATABASE_URL) when using a real database.

Common troubleshooting

  • "Environment variable syntax": If a package script uses NODE_ENV=... and it fails on Windows, use the Windows-specific examples above or run the project inside WSL/Git Bash.
  • "Port already in use": specify a different port by setting PORT before starting the server (examples shown above).
  • "Build missing dist/public": run npm run build before running the server in production.

Quick test

  1. Start the app in development following the instructions above.
  2. Visit http://localhost:5000/ (or your chosen port) to open the client.
  3. API endpoints are available under /api (for example GET /api/internships).

If you'd like, I can also:

  • Add a small convenience script to package.json that works cross-platform (using cross-env), or
  • Add a .env.example listing common environment variables.

Tell me which you'd prefer and I can add it next.

About

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages