Coder Social home page Coder Social logo

aimedic's Introduction

aimedic

Requirements

  • Python / Django 4.2

Project setup

If not using docker, you can setup a virtual environment using the command below

python -m venv env

then activate it with

./env/Scripts/activate   # windows or
source env/bin/activate  # linux or mac

Install required packages

Run the command below

python -m pip install -r requirements-dev.txt

Once the virtual environment has been activated, install the necessary requirements by using the command below

python manage.py migrate

Database backups and restore

Sometimes you may want to delete your database but don't want to lose your data. To do this, run the following script

Backup command

python -Xutf8 manage.py dumpdata --natural-primary --exclude=contenttypes --exclude=auth.permission --exclude=admin.logentry --exclude=sessions.session > ../data.json

Restore command

python manage.py loaddata ../data.json

Important steps

Pre development

  • Go to the Github issues (https://github.com/ibukun-brain/aimedic/issues/)
  • In the selected for development lane, choose a ticket an assign to yourself
  • Move the chosen ticket to in progress
  • Create a branch in your local pc but branching from the develop branch.
git checkout -b aimedic-1/lowercased-short-description

Dev complete

  • Once coding is done, run git commit -m "short description"
  • run the scripts.sh script.
  • Alternatively, you can manually run the commands below
pylint $(git ls-files '*.py')
flake8
python manage.py test --keepdb -v 2
  • If successful, git push your code to Github
  • Create a merge request using the link generated from the terminal

Dev complete

  • Notify two colleagues to perform code reviews
  • If code review is successful, merge to develop and move ticket to closed lane on Github

Contribution

Pick a ticket on the Github Repository. If you haven't cloned the repository, use the command to clone from the terminal

git clone https://github.com/ibukun-brain/aimedic

When creating a new branch, ENSURE that the branch name starts with the format SSS-<issue-no>-<short-description> e.g. aimedic-1-project-setup and the main branch is from develop. use the command below when creating a new branch.

git checkout develop
git branch -b <branch name>

Before creating a pull request, run the commands and fix any warning/errors encountered

sh ./scripts.sh

git add .
git commit -m "my commit message"
git push -u origin <branch name>

Note: You will need to have isort, autopep8, black and pylint installed for this to work and you can install it using the commands below.

python -m pip install autopep8 pylint isort flake8

When creating a pull request, please select the target branch as develop.

  • After writing your code, make sure to run the scripts.sh file and ENSURE it passes before pushing to the git repository. Use the command below to run the test.
sh ./scripts.sh

Pushing to the repository

Run the following command

 # if pushing for the first time
$ git push -u origin <branchname>

# if pushing normally
$ git push

Installing make

# Install make on windows
choco install make

# Linux or mac
sudo apt install make

Using make command

  • Export database content as json for backup purposes
make backup
  • Creates a virtual environment in current working directory
make env
  • Fixes your database if it gets corrupted. Creates a backup and also restore current data
make fixdb
  • Displays help text on how to use the makefile
make help
  • Syncs the project dependencies
make install
  • Checks if code is conforming to best practices like PEP8
make lint
  • Runs makemigrations and migrate commands
make migrate
  • Pushes committed changes to the Github remote repository
make push
  • Loads previously backed up data into the database
make restore
  • Spawns the Django server
make server
  • Runs unit test
make test
  • Syncs the project dependencies
make update

aimedic's People

Watchers

Kostas Georgiou avatar Olaifa Ibukun avatar

Forkers

code-brainy

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.