/resume-creator-api

Primary LanguagePythonMIT LicenseMIT

GitHub contributors GitHub issues GitHub forks GitHub stars GitHub license


Resume Creator API

API for generating resumes easily

Explore the documentation

View Demo · Report a Bug · Request a Feature


Django Django REST Framework Docker Postgres

Getting Started

  1. Clone the repository

    git clone https://github.com/nelsonacos/resume-creator-api.git
  2. Open the command line and navigate to the project folder

    cd resume-creator-api
  3. Create the .env file to configure the environment variables

    # Unix System
    cat .env.example > .env
    
    # Windows System
    copy .env.example .env
  4. Configure environment variables

    # Use a new secret key in production
    DJANGO_SECRET_KEY="django-insecure-8ps&h4snq(-)$$@f-3vhp&dk7)hf@dnd19(4q_a+im^926hxu_"
    
    # Will be False if set to an empty string
    DJANGO_DEBUG=""
    
    # Postgres configuration
    DATABASE_HOST=db # should be the name defined in the docker-compose.yml file for the postgres service
    DATABASE_USER=postgres
    DATABASE_PASSWORD=password
    DATABASE_NAME=resume

(back to top)

Starting the Project with Docker Compose

docker-compose build && docker-compose up

Open http://localhost/resume/api/v1/ with your browser to see the result.

Visit the documentation http://localhost/resume/docs/

(back to top)

Starting the project in a virtual python environment

Prerequisites

Python Installation

  1. Update package repositories

    sudo apt update
  2. Install the package software-properties-common

    # allows adding a PPA (Personal Package Archive) repository needed to install Python 3
    sudo apt install software-properties-common
  3. Adds the deadsnakes PPA repository

    # contains different versions of Python
    sudo add-apt-repository ppa:deadsnakes/ppa
  4. Update the package repositories again to make the new repository available.

    sudo apt update
  5. Install python3

    sudo apt install python3
  6. Verify the python installation

    python3 --version

    Nota: These steps may vary depending on the operating system you are using. If you are using another operating system, such as macOS or Windows, the steps to install Python 3.10 may be different.

  7. Create a postgres container

    Postgres Installation

    docker run --name db -e POSTGRES_PASSWORD=password -d -p 5432:5432 postgres
  8. Access the container interactively

    docker exec -it db psql -U postgres
  9. Create a new database

    CREATE DATABASE resume;
  10. List databases

    \l
  11. To exit the Postgres

    \q
  12. Clone the repository

    git clone https://github.com/nelsonacos/resume-creator-api.git
  13. Open the command line and navigate to the project folder

    cd resume-creator-api
  14. Create the .env file to configure the environment variables

    # Unix System
    cat .env.example > .env
    
    # Windows System
    copy .env.example .env
  15. Configure environment variables

    # Use a new secret key in production
    DJANGO_SECRET_KEY="django-insecure-8ps&h4snq(-)$$@f-3vhp&dk7)hf@dnd19(4q_a+im^926hxu_"
    
    # Will be False if set to an empty string
    DJANGO_DEBUG=True
    
    # Postgres configuration
    DATABASE_HOST=localhost
    DATABASE_USER=postgres
    DATABASE_PASSWORD=password
    DATABASE_NAME=resume
  16. Create a virtual environment (optional but recommended)

    python3 -m venv venv
  17. Activate virtual environment

    # Unix System
    source venv/bin/activate
    
    # Windows System
    source venv/Scripts/activate
  18. Install pip and pip-tools on the virtual environment

    python -m ensurepip --upgrade && pip install pip-tools
  19. Install the dependencies

    pip-sync requirements-dev.txt
  20. Apply the database migrations

    python manage.py migrate
  21. Install the git hook scripts

    pre-commit install
  22. Start the project

    python manage.py test && python manage.py runserver

    Open http://localhost:8000/resume/api/v1/ with your browser to see the result.

    Visit the documentation http://localhost:8000/resume/docs/

(back to top)

Contribution

If you want to contribute to this project, follow these steps:

  1. Fork the project
  2. Create a branch for your contribution (git checkout -b feature/AmazingFeature)
  3. Make the necessary changes
  4. Commit your changes (git commit -m 'Add some amazing feature')
  5. Push your branch (git push origin feature/AmazingFeature)
  6. Open a Pull Request in this repository

(back to top)