• Stars
    star
    196
  • Rank 198,553 (Top 4 %)
  • Language
    Python
  • License
    GNU General Publi...
  • Created over 6 years ago
  • Updated about 1 year ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Mentorship System is an application that matches women in tech to mentor each other, on career development, through 1:1 relations during a certain period of time. This is the backend of this system.

Mentorship System (Backend)

Build Status codecov project chat Python 3.x Docs

Mentorship System is an application that allows women in tech to mentor each other, on career development topics, through 1:1 relations for a certain period. This is the Backend REST API for the Mentorship System.

This API is being used by 3 frontend projects currently being developed:

Table of Contents

Features

  • Login and register a new user
  • Create a user profile, view and edit user profiles
  • Change user password, refresh jwt tokens
  • Create relation between two users for a fixed period of time
  • Both mentor and mentee in a relation can create tasks
  • Assign and remove admin roles to users and list all admins
  • List all the relationships of a given user
  • List details of current, past and pending mentorship relations
  • Create a new task in a mentorship relation if the specified user is already involved in it.
  • Retrieve and delete tasks from mentorship relation
  • Task comment functionalities like create a task comment, get task comments using a task id.
  • Get statistics of a user like Pending Requests, Accepted Requests, Rejected Requests, Completed Relations, Cancelled Relations and upto 3 recent achievements

Setup and run

To setup the project locally read these wiki pages and follow the instructions:

Run app in Windows

The project runs on Python 3.

  1. Create a virtual environment:
virtualenv venv --python=python3
  1. Activate the virtual environment: For Git Bash Users:
source ./venv/Scripts/activate

For Windows Command Line Users:

venv\Scripts\activate
  1. Install all the dependencies in requirements.txt file:
pip install -r requirements.txt
  1. Make sure you create .env using .env.template and update the values of corresponding environment variables or make sure you exported the following environment variables:
export FLASK_ENVIRONMENT_CONFIG=<local-or-dev-or-test-or-prod-or-stag>
export SECRET_KEY=<your-secret-key>
export SECURITY_PASSWORD_SALT=<your-security-password-salt>
export MAIL_DEFAULT_SENDER=<mail-default-sender>
export MAIL_SERVER=<mail-server>
export APP_MAIL_USERNAME=<app-mail-username>
export APP_MAIL_PASSWORD=<app-mail-password>
export MOCK_EMAIL=<True-or-False>

If you're testing any environment other than "local", then you have to also set these other variables:

export DB_TYPE=<database_type>
export DB_USERNAME=<database_username>
export DB_PASSWORD=<database_password>
export DB_ENDPOINT=<database_endpoint>
export DB_NAME=<database_name>
  1. Run the app:
python run.py
  1. Navigate to http://localhost:5000 in your browser

  2. When you are done using the app, deactivate the virtual environment:

deactivate

Run app in Linux

The project runs on Python 3.

  1. Create a virtual enviorntment:
virtualenv venv
  1. Activate the virtual environment:
source venv/bin/activate
  1. Install all the dependencies in requirements.txt file:
pip3 install -r requirements.txt
  1. Make sure you create .env using .env.template and update the values of corresponding environment variables. Make sure you exported the following environment variables if you didn't adapt .env.template in the .env file:
export FLASK_ENVIRONMENT_CONFIG=<local-or-dev-or-test-or-prod-or-stag>
export SECRET_KEY=<your-secret-key>
export SECURITY_PASSWORD_SALT=<your-security-password-salt>
export MAIL_DEFAULT_SENDER=<mail-default-sender>
export MAIL_SERVER=<mail-server>
export APP_MAIL_USERNAME=<app-mail-username>
export APP_MAIL_PASSWORD=<app-mail-password>
export MOCK_EMAIL=<True-or-False>

If you're testing any environment other than "local", then you have to also set these other variables in the .env file.

export DB_TYPE=<database_type>
export DB_USERNAME=<database_username>
export DB_PASSWORD=<database_password>
export DB_ENDPOINT=<database_endpoint>
export DB_NAME=<database_name>

Use: printenv to print the environment variables and check all configurations.

  1. Run the app with python run.py or:
 export FLASK_APP=run.py
 flask run
  1. Navigate to http://localhost:5000 or the current server in which you are running(will be shown when app is running) in your browser.

  2. When you are done using the app, deactivate the virtual environment:

deactivate

or use:

source deactivate

Run with docker

  1. Make sure you exported the following environment variables to .env file

  2. Build docker image

docker build -t mentorship-backend:latest .
  1. Deploy Docker container ports must be mapped to the host machine port using '--publish' so they're visible.
docker run --env "FLASK_APP=run.py" --publish 5000:5000 mentorship-backend:latest

Run tests

To run the unitests run the following command in the terminal (while the virtual environment is activated):

python -m unittest discover tests

Auto-formatting with black

We use Black to format code automatically so that we don't have to worry about clean and readable code. To install Black:

pip install black

To run black:

black .

Sorting imports with isort

We use isort to sort imports alphabetically, and automatically separated into sections and by type. To install isort:

pip install isort

To run isort:

isort . --profile=black

Automate auto-formatting tools with pre-commit

We use pre-commit to check formatting before every commit message. To install pre-commit:

pip install pre-commit

To set up the git hook scripts:

pre-commit install

Documentation

Documentation for the project is hosted here. We use Docusaurus for maintaining the documentation of the project.

