https://github.com/rage/mooc.fi
https://github.com/rage/mooc.fi
Last synced: 5 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/rage/mooc.fi
- Owner: rage
- Created: 2019-04-25T10:14:18.000Z (about 7 years ago)
- Default Branch: master
- Last Pushed: 2025-12-18T01:47:26.000Z (6 months ago)
- Last Synced: 2025-12-21T06:48:44.409Z (6 months ago)
- Language: TypeScript
- Homepage: https://mooc.fi
- Size: 134 MB
- Stars: 5
- Watchers: 7
- Forks: 7
- Open Issues: 102
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# 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:
```bash
cd backend
docker-compose up
```
```bash
cd frontend
npm run dev
```
```bash
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](docs/database.md) 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:
```bash
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](https://github.com/edenhill/librdkafka) for more information.
Set the env `BUILD_LIBRDKAFKA=0` when doing `npm ci` or similar on the backend to skip the build.
## More documentation
- [Kafka](docs/kafka.md)
- [GraphQL](docs/graphql.md)
- [Database](docs/database.md)