Giter VIP home page Giter VIP logo

notes-demo-app's Introduction

Notes Demo App

Overview

This project provides a simple demo application for creating, reading, and deleting notes using a Python Flask API and a web frontend. The backend API uses MongoDB for data persistence, while the frontend uses vanilla JavaScript and Bootstrap for the UI. The app is containerized with Docker for easy deployment.

Features

  • RESTful API using Flask and MongoDB for CRUD operations on notes.
  • Web frontend using Bootstrap.
  • Dockerized backend and frontend services.
  • Docker-compose for orchestrating services including MongoDB.
  • Gunicorn for serving the Flask application.
  • Nginx for serving the frontend.

Prerequisites

  • Docker
  • Docker-compose

Architecture

    +--------+    HTTP   +------------+    MongoDB    +-------+
    | Front  | <-------> |  Flask     | <-----------> |  DB   |
    |(Nginx) |    API    | (Gunicorn) |               |(Mongo)|
    +--------+           +------------+               +-------+

Getting Started

Clone the repository

git clone https://github.com/blakelead/notes-demo-app.git

Run the Application

Run the following command to start the application:

docker-compose up

This will build and start the services defined in docker-compose.yml.

  • Frontend will be available at http://localhost:5000
  • API will be available at http://localhost:8000

API Documentation

Get All Notes

Request:

GET /api/notes

Response:

{
  "notes": [
    {
      "_id": "note_id",
      "note": "example_note"
    }
  ]
}

Create New Note

Request:

POST /api/notes

Body:

{
  "note": "New Note"
}

Response:

{
  "message": "note note_id created"
}

Delete Note

Request:

DELETE /api/notes/note_id

Response:

{
  "message": "note note_id deleted"
}

Health Check

Request:

GET /api/status

Response:

{
  "build_version": "dev",
  "environment": "development"
}

Frontend Documentation

  • Add a Note: Use the "Ajouter une note" form to add a new note.
  • Delete a Note: Click the "โœ–" icon next to the note to delete it.

Environment Variables

Backend

  • MONGODB_URI: MongoDB URI (default is db:27017)
  • BUILD_VERSION: Build version (default is dev)
  • ENVIRONMENT: Application environment (default is development)
  • DEBUG: Enable debug mode (default is True)

Frontend

  • API_URL: URL of the API service (should be set in docker-compose.yml)

License

MIT

notes-demo-app's People

Contributors

blakelead avatar

Watchers

 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.