GithubHelp home page GithubHelp logo

silviapabon / buenavida-backend Goto Github PK

View Code? Open in Web Editor NEW
3.0 1.0 0.0 317 KB

Colleage project related to web development course. The project is about a ficticious skin care store, in this repo is implemented the backend side. Here you can find frontend side: https://github.com/MiguelMRojas/buenavida-frontend

License: GNU Affero General Public License v3.0

Go 93.83% Shell 0.08% JavaScript 2.26% PLpgSQL 3.83%
backend-api docker go golang

buenavida-backend's Introduction

Buenavida back-end

๐Ÿ“œ You can find more documentation on /docs folder.

Setup

To start the project at the first time:

Create the .env files:

From the api/ folder, create a .env file and define the following values (**for development environment using the provided docker-compose file):

MONGO_USER=admin
MONGO_PASSWORD=admin
MONGO_HOST=localhost
MONGO_PORT=27017
PG_USER=admin
PG_PASSWORD=admin
PG_HOST=localhost
PG_PORT=5432
PG_DATABASE=buenavida
REDIS_HOST=localhost
REDIS_PORT=6379
REDIS_PASSWORD=admin
REDIS_DATABASE=0
JWT_KEY={4Z!502lmtA4Guo6shSnaC+(8$bpR4Q+

From the bulkdata/ folder, create a .envfile and define the following values (**for development environment using the provided docker-compose file):

MONGO_USER=admin
MONGO_PASSWORD=admin
MONGO_HOST=localhost
MONGO_PORT=27017

Setup postgres database

Start docker containers:

docker-compose up

The first time you start the docker-compose file, run the following commands to create the database and it's tables:

  1. Create an interactive shell into the postgres container:
docker exec -it $(docker ps --filter NAME=pg_database --format "{{.ID}}") /bin/bash
  1. Execute the init.sql script:
psql -U admin -a -f files/init.sql
  1. Stop and restart the container (Ctrol + C, docker-compose up).

Start development environment

  1. Run the docker containers:
docker-compose up
  1. Start the golang api:

You have to install air to complete the next step:

go install github.com/cosmtrek/air@latest

From /api folder:

./listen.sh

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.