mentor-me-api

command module
v0.0.0-...-4b1df99 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 12, 2017 License: MIT Imports: 7 Imported by: 0

README

Mentor Me API

Mentor-Me is a simple mentor matchmaking app. Users can sign up as a mentor and/or mentee. Mentors can list a skill they'd like to mentor in along with their level of expertise in said skill. Mentees can search for mentors by skill and level. A mentee can submit a request for mentorship upon finding a desired mentor. The mentor can then accept or reject the request. Upon acceptance, the mentor and mentee will receive each other's contact information.

This is the API for the Mentor Me project, this time using Beego. You can find the front-end here.

Setup

  1. Install Go
    • You may need to add $GOPATH/bin to your $PATH
  2. Install Beego
  3. Install dep - go get -u github.com/golang/dep/...
  4. Run dep ensure to resolve dependencies
  5. Download and setup PostgreSQL
  6. Set environment variables for dbhost, dbuser, dbpass, and dbdatabase. If you're on Mac or Linux, you can run source setup_dev_db_env_vars.sh after changing the values within
  7. Create the database user
    • Mac/Linux: psql --username=postgres --password -c "CREATE USER ${dbuser} PASSWORD '${dbpass}'"
    • Windows: psql --username=postgres --password -c "CREATE USER %dbuser% PASSWORD '%dbpass%'"
  8. Create the database
    • Mac/Linux: psql --username=postgres --password -c "CREATE DATABASE ${dbdatabase} OWNER ${dbuser}"
    • Windows: psql --username=postgres --password -c "CREATE DATABASE %dbdatabase% OWNER %dbuser%"
  9. Setup the database schema
    • Mac/Linux: psql --username=${dbuser} --password -d ${dbdatabase} -f schema.sql
    • Windows: psql --username=%dbuser% --password -d %dbdatabase% -f schema.sql
  10. Fix up permissions
    • Mac/Linux: psql --username=postgres --password -c "REASSIGN OWNED BY postgres TO ${dbuser}" ${dbdatabase}
    • Windows:psql --username=postgres --password -c "REASSIGN OWNED BY postgres TO %dbuser%" %dbdatabase%
  11. Run bee run -downdoc=true -gendoc=true -vendor=true to generate documentation and run the server

Database

How to Export Database Changes

Mac/Linux: pg_dump -U ${dbuser} -W -s -O --clean ${dbdatabase} > schema.sql Windows: pg_dump -U %dbuser% -W -s -O --clean %dbdatabase% > schema.sql

How to Import Database Schema

Mac/Linux: psql -U ${dbuser} -W < schema.sql Windows: psql -U %dbuser% -W < schema.sql

Thanks

Documentation

The Go Gopher

There is no documentation for this package.

Directories

Path Synopsis
@APIVersion 1.0.0 @Title MentorMe API @Description Do stuff! Make things! @Contact bryanberry235711@gmail.com @TermsOfServiceUrl http://beego.me/ @License MIT License @LicenseUrl https://opensource.org/licenses/MIT
@APIVersion 1.0.0 @Title MentorMe API @Description Do stuff! Make things! @Contact bryanberry235711@gmail.com @TermsOfServiceUrl http://beego.me/ @License MIT License @LicenseUrl https://opensource.org/licenses/MIT

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL