Giter Site home page Giter Site logo

596-s22-backend's Introduction

596-S22-Backend

Backend Repo for 596RL Spring 2022

.
├── app
│   ├── __init__.py
│   └── main.py
│   └── models.py
│   └── schemas.py
│   └── database.py
│   └── crud.py
├── Alembic
├── Dockerfile
└── requirements.txt

👾 MUST BE INSTALLED

- Docker
- Alembic     (Locally for database manipulation)
- SQLAlchemy  (Locally for database manipulation)

🤝 How to Run the Package in Another Repo

To learn how to run the backend in YOUR repo, follow this guide here.

👀 Configuring Secrets

To successfully connect to the database, we use a .env file, which you will need to generate using: touch .env in the backend directory. This is an untracked file in our repo. Here you will need to paste in the secrets of the backend. DM Sam DuBois and he will send you the file.

# PostgreSQL Container Secrets
POSTGRES_USER=
POSTGRES_PASSWORD=
POSTGRES_DB=

# Transcriber Server Container Connection Details
TRANSCRIBER_SERVER_HOSTNAME=
TRANSCRIBER_SERBER_PORT=

🚀 How to Run the Container

This repo uses Docker to containerize any processes used. In order to the run the repo, it is advised that you install docker.

Make sure the Docker and the postgresSQL library are working.

From there, all you need to do to run the container is:

docker compose build
docker compose up

🧪 Useful Tools for Debugging and Testing

localhost:8000/docs   # This is a place to view all the routes available as well as manipulate them
Postman               # This is a popular dev tool for route testing and debugging (A personal favorite)

💻 Configuring PostgreSQL Server with Alembic

In order to begin posting to routes and adding in data, you will need to load in all the proper tables. Using Alembic this is really easy.

First, install alembic onto your local machine:

pip3 install alembic

Next, generate your alembic revision file (this is where you will do all your database modifications)

alembic revision -m "<What your revision is>"

To make sure your revision is properly written, you can check it with:

alembic upgrade head --sql

Finally, you need to upgrade the head in order to setup all the tables properly:

alembic upgrade head

💽 Downgrading and Upgrading the Database

Using alembic, you can downgrade to a previous version by typing:

alembic downgrade -1

Or you can upgrade 1 version by typing:

alembic upgrade +1

596-s22-backend's People

Contributors

sdub18 avatar colettebas avatar andy-guti avatar satwikgoyal avatar chaoticmonky avatar

Watchers

James Cloos avatar  avatar Jagath Jai Kumar avatar

596-s22-backend's Issues

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.