Vous ne pouvez pas sélectionner plus de 25 sujets Les noms de sujets doivent commencer par une lettre ou un nombre, peuvent contenir des tirets ('-') et peuvent comporter jusqu'à 35 caractères.
juancarbajal98 b57d30de63 :pencil: backend table data sorting service il y a 3 ans
..
db :pencil: backend table data sorting service il y a 3 ans
lib :fire: removing some unused vars | moving over some joi objects to schemas il y a 3 ans
server :bug: passing messages to chatter in correct format | altering borked joi import il y a 3 ans
tests :recycle: reworking tests to use new prescore tables and tags | tweaking broken validators il y a 4 ans
.env.sample :recycle: rebuilt aspect and prescore table migrations il y a 4 ans
.eslintrc :recycle: just cleaning up config stuff il y a 5 ans
.nycrc :recycle: just cleaning up config stuff il y a 5 ans
.prettierrc :gear: redoing prettier config | running prettier | adding some sample wave-ui elements il y a 3 ans
README.md :recycle: a bunch of random changes before we get started il y a 3 ans
docker-compose.yml :gear: enforcing usage of env file port il y a 4 ans
knexfile.js local changes necessary to get frontend and backend running il y a 3 ans
package-lock.json connecting to pubnub but throwing an error on the publish il y a 3 ans
package.json connecting to pubnub but throwing an error on the publish il y a 3 ans

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 ./backend/.env.sample and rename it to ./backend/.env
  3. Fill out your database connection details in ./backend/.env
  4. A test database container is provided and can be started with docker-compose up -d
  5. Populate some basic tables for your database using npm run generate && npm run reseed

: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 up -d
  4. Recreate schemas,tables and dummy data by navigating to ./backend and running npm run reseed

: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