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.
First, install the dependencies:
npm i
Then, build the project:
npm run build
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.
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
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
Please check here.
If you want to contribute to the project, please see our contributing guide.