A FARM stack app automated with docker-compose

Overview

Expense-Tracker

An expense tracker built with FARM stack (FastAPI,React,MongoDB)

frontend

Requirements

  • Docker
  • Docker-Compose

Install and Run

To install and run the application, use docker-compose as given below:

  1. Build: To build the application (api+frontend+db):

     docker-compose up -d --build
    
  2. Delete or Remove: To delete or remove the containers (api+frontend+db):

     docker-compose down
    

A demo CLI after running docker-compose cli

Shut application makefile

Running Containers docker

Environments

There are two environments as of now, development and production

  1. Development:
  • Build:

      docker-compose up -d --build
    

To make this command easier using Makefile:

    make compose_up
  • Delete or Remove:

      docker-compose down
    

To make this command easier using Makefile:

    make compose_down
  1. Production:
  • Build: To build it for production using react-multistage builds and nginx

      docker-compose -f docker-compose.prod.yml up -d --build
    

To make this command easier

    make compose_prod_up
  • Delete or Remove: To remove the running containers

      docker-compose -f docker-compose.prod.yml down
    

To make this command easier

    make compose_prod_down

Architecture

The architecture of the backend is as follows:

  • API Framework: FastAPI
  • ORM (Object Relational Mapper): Python Class Abstraction
  • API Query framework: GraphQL
  • DB: MongoDB
  • DB Driver: Pymongo
  • Cache: Redis
  • CI/CD: Github Actions
  • Container: Docker
  • Workflow: Docker-Compose

Services and PORTS:

The services running are:

  • api (fastapi)
  • frontend (react)
  • db (mongodb)

The ports running these services on:

Development Env:

  • api: localhost:8000
  • frontend: localhost:3000
  • db: localhost:27017

Production Env:

  • api: localhost:8000
  • frontend: localhost:4000
  • db: localhost:27017

API Documentation:

Dashboard:

  • Overall Dashboard: GET /dashboard/all
  • Monthly Dashboard: GET /dashboard/{month_name}

Transactions:

  • All Transactions: GET /transaction/all
  • Get Transaction by ID: GET /transaction/{id}
  • Get Transactions by Month: GET /transactions/{month}
  • Add a Transaction: POST /transaction/add
  • Delete a Transaction by ID: DELETE /transaction/{id}
  • Delete entire Table/Collection: DELETE /transactions
You might also like...

A secure MERN Stack boilerplate ready for Production that uses Docker & Nginx.

A secure MERN Stack boilerplate ready for Production that uses Docker & Nginx.

A production ready & secure boilerplate for the MERN Stack that uses Docker & Nginx. Focus on the product and not the setup. You can directly start wo

Dec 23, 2022

Automated packaging of Debian-flavored NGINX with PageSpeed modules. Written in Bash and GitHub Workers. APT Repository hosted on Dokku.

NGINX + Google PageSpeed Configuring NGINX to build correctly is a pain. Not because of anything wrong with it, but rather because of how slim the sta

Oct 14, 2022

PrivacyBot - A simple automated service to initiate CCPA deletion requests with databrokers

PROJECT NO LONGER SUPPORTED As of 9.28.21 this project has been depreciated and Google Oauth verification is not supported. You can still run the tool

Jan 3, 2023

Import flow for Excel (.xlsx) and CSV file with automated column matching and validation.

Import flow for Excel (.xlsx) and CSV file with automated column matching and validation.

RSI react-spreadsheet-import ⚡️ A component used for importing XLS / XLSX / CSV documents built with Chakra UI. Import flow combines: 📥 Uploader ⚙️ P

Dec 24, 2022

This repo contains the templates used in my automated obsidian weekly review video and also an accompanying vault with the folder structure expected and plugins

This repo contains the templates used in my automated obsidian weekly review video and also an accompanying vault with the folder structure expected and plugins

This repo contains the templates used in my automated obsidian weekly review video and also an accompanying vault with the folder structure expected and plugins (periodic note settings etc)

Dec 21, 2022

An automated crawler that extracts products and categories from Digikala!

Digikala-Crawler The purpose of this project is to conduct research and we are not responsible for any misuse of this project. This is not a very clea

Feb 16, 2022

🧩 Sokoban game and automated puzzle solver

🧩 Sokoban game and automated puzzle solver

🧩 sokoban My blog post: Building and Solving Sokoban A Sokoban game built with Next.js — skinned with Boxxle sprites, and packaged with 40 tiny eloqu

Jun 8, 2022

An automated tool help you to transform backend json data to TypeScript type.

ohmyts An automated tool help you to transform backend json data to TypeScript type. Quick Start Vite install npm i @ohmyts/vite -D 🤽 playground play

Sep 23, 2022

Automated testing for single-page applications (SPAs). Small, portable, and easy to use. Click on things, fill in values, await for things exist, etc.

SPA Check Automated testing for single-page applications (SPAs). Small, portable, and easy to use. Click on things, fill in values, await for things e

