Giter Site home page Giter Site logo

fotofacts's Introduction

Fotofacts is an app used to organize your photo collection. Each individual user can create a profile, or login through github, upload a photowith all specific details of the event and see a library of their Photos in one place.

So if you have you ever looked through your photos and forgot the details associated with a photo (event title, attendees, etc.) and wished you could recall that memory. No need to fret Fotofacts is the resolution.


Tools:

  1. HTML
  2. CSS
  3. JAVASCRIPT
  4. GITHUB
  5. JSON
  6. BOOTSTRAP
  7. HEROKU
  8. NPM PACKAGE MANAGER
  9. POSTGRES DATABASE
  10. SEQULIZE ORM
  11. PASSPORT.JS
  12. DOG API

Frontend

Bootstrap CSS3 HTML5 JavaScript TypeScript Git

Backend

JavaScript Express.js Git PostgreSQL

DevOps

Node.js

Developed by:

Detailed summary (for Mac)

  1. Check if you have homebrew already installed
brew -v
  1. If it is not installed, install it
/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
  1. If you are asked for your computer's password, enter it at the prompt
  2. Press RETURN to continue
  3. Confirm that homebrew is installed with brew -v
  4. Check to see if PostgreSQL is already installed
psql --version
  1. If PostgreSQL is not installed, use homebrew to install it
brew install postgresql
  1. Confirm that PostgreSQL is installed with psql --version
  2. Start the database server
brew services start postgresql
  1. Initialize a shell to interact with the database
psql postgres
  1. You know you are in the shell if you see a prompt that begins with #
  2. While in the shell, list the databases with \l
  3. Enter q to quit the listing of databases
  4. Create a new role
CREATE ROLE dev_admin LOGIN PASSWORD 'admin';
  1. Alter its permissions so that this new role is a superuser
ALTER USER dev_admin WITH SUPERUSER;
  1. Verify that the role and permission level is created with \du
  2. In a browser, navigate to your account in GitHub
  3. Click on your avatar in the upper right
  4. Click settings
  5. Click Developer settings
  6. Click oAuth apps
  7. Click Register a new application
  8. Complete the fields as follows
Application name -> gh-oauth-psql-demo
Homepage URL -> http://locahost:8080
Authorization callback URL -> http://localhost:8080/auth/github/callback
  1. Click Register Application
  2. Copy Client ID and keep it somewhere you can get at it again
  3. Click Generate a new client secret
  4. Enter your GitHub password to confirm the last step
  5. Copy Client secret and keep it somewhere you can get at it again
  6. Upload a logo (optional)
  7. Click Update application

Steps below in VSCode

  1. Open the project in in VSCode
  2. Duplicate .env-example
  3. Rename this duplicated file to .env
  4. Fill in the missing values while making sure there are no spaces
GITHUB_CLIENT_ID=**\*\***
GITHUB_CLIENT_SECRET=

DB_HOST=localhost
DB_PORT=5432
DB_NAME=fotofacts
DB_USER=<fill in Windows only>
DB_PASS=<fill in Windows only>

// inside of your .env file

  1. Open a new terminal instance within VSCode
  2. Using the terminal instance, create the database
npx sequelize-cli db:create
  1. Open new PostgreSQL shell instance within VSCode
psql postgres
  1. List the databases with \l and verify that the database gh_oauth_psql_demo_dev has been created
  2. Using the terminal instance, run a migration in order to build the Users table
npx sequelize-cli db:migrate
  1. Return to the PostgreSQL shell instance and connect to the database that was created in step 36
\c gh_oauth_psql_demo_dev
  1. Verify that the Users table was created (note that it will not have any rows)
SELECT * FROM "Users";
  1. Using the terminal instance, start the application
npm run dev
  1. In a browser, navigate to localhost:8080
  2. Click Login
  3. At the GitHub prompt, click Authorize this application
  4. In the PostgreSQL shell, execute SELECT * FROM "Users"; to verify that you are now a user listed in the database

ERD

erd

FotoFacts RESTful Routing Overview

Routes for Photos (Users coming soon)

HTTP Verb Route RESTful description Purpose
GET * catchAll 404 error handling.
GET /heartbeat resSend Sanity check.
GET / static page FotoFacts homepage.
GET /auth/github passportGithubAuth Sets Github Auth.
GET /auth/github/callback passportGithubCB Call back action for Github Auth.

FotoFacts Models

  • User
Attribute Example value
avatarURL https://placeimg.com/128/128/any
firstName Junghae
lastName Moon
email [email protected]
  • Photo
Attribute Example value
title Eating at Costco
category vacation
attendee1FirstName SoJong
attendee1LastName Lee
attendee2FirstName Teila
attendee2LastName Jones
attendee3FirstName Avery
attendee3LastName Song
description After a long week
url http://placeimg.com/640/480/food

sample code:

  • Users Model:

npx sequelize-cli model:generate --name User --attributes firstName:string,lastName:string,email:string,avatarURL:string,loginStrategy:string,loginStrategyId:string,username:string

  • Photo Model:

npx sequelize-cli model:generate --name Photo --attributes title:string,category:string,attendee1FirstName:string,attendee1LastName:string,attendee2FirstName:string,attendee2LastName:string,attendee3FirstName:string,attendee3LastName:string,description:string,url:string,userId:integer

fotofacts's People

Contributors

heggy231 avatar a-d-h-3 avatar developersstateofmind avatar

Stargazers

 avatar

Watchers

James Cloos avatar  avatar  avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.