Skip to content

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

Notifications You must be signed in to change notification settings

SilviaPabon/buenavida-backend

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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

About

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

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published