Code Monkey home page Code Monkey logo

didit's Introduction

TodoApp


Start the application

Local dev

⚠️ Please note that a mongodb instance has to run on port 27017. You can start one with docker run -p 27017:27017 --name mongodb -d mongo:latest

  1. npm i
  2. npm run dev

Local production

⚠️ Please note that a mongodb instance has to run on port 27017. You can start one with docker run -p 27017:27017 --name mongodb -d mongo:latest

  1. npm i
  2. Change to baseUrl in environment.prod.ts to the url where the backend will be hosted. (default is already set)
  3. npm run build:prod
  4. Set a SECRET environment variable
  5. npm run start:backend
  6. npm run start:frontend

From docker

  1. Change to baseUrl in environment.prod.ts to the url where the backend will be hosted. (default is already set)
  2. npm run docker:build -> docker container
  3. In case you want to run it locally, use npm run docker:run
  4. By default, the api will be available at localhost:3333 and the frontend at localhost

Customization (production)

Local

  • set the backend port with environment variable PORT
  • don't forget to change the baseUrl in environments

Docker

You can simply change the port mapping of the docker:run script. If you want to change the ports inside the container, use the following steps:

  • Set the backend port of the production stage with ENV PORT {port_here} inside the Dockerfile
  • Set the frontend port within the start.sh file with -l {port_here} Don't forget to EXPOSE this port in production stage of the Dockerfile and update in inside the docker:run command.
  • build a new container

Architecture

This repository contains two apps (backend & frontend) and a shared-library (types).

NestJS is used for the backend and React for the frontend. The database is a mongodb. A Swagger documentation of the API endpoints and data-types can be found at {baseUrl}:{port}/api (default: localhost:3333/api).

Within the docker container, the apps are located at /app/backend and /app/frontend. A mongodb instance is running inside the container and puts its data inside /data/db. A volume todo_app is provided for it using the docker:run script.

Usage (Frontend)

TodoList Page

On a todolist-page you can double-click the name (headline) and edit it. Todo items drag-n-droppable.

didit's People

Watchers

Justin Konratt avatar

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.