- Clone the repository:
git clone https://github.com/Scout-NU/thealleyway-site.git
- Change directories
cd thealleyway-site
- Set up environment variables
In the project directory there is a file called
env_example
, which holds all the necessary environment variables. Most importantly, it contains the Prismic URL.
Copy the file and add the values to the variables.
cp env_example .env
PRISMIC_REPOSITORY_NAME="XXXXXXXXXXXXXXX"
NEXT_PUBLIC_MAILERLITE_API="XXXXXXXXXXXXXXX"
NEXT_PUBLIC_MAILERLITE_LIST_ID="XXXXXXXXXXXXXXX"
SEND_EMAIL_API_ENDPOINT="XXXXXXXXXXXXXXXX"
- PRISMIC_REPOSITORY_NAME should be the name of the Prismic Repository
- NEXT_PUBLIC_MAILERLITE_API should be a MailerLite API, you can find this after creating an account
- NEXT_PUBLIC_MAILERLITE_LIST_ID, after creating a group for subscribers in MailerLite you will see a List ID for it
- SEND_EMAIL_API_ENDPOINT Google Scripts API endpoint
- Install the packages
# In the project directory
npm install
- Run the server locally
npm run dev
Now the server will run locally, most likely on http://localhost:3000
. Your work will be displayed, and as changes are saved it will auto-refresh the site.
A quick look at the top-level file structure used
.
├── /components
├── /functions
├── /lib
├── /node_modules
├── /pages
├── /public
├── /style
├── /styles
├── .gitignore
├── package-lock.json
├── package.json
└── README.md
-
/components
: This directory contains all of the components and styling for the entire project -
/functions
: This directory contains all of the Netlify functions created for sending emails -
/lub
: This directory contains all of the cross-project reusable functions -
/node_modules
: This directory contains all of the modules of code that your project depends on (npm packages)are automatically installed. -
/pages
: This directory contains the routes, with each route in a seperate file. Next.js then pre-renders every page in the/pages
directory. -
/public
: This directory is used by Next.js to statically serve files. -
/style
: This directory contains cross-project reusable styling -
/styles
: This directory contains the global styles utilized in the project. -
.gitignore
: This file tells git which files will not maintain a version history, thus don't need to be tracked. -
package-lock.json
: (First seepackage.json
, below) This is an automatically generated file based on the exact versions of your npm dependencies used for the project. You won't change this file directly. -
package.json
: A manifest file for Node.js projects, this file includes the metadata for the project. Metadat incluedes the project's name, author, etc. This manifest is how npm knows which packages to isntall to run the project. -
README.md
: A reference text file containing information about the project.
The website is built on the following technologies:
- Netlify: Site hosting provider
- Prismic: Content Management Site
- Next.js: Static site generator for the site
The Alleyway site is deployed on Netlify. Netlify is continuous integration and deployment platform that allows you to run web projects at global scale. There are a couple ways to update and deploy the site:
-
Manual Deploy: Go to https://app.netlify.com/sites/the-alleyway/deploys. Click on Trigger deploy, then on Deploy site. Now the build will begin for your site. If your build is successful, the logs will tell you that the site is live! If any errors arise in the logs, please fix them and redeploy.
-
Merging a Pull Request: Netlify is hooked up to GitHub, thus when a PR is merged into the master branch Netlify will automaticaly deploy to keep the sit up-to-date. Note: Upon creating and updating any Pr, a
deploy preview
can be accessed from the bottom of the page - this
Note: In Netlify, when a PR is created there is a link, Deploy Preview ##, that will allow you to preview the changes.
The Alleyway website uses Prismic as its Content Management System (CMS). Prismic is a headless CMS that offers the flexibility to easily manage content. To update data in Prismic, the following must be done:
-
** Publish document on Prismic ** Publishing new data will not immediately show up on the site, since the data will need to be queried and stored in the build.
-
** Restart the development server** When the server restarts the new data published is grabbed and used in the build.
Prismic documentation: https://prismic.io/docs
To learn more about Next.js, take a look at the following resources:
- Next.js Documentation - learn about Next.js features and API.
- Learn Next.js - an interactive Next.js tutorial.
You can check out the Next.js GitHub repository - your feedback and contributions are welcome!
This repository is for The Alleyway's website. This repository was built by The Alleyway team at Scout.
Jean Zhang
Developer
jean.nmn.zhang@gmail.com
Judy Zhang
Developer
jzhzhang66@gmail.com
Izzy Berzsenyi
Developer
iberzsenyi@yahoo.com