Dec 23, 2022
Comments
  • :bug: Fixed API request URL for Windows users, resolves using docker …

    :bug: Fixed API request URL for Windows users, resolves using docker …

    Bugs

    • Error while testing for Windows using WSL
    • API endpoints working fine with http:0.0.0.0:8000/ but was not being accessible from frontend

    Fixes:

    • Updated .env in frontend to resolve with docker internal network
    REACT_APP_URL="http://host.docker.internal:8000"
    
    opened by saamya2006 1
  • ⬆️ Bump terser from 5.14.1 to 5.15.1 in /app/frontend

    ⬆️ Bump terser from 5.14.1 to 5.15.1 in /app/frontend

    Bumps terser from 5.14.1 to 5.15.1.

    Changelog

    Sourced from terser's changelog.

    v5.15.1

    • Fixed missing parentheses around optional chains
    • Avoid bare let or const as the bodies of if statements (#1253)
    • Small internal fixes (#1271)
    • Avoid inlining a class twice and creating two equivalent but !== classes.

    v5.15.0

    • Basic support for ES2022 class static initializer blocks.
    • Add AudioWorkletNode constructor options to domprops list (#1230)
    • Make identity function inliner not inline id(...expandedArgs)

    v5.14.2

    • Security fix for RegExps that should not be evaluated (regexp DDOS)
    • Source maps improvements (#1211)
    • Performance improvements in long property access evaluation (#1213)
    Commits
    • 4255fb3 5.15.1
    • d31c829 update changelog
    • bb2e20f take optional chains into account when locating the left-most item in an expr...
    • 350f965 some cleanups
    • 5fc3925 Update actions/setup-node action to v3 (#1156)
    • be73559 Update actions/upload-artifact action to v3 (#1161)
    • 666f79e chore(deps): update actions/checkout action to v3 (#1158)
    • 3652dce fix: incorrect to_simple_statement (#1253)
    • 34e8262 chore: fixed a couple of typos (#1271)
    • 089e32a avoid a class being inlined twice when identity can be compared. (close #1267)
    • Additional commits viewable in compare view

    Dependabot compatibility score

    Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting @dependabot rebase.


    Dependabot commands and options

    You can trigger Dependabot actions by commenting on this PR:

    • @dependabot rebase will rebase this PR
    • @dependabot recreate will recreate this PR, overwriting any edits that have been made to it
    • @dependabot merge will merge this PR after your CI passes on it
    • @dependabot squash and merge will squash and merge this PR after your CI passes on it
    • @dependabot cancel merge will cancel a previously requested merge and block automerging
    • @dependabot reopen will reopen this PR if it is closed
    • @dependabot close will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
    • @dependabot ignore this major version will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this minor version will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this dependency will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)
    • @dependabot use these labels will set the current labels as the default for future PRs for this repo and language
    • @dependabot use these reviewers will set the current reviewers as the default for future PRs for this repo and language
    • @dependabot use these assignees will set the current assignees as the default for future PRs for this repo and language
    • @dependabot use this milestone will set the current milestone as the default for future PRs for this repo and language

    You can disable automated security fix PRs for this repo from the Security Alerts page.

    dependencies 
    opened by dependabot[bot] 0
Owner
Deepraj
Software Developer || Freelancer || Open-Source Contributor 💻
Deepraj
A Turborepo with Strapi v4 (w/ postgres database) + Next.js powered by docker and docker-compose

Turborepo + Strapi + Next.js + Docker A Turborepo with Strapi v4 (w/ postgres database) + Next.js powered by docker and docker-compose. ⚠️ Prerequisit

Elvin Chu 60 Dec 29, 2022
Atlan is a CLI that helps you to manage local dockerized infrastructure without any needed knowledge on Docker and Docker Compose.

Atlan CLI Atlan is a CLI that helps you to manage local dockerized infrastructure without any needed knowledge on Docker and Docker Compose. What is A

Myastro 10 Aug 17, 2022
The app's backend is written in Python (Flask) and for search it uses Elasticsearch. I used this app as candidate application for learning out how to build, run and deploy a multi-container environment (docker-compose).

foodtrucks-app-docker-compose The app's backend is written in Python (Flask) and for search it uses Elasticsearch. I used this app as candidate applic

Selçuk Şan 3 Oct 24, 2022
This is the FARM Stack course, where you are going to learn how to build an application from scratch using FASTAPI, React and mongoDB

FARM-Stack-Course This is the FARM Stack course, where you are going to learn how to build an application from scratch using FASTAPI, React and mongoD

Bek Brace 121 Jan 2, 2023
local docker-compose environment to deploy and configure backoffice

backoffice-local local docker-compose environment to deploy and configure backoffice How to install To install the repo dependencies yarn install be s

micro-lc 2 Dec 15, 2022
Boilerplate project to run MOBILE Test Automation with WebdriverIO v7, Mocha, Appium, Allure reporting and Momentum Suite cloud device farm support

WebdriverIO Mocha Appium Momentumsuite WebdriverIO Integration with local or Momentum Suite real mobile farm devices Supports Native or Hybrid Android

Momentum Suite 21 Dec 5, 2022
Dank Memer (Selfbot) Farm with slash commands support and random delays and breaks to avoid any suspicion

Slashy Slashy is a Dank Memer (Selfbot) Farm with slash commands support and random delays and breaks to avoid any suspicion. This is completely undet

Taha Gorme 16 Dec 30, 2022
Docker Extension to backup and restore docker volumes.

vackup-docker-extension This repository contains a Docker Extension that backups Docker volumes. This extension is purely a demonstration of how it'd

Felipe Cruz Martinez 34 Dec 28, 2022
This provides an extension integration with Docker Desktop to run k9s quickly and easily through the Docker Desktop interface.

k9s extension for Docker Desktop This provides an extension integration with Docker Desktop to allow k9s quickly and easily through the Docker Desktop

James Spurin 14 Dec 16, 2022
This is a full-stack exercise tracker web application built using the MERN (MongoDB, ExpressJS, ReactJS, NodeJS) stack. You can easily track your exercises with this Full-Stack Web Application.

Getting Started with Create React App This project was bootstrapped with Create React App. Available Scripts In the project directory, you can run: np

WMouton 2 Dec 25, 2021