pmiara / yellow-bookcase-backend

https://yellow-bookcase-api.herokuapp.com
MIT License
0 stars 0 forks source link

Żółta Biblioteczka (The Yellow Bookcase)

This is the backend service for the Żółta Biblioteczka website. The service is based on the open-source headless CMS called Strapi. Read more about using Strapi here.

Local installation

git clone https://github.com/pmiara/yellow-bookcase-backend.git
cd yellow-bookcase-backend
npm install
npm run develop

After a successful installation, you will be prompted to create an admin account. You can use a fake email address for it, because there is no email confirmation step.

If you get errors about node version, make sure your node version complies with the "engines" field specified in package.json. I recommend using Node Version Manager to get it right.

Endpoints

Read more about accessing Strapi endpoints in the documentation.

Deployment

This service is meant to be deployed to Heroku. The production setup differs from the development one in the database they use, and the way of storing media files. The development setup uses SQLite with the whole database stored in .tmp/data.db file, and it uploads the media files to public/uploads directory. For production, we use PostgreSQL and store the media files in AWS S3. Their details are kept in the environmental variables described below:

Both secrets can be generated using node -e "console.log(require('crypto').randomBytes(64).toString('base64'))"

In order to run the service in the production mode use npm run start instead of npm run develop.