An application for facilitating in-class interaction and a test-bed for CSCI312 "Software Development".
This is a Next.js project bootstrapped with create-next-app. It uses Jest and Testing Library for testing, ESLint for static analysis, Prettier for styling, and is configured to use GitHub actions for testing pull requests.
Development dependencies installed with:
💻 npm install -D jest jest-environment-jsdom husky lint-staged prettier eslint-config-prettier @testing-library/react @testing-library/jest-dom eslint-plugin-testing-library
The module alias @/ is configured for src/.
To enable sockets for real-time interaction, this application uses a custom server implemented with Express.
Install application dependencies with 💻 npm install.
You will also need to have Docker installed on your development system. This application is designed to use the PostgreSQL RDBMS for testing, development and production. It will automatically start (and stop) ephemeral database servers in containers for tests and database server with persistent storage in a container for development.
For development you will need to specify the DATABASE_URL in the .env.development.local file that matches the specifications in docker-compose.dev.yml, e.g.,
DATABASE_URL=postgres://postgres:postgres@localhost:5432/postgres
Database migration and seeding is implemented with Knex.js. Due to differences in how knex and Next handle imports we need to specify additional configuration when running knex commands. To assist, the configuration is built into a script. All knex commands should use npm run knex ....
Initialize the database with:
💻 npm run knex migrate:latest
💻 npm run knex seed:run
To change the environment specify --env after an additional two dashes (to pass the option to knex instead of npm), e.g., 💻 npm run knex migrate:latest -- --env production.