Nevar pievienot vairāk kā 25 tēmas Tēmai ir jāsākas ar burtu vai ciparu, tā var saturēt domu zīmes ('-') un var būt līdz 35 simboliem gara.
diaseu cd25ff0b4b broken vue/vite 4 gadus atpakaļ
..
db scoreSurvey, updateQueue, buttons to accept/pass 4 gadus atpakaļ
lib broken vue/vite 4 gadus atpakaļ
server scoreSurvey, updateQueue, buttons to accept/pass 4 gadus atpakaļ
tests :gear: adding score test 4 gadus atpakaļ
.env.sample :recycle: moving project files around | tweaking mock to include survery questions | tweaking mock to include profiles without responses 4 gadus atpakaļ
.eslintrc :recycle: just cleaning up config stuff 5 gadus atpakaļ
.nycrc :recycle: just cleaning up config stuff 5 gadus atpakaļ
.prettierrc :pencil: added formatting and style rules for eslint and prettier 5 gadus atpakaļ
README.md :recycle: complete refactor of data generator | generate data in batches, and insert one file at a time 4 gadus atpakaļ
docker-compose.yml :recycle: moving project files around | tweaking mock to include survery questions | tweaking mock to include profiles without responses 4 gadus atpakaļ
knexfile.js :recycle: moving project files around | tweaking mock to include survery questions | tweaking mock to include profiles without responses 4 gadus atpakaļ
package-lock.json :sparkles: using sinon to mock objection methods in tests | building mock for Schwifty model registration | working sample test for matchqueue 4 gadus atpakaļ
package.json :gear: added reseed command to rebuild db 4 gadus atpakaļ

README.md

siimee backend API

An API for the siimee application

:white_check_mark: Prerequisites

You will need…

Node.js 14+

:package: Installation

  1. Install dependencies with npm install
  2. Copy the environments sample file from ./server/.env.sample and rename it to ./server/.env
  3. Fill out your database connection details in ./server/.env
  4. A test database container is provided and can be started with docker-compose --env-file ./backend/server/.env up -d
  5. Populate some basic tables for your database using npx knex migrate:latest

:package: Migrations

We use Knex.js,which comes with a couple nice database migration and seeding tools. Migrating tracks changes in schema. Migration steps are contained in the ./db/migrations folder. Seeding adds dummy data once our database tables have been created and schemas are set. Starting seed steps are contained in ./db/seeds and use the mock.js file as the main dummy data source.

Migrating

  • Run npm run migrate to run all migrations and establish the base schema
  • Run npm run unmigrate to roll back one migration

Seeding

  • Run npm run generate to generate dummy data
  • Run npm run seed to seed the database with generated dummy data

Restarting

Since we can’t unseed the database, it’s best to destroy the dev database and rebuild it.

  1. Stop the database by navigating to the project root directory cd ../ and running docker-compose down
  2. Destroy the database volume docker volume rm siimee_siimee_db. BE CAREFUL.
  3. Restart the database while still at the project root with docker-compose --env-file ./backend/server/.env up -d
  4. Recreate schemas and tables but navigating to ./backend and running npm run migrate
  5. Reseed the dummy data with npm run seed

:electric_plug: Run

  1. Run npm run start to start up the server
  2. Check http://localhost:3001/documentation to see the interactive API documentation

:robot: Deployment

TBD

:pill: Tests & Code Quality

Tests are run with AVA with code coverage reporting via nyc. Look at the example test for ideas, as well as the ava documentation

  • Run tests with coverage report with npm test

:heart: Built With