A capstone starter application.
This codebase is written Typescript and uses Express and Mustache Templates. It stores data in PostgreSQL, and a GitHub Action runs tests.
The Capstone Starter consists of three free-running processes communicating with one Postgres database.
- The data collector is a background process that collects data from one or more sources.
- The data analyzer is another background process that processes collected data.
- The web application displays results to the user.
-
Install node and PostgreSQL 17.
brew install node postgresql@17 brew services run postgresql@17
-
Set up environment variables.
cp .env.example .env source .env -
Set up the database.
psql postgres < databases/create_databases.sql npm run migrate DATABASE_URL="postgresql://localhost:5432/capstone_starter_test?user=capstone_starter&password=capstone_starter" npm run migrate
-
Run tests.
npm run test -
Run the collector and the analyzer to populate the database, then run the app and navigate to localhost:8080.
npm run collect npm run analyze npm run start
Use knex to create a database schema migration.
npx knex migrate:make "[Description of change]" --knexfile databases/knexfile.js-
Build container
npm run build docker build -t capstone-starter . -
Run with docker
docker run --env-file .env.docker --entrypoint ./collect.sh capstone-starter docker run --env-file .env.docker --entrypoint ./analyze.sh capstone-starter docker run -p 8080:8080 --env-file .env.docker capstone-starter