Coder Social home page Coder Social logo

mooc.fi's Introduction

Development environment

Requirements

Create .env files for backend and frontend. See examples and ask your local boffin for details.

Development workflow

Current node version is 18.16.0.

Run npm ci in the each of the root, backend and frontend directories to install dependencies.

Create separate shells for the database container, backend and frontend:

cd backend
docker-compose up
cd frontend
npm run dev
cd backend
npm run migrate
npm run dev

If the database doesn't seem to do anything, ie. no messages after the initial ones after running docker compose up and the database queries are not getting through, run docker compose down and try again. You can always run the database container in detached mode (-d) but then you won't see the logs live.

If you have used a development database with an older version of PostgreSQL and you want to keep your data, you will need to migrate it to the new version. See here for instructions.

Run npm run prettier in the root directory before committing. The commit runs hooks to check this as well as some linters, type checks etc.

Using pre-built librdkafka to speed up backend development

By default, node-rdkafka builds librdkafka from the source. This can take minutes on a bad day and can slow development down quite considerably, especially when you're working with different branches with different dependencies and need to run npm ci often. However, there's an option to use the version installed locally.

Do this in some other directory than the project one:

wget https://github.com/edenhill/librdkafka/archive/v2.0.2.tar.gz  -O - | tar -xz
cd librdkafka-2.0.2
./configure --prefix=/usr
make && make install

You may have to do some of that as root. Alternatively, you can install a prebuilt package - see here for more information.

Set the env BUILD_LIBRDKAFKA=0 when doing npm ci or similar on the backend to skip the build.

More documentation

mooc.fi's People

Contributors

avrh avatar dependabot[bot] avatar jolampi avatar kalleprkl avatar ljleppan avatar mipyykko avatar nublert avatar nurou avatar nygrenh avatar otsohelos avatar redande avatar robustic avatar samp3 avatar sebazai avatar stadibo avatar technopathic avatar tompurker avatar ukonhattu avatar xneme avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.