NOTE: Originally, the server side application code has been written in the root directory and the client side application has developed within the client folder. These two projects run on two separate ports: 8080 and 3000 respectively in the DEV environment. In the production environment, the client side folder is bundled into a HTML+CSS+JS application and served within a static folder. Running the projects on two different ports on Cloud9 wasn’t a success; hence the following instructions serve the client-side application within a static folder, much like what happens in the production environment.
- Upload knack.zip a new Cloud9 environment.
- Open a new terminal.
- Extract the contents of the knack.zip file, using the command: unzip knack.zip
- Delete the uploaded knack.zip file.
- Open the terminal and execute npm install in the project root directory.
- Navigate to the client folder by executing cd client and then install the packages by executing npm install.
- In case there are any vulnerabilities, fix them by executing npm audit fix.
- Execute npm run build to build the client side application into a static HTML+CSS+JS web app.
- Create an .env file in the project root folder, with values provided in D2L, those values point to Plesk MySQL Database environment.
- To point to a new DB created in cloud9 environment, replace DB_HOST, DB_USER, DB_PORT, DB_PASS, DB_NAME with the appropriate values for the new environment.
- Make sure variable NODE_ENV="Cloud9" in .env file to make sure static contents created in step 8 are being served.
- In the project root folder execute npm run server and preview the running application. DO NOT USE npm run dev, otherwise the project will start the client app in port 3000 and will lead to error.
- Open a new terminal and start mysql service using: sudo service mysqld start
- Open mysql client: sudo mysql -u root
- Inside the mysql client create a new database: CREATE DATABASE knack
- Exit mysql client.
- Upload the file owl_knack_dump.sql to the project root folder in Cloud9 environment.
- Run the command mysql -u root -p knack < owl_knack_dump.sql
- To point the application to this new database, change the variables in .env file to the following:
DB_HOST=localhost
DB_USER=root
DB_PASS=
DB_NAME=knack
https://github.com/carolinasmbastos/knack
The code is documented with API endpoint purposes and inputs. Please refer to routes inside: <project_root>/routes
-
Carousel image #1 https://unsplash.com/photos/1rBg5YSi00c (@adrigeo_)
-
Carousel image #2 https://unsplash.com/photos/tnv84LOjes4 (@sawyerbengtson)
-
Carousel image #3 https://unsplash.com/photos/acowe0pCVBg (@andrewtneel)
-
Carousel image #4 https://unsplash.com/photos/oLhTLD-RBsc (@igormiske)
-
Monthly Art banner https://unsplash.com/photos/-GUyf8ZCTHM (@jruscello)
-
View in Space background image https://www.freepik.com/free-photo/pink-chair-white-room_4100643.htm
-
City of Vancouver logo https://vancouver.ca/images/cov/feature/covlogo-share.png
-
Artworks https://unsplash.com/photos/n-vnWQmmVoY (@itstamaramenzi) Default image - https://unsplash.com/photos/xubOAAKUwXc (@pawel_czerwinski) MET Museum Open Access Artworks - https://www.metmuseum.org/art/collection/search#!?searchField=All&showOnly=openAccess&sortBy=relevance&offset=0&pageSize=0