Personal Website made to show my work resume in a more beautiful format. It uses the Gatsby framework for the frontend which is based on react but with the use of styled-components. For the backend, it's using Strapi to manage the content used in this website along with Cloudinary to manage media and Postgres for the database.
The frontend of the website is currently hosted on vercel and the backend is hosted on a home server that can be reached via HTTPS protocol. To take a look at this magnificent website, go to adammihajlovic.ca.
The Strapi backend is hosted from home on home.adammihajlovic.ca/admin in order to make changes wherever I am.
(Needs a password for access by the way 😉)
For more information please feel free to contact me with my contact information provided on the website and scroll to the bottom: adammihajlovic.ca
Install both Gatsby's and Strapi's CLI to run the servers.
# installation
npm install -g gatsby-cli
npm install -g strapi
# verify installation
gatsby-cli -v
strapi -vNavigate to the /server folder and make sure you have a .env file containing the following:
APP_KEYS=
HOST=127.0.0.1
PORT=1338
JWT_SECRET=
ADMIN_JWT_SECRET=
API_TOKEN_SALT=
TRANSFER_TOKEN_SALT=
RESEND_API_KEY=
CLOUDINARY_NAME=
CLOUDINARY_KEY=
CLOUDINARY_SECRET=
DATABASE_HOST=
DATABASE_PORT=
DATABASE_NAME=
DATABASE_USERNAME=
DATABASE_PASSWORD=When this is done, navigate back to the source folder and go to /client and make sure you .env file contains the following:
STRAPI_TOKEN=
GATSBY_STRAPI_TOKEN= # Should be the same as STRAPI_TOKEN
GATSBY_CONTACT_INFO_RECEIVE_EMAIL=
GATSBY_STRAPI_URL=Start by making sure everything is up-to-date.
Both in the /server and the /client folder, run
# install dependencies
npm install
# build application
npm run buildStart by running the back-end (Strapi) by running the following command in the /server folder:
# start in production mode
npm run start
# OR
# start in development mode (with schema modifications enabled)
npm run developYour Strapi content-manager should now be running at http://localhost:1338!
Then to run the front-end (Gatsby), run the following command in the /client folder:
# start in production mode
npm run start
# OR
# start in development mode (with auto-reload)
npm run developYour site is now running at http://localhost:8000!
Note: You'll also see a second link: http://localhost:8000/\_\_\_graphql. This is a tool you can use to experiment with querying your data. Learn more about using this tool in the Gatsby Tutorial.
Note: The way to actually work with graphql in this project is through strapi directly and should be available on the following link: http://localhost:1338/graphql
When you need to update Strapi to the latest version, you can run the following command to update the project.
npm run upgradeIt's important to note that you will still need to update other non-Strapi dependencies on your own in the package.json file.
A quick look at the top-level files and directories you'll see in a Gatsby project (Front-end).
.
├── node_modules
├── src
├── gatsby-browser.js
├── gatsby-config.js
├── gatsby-ssr.js
├── LICENSE
├── package-lock.json
└── package.json-
/node_modules: This directory contains all of the modules of code that your project depends on (npm packages) are automatically installed. -
/src: This directory will contain all of the code related to what you will see on the front-end of your site (what you see in the browser) such as your site header or a page template.srcis a convention for “source code”. -
gatsby-browser.js: This file is where Gatsby expects to find any usage of the Gatsby browser APIs (if any). These allow customization/extension of default Gatsby settings affecting the browser. -
gatsby-config.js: This is the main configuration file for a Gatsby site. This is where you can specify information about your site (metadata) like the site title and description, which Gatsby plugins you’d like to include, etc. (Check out the config docs for more detail). -
gatsby-ssr.js: This file is where Gatsby expects to find any usage of the Gatsby server-side rendering APIs (if any). These allow customization of default Gatsby settings affecting server-side rendering. -
LICENSE: This Gatsby starter is licensed under the 0BSD license. This means that you can see this file as a placeholder and replace it with your own license. -
package-lock.json(Seepackage.jsonbelow, first). This is an automatically generated file based on the exact versions of your npm dependencies that were installed for your project. (You won’t change this file directly). -
package.json: A manifest file for Node.js projects, which includes things like metadata (the project’s name, author, etc). This manifest is hownpmknows which packages to install for your project.
Looking for more guidance?