Skip to content

kenware/favorite-things

Repository files navigation

favorite-things-api

This is an application that allows the user to track their favorite things

CircleCI Maintainability Coverage Status

Installation Guide and Django Setup

  • check that python3 is installed

    python3 -V
  • Install Postgres database

  • Clone this project

    git clone https://github.com/kenware/favorite-things.git
  • Enter project root directory

    cd apifavorite-things
  • install virtual env in your terminal at the project root

    pip3 install virtualenv
  • create virtualenv

    virtualenv env
  • In the root directory, open env/bin/activate file and add the environmental variable at the bottom of the activate file accordingto the sample bellow:

    export DATABASE_URL=<database_url>
    export SECRETE=<your secrete key>
  • Inside the deactivate block of code in the env/bin/activate file add:

    unset DATABASE_URL
    unset SECRETE
  • Activate virtualenv

    source env/bin/activate
    
  • Install packages

    pip3 install -r requirements.txt
  • Run test

    python3 manage.py test
  • Migrate tables to postgres database

    python3 manage.py migrate
  • Start the application

    python3 manage.py runserver

Installation Guide and VueJs Setup

  • in the root of the project
    cd client
  • check that Nodejs or npm is installed
    node -V
  • Install dependency
    npm install
  • Start development server
    npm run serve

Auto-linting with pylint, es-lint, pylint-django and autopep8

  • This project follows Pep8 style guide.
  • You can enable pylint on your code editor for python
  • Es-lint for javascript with air-bnb style guide
  • To auto fix javascript linting errors, run
    cd favorite_app/client
    
    npm run lint
  • To show linting error in python, run this command
    pylint --load-plugins pylint_django favorite_app/
  • To auto fix all linting errors in django, run
     autopep8 --in-place --aggressive --aggressive favorite_app/*.py

Documentation

  • This API is fully documented using openApi. The schema file if found in the root directory of this project named openapi-shema.yml
  • To generate a new schema, run the command below
./manage.py generateschema > openapi-schema.yml

AWS EC2 Deployment

  • The deployment sript for this project is found in the root directory with a file named deployment_script.sh.
  • Ensure you have setup AWS account and have launched an instance in the ubuntu machine with security groups, vpc etc.
  • ssh into the instance and run the following commands
    git clone https://github.com/kenware/favorite-things.git
    chmod +x deployment_script.sh
    bash deployment_script.sh

About

This is an application that allows the user to track their favorite things

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 2

  •  
  •