Skip to content

Meghan31/Mind-Bloom-Server

Repository files navigation

Capstone Starter

A capstone starter application.

Technology stack

This codebase is written Typescript and uses Express and Mustache Templates. It stores data in PostgreSQL, and a GitHub Action runs tests.

Architecture

The Capstone Starter consists of three free-running processes communicating with one Postgres database.

  1. The data collector is a background process that collects data from one or more sources.
  2. The data analyzer is another background process that processes collected data.
  3. The web application displays results to the user.

Local development

  1. Install node and PostgreSQL 17.

    brew install node postgresql@17
    brew services run postgresql@17
  2. Set up environment variables.

    cp .env.example .env
    source .env
  3. 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
  4. Run tests.

    npm run test
  5. 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

Create a database schema migration

Use knex to create a database schema migration.

npx knex migrate:make "[Description of change]" --knexfile databases/knexfile.js

Build container

  1. Build container

    npm run build
    docker build -t capstone-starter .
  2. 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

Team-4

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published