Skip to content

✔️ Laboratório Avançado de Software (LAS) essay blog project.

Notifications You must be signed in to change notification settings

senavs/essayb.com.br

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Advanced Software Lab (LAS) essay blog project.

Developers

  • João Marcelo de Jesus Macedo (Jmarcelo98).
  • Matheus Reis de Souza Teixeirense (Mat123Reis).
  • Matheus Sena Vasconcelos (senavs).
  • Ygor Oliveira Gonçalves (ygoliveira).

Project Advisor

  • Alexandre Mori.

Setup (with docker)

To run essayB application, you need to have installed docker. Follow this tutorial to get start. Besides, install docker-compose to deploy all containers easily.

Minimal docker and docker-compose version:

docker --version
# Docker version 20.10.3

docker-compose --version
# docker-compose version 1.28.2

After you have installed the docker and cloned the project, run the follow command inside project folder:

docker-compose up

Or you can run the development project with the follow command:

docker-compose -f docker-compose.dev.yml up

Note: to run docker-compose.dev.yml you need to set your local IP address into BACKEND_DOMAIN and FRONTEND_DOMAIN envs inside compose file. Like:

...
    build:
      context: frontend
      dockerfile: Dockerfile.dev
    restart: unless-stopped
    environment:
      # Use your IPv4 address to BACKEND_DOMAIN and FRONTEND_DOMAIN envs
      # Use port 8080 if gateway is activated, otherwise use 8080 to FRONTEND_DOMAIN and 8888 to BACKEND_DOMAIN
      BACKEND_DOMAIN: 172.17.0.1:8080
      FRONTEND_DOMAIN: 172.17.0.1:8080
    volumes:
      - ./frontend/next.config.js:/code/next.config.js
...

Setup locally (without Docker)

You can also run the application without docker installed. To do that, it's necessary to install all programs and libraries locally.

  • Frontend dependencies:
    First, it's necessary to install nodejs.

    node -v
    # v14.15.5

    Then, inside essayb.com.br/frontend folder, install all dependencies.

    npm install

    If it shows any permission error, try to run the same command with root user (or with an administrator cmd for Windows).

    sudo npm install
  • Backend dependencies:
    Second, to run all backend API, it's necessary to install Python 3.9 (or latest) version.

    python3 --version
    # Python 3.9.1

    Then, you need to install all python dependencies. To do so, get into essayb.com.br/backend folder and run the following command.

    pip install -e .
  • Database:
    EssayB application needs a database to store its data. PostgreSQL is the most recommended.

  • Running:
    After install postgres database, nodejs, python and all the dependencies, now it's time to run the EssayB application.

    Setup all environments variables before run frontend and backend apps.

    # linux/mac
    export DATABASE_URI='postgres://username:password@local_database_ip:5432/ESSAYB_DEV'
    # windows
    set DATABASE_URI='postgres://username:password@local_database_ip:5432/ESSAYB_DEV'

    Note: remember to replace username, password and local_database_ip with your local database configuration.

    With it's done, now you can run the apps.

    To run the frontend, get into essayb.com.br/frontend folder and run the follow command:

    npm run dev

    To run the backend, open a new terminal and get into essayb.com.br/backend folder and run the follow command:

    python3 -m api

URLs

Now you can access this URLs and test the application:

Local Application Project URL
Frontend (with docker) http://localhost:8080/
Frontend (without docker) http://localhost:3000/
Backend http://localhost:8888/docs
Production Application Project URL
Frontend WIP
Backend WIP

License

Copyright (c) essayB.
All Rights Reserved.