Skip to content

llyu0966/webuilder-backend

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

34 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

WeBuilder

An easy-to-use Portfolio Builder App for CUNY Tech Prep team project with React, Express.js, and Sequelize.js


Stack

API

  • express.js
  • sequelize.js

React client

  • Built using create-react-app and configured to work with the api.
  • Bootstrap 4.x added to /WeBuilder/public/index.html
  • React Router

Development Setup

Each team member will need to do this on their local machine.

Create a postgres db

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 webuilder to the new apps database name.

For more details see the installing postgres guides

Running the app

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

In production you will only deploy a single app. The react client will build into static files that will be served from the backend.

Deployment

Setting up Heroku

  1. Create a Heroku account (if you don't have one)
  2. Install the heroku cli (if you don't already have it)
  • Requires that you have git installed
# login with the cli tool
heroku login

Create a Heroku project

Next, 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-dev

This 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

Add Environment Variables

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 .env file

Deploying the app

Whenever you want to update the deployed app run this command.

git push heroku main

This command deploys your main branch. You can change that and deploy a different branch such as: git push heroku development

Project Structure

.
├── 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

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 3

  •  
  •  
  •