Meliodas-1O / modernMoodle

modernMoodle
3 stars 0 forks source link

modernMoodle

Table of contents

Dev - quick start

Postgres database

modernMoodle currently needs an up and running Postgres database.
The easiest way to get started is to use docker :

docker run -p 5432:5432 --name modernmoodle-db-pg -e POSTGRES_PASSWORD=password -e POSTGRES_USER=root -ePOSTGRES_DB=modernmoodledb -d postgres:16

If you change any of the settings, please make sure to update them in the .env file.

Once the database is running, apply the migration(s) :

npm run migrate

You may need a bash environment to run this.

Install dependencies and build project

First, install the dependencies:

npm i

Then, build the project:

npm run build

Run the project with hot-reload

npm run dev

If you modify any file in the src/ folder, the server will restart.

If you need to update the database schema, you will have to shut down the server (Ctrl+C), run npm run migrate and then run again the server using the previous command.

Shut down everything

To stop the server, just press Ctrl+C.

To stop and delete the database (running as a docker container):

docker stop modernmoodle-db-pg && docker rm modernmoodle-db-pg

Available scripts

npm run build # build the project
npm run start # start the server (no hot-reload)
npm run dev # start the server (with hot-reload)
npm run migrate # apply migrations to the database
npm run unit-tests # run all unit tests
npm run integration-tests # run all integrations tests
npm run lint # Show warnings/errors by using eslint
npm run lint-fix # Try to fix erros using eslint
npm run prettier # apply prettier style in project

How to write tests

Please check here.

Contributing & guidelines

If you want to contribute to the project, please see our contributing guide.