You can learn more about this project through the documentation in the docs folder and on our Wiki.

Here are some links to documentation for this project:

Understand more about our technical decisions made along with this project development in Technical Decisions Wiki page.

Contributing

Please read our Contributing guidelines, Code of Conduct and Reporting Guidelines

Please follow our Commit Message Style Guide and Coding Standards while sending PRs.

Contributors

Thanks goes to these people (emoji key):


Isabel Costa

๐Ÿšง

Vaishnavi Joshi

๐Ÿšง ๐ŸŽจ

Aditya Kurkure

๐Ÿ’ป ๐Ÿšง โš ๏ธ

Kapil Bansal

๐Ÿ’ป ๐Ÿšง โš ๏ธ

Gauri V. Nair

๐Ÿ’ป ๐Ÿšง

This project follows the all-contributors specification. Contributions of any kind welcome!

Branches

The repository has the following permanent branches:

  • master This contains the code which has been released.

  • develop This contains the latest code. All the contributing PRs must be sent to this branch. When we want to release the next version of the app, this branch is merged into the master branch. This is the branch that is used in the deployed version of the app on Heroku.

  • bit This branch is for MS-backend version specific to BridgeInTech project. All the contributing PRs related to BIT-MS integration issue must be sent to this branch.
    IMPORTANT!! If this is your first time setting up the BridgeInTech project, please DO NOT RUN the MS backend server from this branch BEFORE you run the BIT backend server. Failing to do this will mess up the postgres db schemas used in BIT project. More instruction on setting up the BridgeInTech project can be found here.

Contact

You can reach the maintainers and our community on AnitaB.org Open Source Zulip. If you are interested in contributing to the mentorship system, we have a dedicated stream for this project #mentorship-system, where you can ask questions and interact with the community, join with us!

License

Mentorship System is licensed under the GNU General Public License v3.0. Learn more about it in the LICENSE file.

More Repositories

1

mentorship-android

Mentorship System is an application that matches women in tech to mentor each other, on career development, through 1:1 relations during a certain period of time. This is the Android application of this project.
Kotlin
165
star
2

anitab-org.github.io

AnitaB.org Open Source website has information about our community, including our open source projects, participation in programs, events, and a few contribution guidelines.
JavaScript
149
star
3

powerup-android

PowerUp is an educational choose-your-own-adventure game that utilizes a users uploaded curriculum to empower pre-adolescents to take charge of their reproductive health. This is the Android version of the game.
Java
117
star
4

portal

THIS PROJECT IS ARCHIVED. Systers Portal for communities.
Python
68
star
5

mentorship-flutter

THIS PROJECT IS ARCHIVED. Mentorship System is an application that matches women in tech to mentor each other, on career development, through 1:1 relations during a certain period of time. This is the Flutter version of this project.
Dart
59
star
6

bridge-in-tech-web

BridgeInTech (BIT) is an application that allows organizations, mentors and mentees to actively collaborate through mentoring programs. This is the frontend client of BridgeInTech.
JavaScript
57
star
7

anitab-forms-web

AnitaB Forms (web), an application to process smaller 4-week or full day programs to contribute to open source projects. Similar to GSoC, Outreachy, or RGSoC. This is the web app.
JavaScript
42
star
8

powerup-iOS

PowerUp is an educational choose-your-own-adventure game that utilizes a users uploaded curriculum to empower pre-adolescents to take charge of their reproductive health. This is the iOS version of the game.
Swift
40
star
9

bridge-in-tech-backend

BridgeInTech (BIT) is an application that allows organizations, mentors and mentees to actively collaborate through mentoring programs. This is the backend client of BridgeInTech.
Python
24
star
10

open-source-day

GHC Open Source Day (OSD)
JavaScript
19
star
11

documentation

Documentation writing at AnitaB.org Open Source organization level.
18
star
12

anitab-forms-backend

AnitaB Forms (backend), an application to process smaller 4-week or full day programs to contribute to open source projects. Similar to GSoC, Outreachy, or RGSoC. This is the backend app.
Python
18
star
13

mentorship-ios

THIS PROJECT IS ARCHIVED. Mentorship System is an application that matches women in tech to mentor each other, on career development, through 1:1 relations during a certain period of time. This is the iOS application of this project.
Swift
14
star
14

stem-diverse-tv

STEM Diverse TV is a project which gather and provide inspiring, motivating, informative, educational and supportive videos about diversity in STEM. This is a backend which provide content for multiple frontend applications build with Applicaster Zapp platform.
Python
13
star
15

powerup-scenario-builder

PowerUp Scenario Builder allows graphing and exporting question and answer tables for PowerUp, a text-adventure style mobile game by AnitaB.org Open Source.
JavaScript
6
star
16

powerup-story-designer

PowerUp Story Designer allows creating automated story sequences for PowerUp, a text-adventure style mobile game by AnitaB.org Open Source.
JavaScript
5
star
17

stem-diverse-tv-cms

CMS for managing content of STEM Diverse TV
TypeScript
4
star
18

.github

Default community health files
2
star
19

events

Repository with pages for our Open Source events/programs
CSS
2
star
20

2024-GHC-OSD

Repository for co-chairs and supporters to collaborate on tasks related to delivering the 2024 GHC Open Source Day event
JavaScript
2
star
21

vms

THIS PROJECT IS ARCHIVED. Volunteer Management System.
Python
1
star