This is the platform used for the Modtoberfest event(s)
- NodeJS
- PostgreSQL
- NPM
- A Github account
-
Create Github OAuth app
* Use
http://localhost:3000
as the callback urlDo not close the page before the next step! You will need your client secret and token.
Follow the steps here: https://docs.github.com/en/developers/apps/creating-an-oauth-app
-
Create .env file
- Rename the file
.env.example
to.env
- Fill in your github id and secret you got from the previous step
- Fill in your database information. Usually can stay untouched.
- Rename the file
-
Setup database
- Create database "modtoberfest"
- Install knex
npm install knex -g
- Run migrations
knex migrate:latest
-
Install dependencies
npm i
-
Run the app
npm run dev
That's it! Visit http://localhost:3000 to get started!
-
Log into Docker Hub or your docker registery of choice
-
Build and Push the Docker image
docker build . -t <username>/<name> docker push <username>/<name>
Or edit publish.sh (or publish.bat on Windows) to fit your username and run the script.
-
Run the container
There is multiple ways to run the container, you can simply do
docker run <username>/<name> -p 3000
Or you can use more advanced options such as docker-compose, see the docker-compose.yml file for reference.
-
Setup the database
Follow the steps for the development process except for the migration part.
-
Copy your
.env
file and rename it.env.prod
-
Fill in the information to your database
-
Run
migrate-prod.sh (or .bat on windows)
*Be extremely careful when running migrations in production as it can lead to data loss
* If your database is running on a remote server, you can use a ssh tunnel more info
-