Skip to content
This repository was archived by the owner on Dec 1, 2025. It is now read-only.

jclicodes/opencoursewire

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

OpenCourseWire

Community-based e-learning web application

Challenge Definition

See docs/challenge-definition.md

Running locally

Below is a general guide to running the application locally.

To start, clone this repo using the web URL.

git clone https://github.com/jclicodes/opencoursewire.git

Environment variables

Edit the values in .envrc.example. Once properly configured, you can source these variables into your environment.

source .envrc

You can use a tool like direnv for Unix or cross-env for non-Unix environments to automatically load this into your environment before the application starts.

Dependencies

  1. Install Node dependencies (ideally via pnpm)
pnpm install
  1. Run external services via Docker Compose
docker compose up -d
  1. Ensure services are running OK before proceeding.
docker compose ps

You should see something like the below output

opencoursewire-postgres-1   postgres:16       "docker-entrypoint.s…"   postgres   14 seconds ago   Up 13 seconds   0.0.0.0:5432->5432/tcp, [::]:5432->5432/tcp
opencoursewire-valkey-1     valkey/valkey:8   "docker-entrypoint.s…"   valkey     14 seconds ago   Up 13 seconds   0.0.0.0:6379->6379/tcp, [::]:6379->6379/tcp

Database migrations

Ensure database is running, then run migrations via drizzle-kit

pnpm run db:generate && pnpm run db:migrate:local

Run application

You can run the Vite development server (with HMR)

pnpm run dev

Alternatively, build the server and client bundles, then start the production server

pnpm run build && pnpm run start

Testing

This project uses a pyramid testing strategy. End-to-end tests to test the entire stack from a user perspective. Integration tests to test integration points in the app/routes e.g. loaders and actions. Unit tests to test the route components themselves. Generally, sub-components in app/components are not tested since OCW's unit tests are generally meant to be of critical business value - and this value is covered when testing the route components.

Integration and unit tests are co-located with the routes under test.

Note: E2E and Integration tests require external dependencies to run, you can use docker-compose.yml

Teardown

Below is a general guide to ensuring the application is completely removed from your machine.

Stop docker services:

docker compose down

Remove all stopped containers:

docker rm -vf $(docker ps -aq)

Optionally, you can also remove the images:

docker rmi valkey/valkey:8 postgres:16

Lastly, delete the repository:

cd .. && rm -rf opencoursewire

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages