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.
- Install Go
- You may need to add $GOPATH/bin to your $PATH
- Install Beego
- Install dep -
go get -u github.com/golang/dep/...
- Run
dep ensure
to resolve dependencies - Download and setup PostgreSQL
- Set environment variables for
dbhost
,dbuser
,dbpass
, anddbdatabase
. If you're on Mac or Linux, you can runsource setup_dev_db_env_vars.sh
after changing the values within - 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%'"
- Mac/Linux:
- 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%"
- Mac/Linux:
- 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
- Mac/Linux:
- 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%
- Mac/Linux:
- Run
bee run -downdoc=true -gendoc=true -vendor=true
to generate documentation and run the server
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
Mac/Linux: psql -U ${dbuser} -W < schema.sql
Windows: psql -U %dbuser% -W < schema.sql
- Thanks to https://github.com/ikeikeikeike/beego-samples for authentication