The Babylon Metropolis homepage is a static site that is generated by the Gatsby and with Strapi as CMS.
The code is open (MIT) so the one can inspect it and maybe get inspired how to build a site with Gatsby and Strapi. For Stapi checkout the git repository babylon-strapi.
Clone the repository and install.
git clone https://github.com/gitmathub/babylon-gatsby.git
npm install
Check the most recent Strapi documentation > Guides > Deployment.
Make sure you're running a node version >= 10.
$ node -v
v10.8.0Clone and install
git clone https://github.com/gitmathub/babylon-strapi.git
cd babylon-strapi/
npm installCheck and adjust your server settings ./config/environments/production/server.json.
$ egrep 'host|port' config/environments/production/server.json
"host": "babylon-metropolis.de",
"port": 61337,Build the admin panel.
NODE_ENV=production npm run buildRun the server.
NODE_ENV=production npm startYou should get this on the console:
To manage your project 🚀, go to the administration panel at:
http://babylon-metropolis.com:61337/admin
To access the server ⚡️, go to:
http://babylon-metropolis.com:61337Check if the API works
$ nc babylon-metropolis.com 61337
GET /categories
HTTP/1.1 403 ForbiddenThis section is very specific. It contains notes for my provider uberspace.de
https://wiki.uberspace.de/development:nodejs#versionen
https://wiki.uberspace.de/development:nodejs#einrichtung_als_dienst
uberspace-setup-service babylon-strapi npm startcheck logs and ports
tail -f ~/service/babylon-strapi/log/main/currentpatch start script
export NODE_ENV=production
cd $HOME/projects/babylon-strapi
exec node $HOME/projects/babylon-strapi/node_modules/.bin/strapi start 2>&1service starting an stopping
# To start the service (hint: u = up):
svc -u ~/service/babylon-strapi
# To stop the service (hint: d = down):
svc -d ~/service/babylon-strapi
# To reload the service (hint: h = HUP):
svc -h ~/service/babylon-strapi
# To restart the service (hint: du = down, up):
svc -du ~/service/babylon-strapicheck on which ports services are running for user belab
netstat -tulpe | grep belabcheck which of your services are running
uberspace-list-ports --listencheck which ports of your firewall are open
uberspace-list-ports --openopen a port if needed
uberspace-add-port --protocol tcp --firewalhttp://localhost:8000/___graphql
Test in different browsers on Windows: https://www.browserling.com
https://www.gatsbyjs.org/docs/recipes/deploying-your-site
Test deploy under the path prefix: /next
module.exports = {
pathPrefix: `/next`,
}npm run build -- --prefix-pathstest
npm run serve -- --prefix-pathscompression via .htaccess
(don't compress html for gatsby)
AddOutputFilterByType DEFLATE text/html text/plain text/xml text/css application/javascript text/javascript application/json
cd babylon-strapi/data
sqlite3 sqlite.db .dump > 20191226-02-strapi-babylon-dump.sqlMust have
- Footer navigation
- Page with all items (Verlagsprogramm)
- Authors page
- SSL certificate
- CMS installation
- strapi installation
- pm2 installation
- data import
- webhooks
- Deployment automation
- Enable SSL after intallation
Good to have
- Web app manifest
gatsby-plugin-manifest - Meta tags
- Adjust link on Wikipedia
Goodies
-
Favicon
-
Listing of all authors
-
Publication images
-
Author images
-
Hamburger menu: collapse when click outside
-
Margin on windows internet explorer
-
Coloring
-
checkout https://github.com/staylor/react-helmet-async for resolving the warning about the SideEffect(NullComponent): gatsbyjs/gatsby#17865