Skip to content

API for ICAM, a Compendium of Medievalist Conference Presentations

License

Notifications You must be signed in to change notification settings

thePortus/icam-server

Repository files navigation

icam

Index Conventionum Aevorum Mediorum - A Compendium for Medieval Conferences

By David J. Thomas, thePort.us and Matt King


Check out the live project website at https://icam.theport.us/


Full Stack (MySQL ExpressJS Angular NodeJS) app for browsing the proceedings of conferences in Medieval Studies.


Installation

Current installation is on a Docker setup.

Install docker, and docker-compose locally. Then clone this repo and move inside the directory. Finally, fetch the submodule, which contains the seeder data.

git clone https://github.com/thePortus/icam-server.git
cd icam-server
git submodule update --init --recursive

Thenm, modify the following files with your desired accounts/passwords/ports

# most crucial, for setting account passwords
/docker-compose.yml
# you must change the server_name and redirect to have the url to which you are deploying
/nginx/nginx.conf

Now, launch the docker containers with docker compose up -d.

The run command in our docker-compose.yml should have gotten the SSL certifictes for us already.

After docker is up... use docker exec to shell into the server container...

# run to get list of docker container names, look for server
docker ps
# shell into the server container
docker exec -it SERVER_CONTAINER_NAME sh
# run the server seeders
source migrate.sh
# exit out of container shell
exit

If you are running in a Windows environment, instead of running migrate.sh, run the following commands instead...

./node_modules/.bin/sequelize db:create
./node_modules/.bin/sequelize db:migrate
./node_modules/.bin/sequelize db:seed:all

Now, set the certbot to autorenew.

docker compose run --rm certbot renew

Then, stop the webserver, and output the dhparam key

docker compose stop webserver
sudo openssl dhparam -out /home/YOUR_USERNAME/icam-server/dhparam/dhparam-2048.pem 2048

Finally, modify the nginx/nginx.conf file and uncomment the lower server block. MAKE SURE to replace values with your domains. Then restart the server with docker compose restart.

That's it, the server should be up and running.

If you have problems and the docker container keeps restarting, the certbot might not have run correctly. To fix this, first, bring down the container with docker compose down. Then, re-comment out the SSH lines in your nginx/nginx.conf file. Now, bring the image back up with docker compose up -d. Then run the command docker compose run --rm certbot certonly --webroot --webroot-path /var/www/html/ --email sample@your_domain --agree-tos --no-eff-email -d your_domain -d www.your_domain. Once it is complete, un-comment out the nginx/nginx.conf file and docker compose up -d to get it started.

Local Development

To develop locally, if you want to use docker, comment out the lines indicated for local development in docker-compose.yml. Then launch with docker compose up -d.

For vanilla npm operation, move inside the server directory and start the app. First, however, you must have MySql installed locally, and have set up a database, preferably named icam, and created a user with full privileges on it named icamowner with the password password.

cd server
npm start

To run testing...

npm test

That's it!

About

API for ICAM, a Compendium of Medievalist Conference Presentations

Resources

License

Code of conduct

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages