An easy-to-use Portfolio Builder App for CUNY Tech Prep team project with React, Express.js, and Sequelize.js
API
- express.js
- sequelize.js
React client
- Built using
create-react-appand configured to work with the api. - Bootstrap 4.x added to
/WeBuilder/public/index.html - React Router
Each team member will need to do this on their local machine.
Create a user in postgres named ctp_user with the password ctp_pass:
This only needs to be done one time on your machine You can create additional users if you want to.
createuser -P -s -e ctp_user
Create a separate db for this project:
createdb -h localhost -U ctp_user webuilder
You will create a DB for each project you start based on this repo. For other projects change
webuilderto the new apps database name.
For more details see the installing postgres guides
For local development you will need two terminals open, one for the api-backend and another for the react-client.
Clone this app, then:
# api-backend terminal 1
cp .env.example .env
npm install
npm run dev# react-client terminal 2
cd WeBuilder
npm install
npm start- api-backend will launch at: http://localhost:8080
- react-client will launch at: http://localhost:3000
In production you will only deploy a single app. The react client will build into static files that will be served from the backend.
- Create a Heroku account (if you don't have one)
- Install the heroku cli (if you don't already have it)
- Requires that you have
gitinstalled
# login with the cli tool
heroku loginNext, cd into this project directory and create a project:
# replace `cool-appname` with your preferred app name
heroku create cool-appname
# add a free postgres database to your heroku project
heroku addons:create heroku-postgresql:hobby-devThis will make your app accessible at https://cool-appname.herokuapp.com (if the name is available).
You only need to do this once per app
Any environment variables your app needs will be available through your heroku project's settings page.
NOTE: Heroku calls them Config Vars
- Go to the dashboard page here: https://dashboard.heroku.com/apps
- Click on the Settings tab
- Click
Reveal Config Vars - Add any environment variables you have in your
.envfile
Whenever you want to update the deployed app run this command.
git push heroku mainThis command deploys your main branch. You can change that and deploy a different branch such as:
git push heroku development
. ├── README.md ├── api │ ├── app.js │ ├── config │ │ └── config.json │ ├── controllers │ │ ├── appConfig.js │ │ ├── about.js │ │ ├── contact.js │ │ ├── education.js │ │ ├── experience.js │ │ ├── image.js │ │ ├── project.js │ │ ├── index.js │ │ └── layouts.js │ └── models │ ├── about.js │ ├── contact.js │ ├── education.js │ ├── experience.js │ ├── project.js │ ├── image.js │ ├── index.js │ └── layout.js ├── WeBuilder │ ├── README.md │ ├── package-lock.json │ ├── package.json │ ├── public │ │ ├── favicon.ico │ │ ├── index.html │ │ ├── manifest.json │ │ └── robots.txt │ └── src │ ├── App.css │ ├── App.js │ ├── App.test.js │ ├── layouts │ │ ├── aboutMeLayouts.js │ │ ├── contactMeLayouts.js │ │ ├── cloudinary.js │ │ ├── education.js │ │ ├── experienceLayouts.js │ │ ├── projectLayouts.js │ │ ├── textbox-aboutme.js │ │ ├── textbox-experience.js │ │ ├── textbox-contactme.js │ │ ├── textbox-w-pic.js │ │ ├── textbox.js │ │ └── themeLayouts.js │ ├── index.css │ ├── index.js │ ├── logo.svg │ ├── pages │ │ ├── aboutMe.js │ │ ├── categories.js │ │ ├── contactMe.js │ │ ├── education.js │ │ ├── experience.js │ │ ├── homePage.js │ │ ├── information.js │ │ ├── navBar.css │ │ ├── nextBack.js │ │ ├── projects.js │ │ ├── themes.js │ │ └── userContext.js │ ├── pics │ │ ├── avatar.svg │ │ ├── logo.png │ │ ├── weBuilder.png │ │ ├── weBuilder.svg │ │ ├── weBuilder(hover).svg │ │ └── WeBuilderLogo.png │ ├── portfolio │ │ ├── Blank-Avatar.png │ │ ├── demoPorfolio.js │ │ ├── email.png │ │ ├── git.png │ │ ├── link.png │ │ ├── portfolio_style.css │ │ └── Project.png │ ├── portfolio-layouts │ │ ├── portfolio-abme-left.js │ │ ├── portfolio-contact-midl.js │ │ ├── portfolio-edu-left.js │ │ ├── portfolio-ex-left.js │ │ ├── portfolio-navBar.js │ │ └── portfolio-project-right.js │ ├── reportWebVitals.js │ ├── serviceWorker.js │ └── setupTests.js ├── package-lock.json └── package.json
