Giter VIP home page Giter VIP logo

noteworthy-backend's Introduction

Noteworthy-backend

The Node.js backend for the Noteworthy app.

Table of Contents

  1. Architecture Diagram
  2. Tech Stack / Libraries
  3. Endpoints (/api/v1/)
  4. Building and Running the App

Architecture Diagram

Container Architecture Diagram

Tech Stack / Libraries

Endpoints (/api/v1/)

🟒 Auth

Endpoint Method Description Request Body
/auth/register POST Registers a new user. JSON containing email and password.
/auth/login POST Logs in an existing user. JSON containing email and password.

🟒 Notes

/notes/new POST Creates a new note for the authenticated user. JSON containing note details.
/notes/all GET Fetches all notes of a user. N/A - User ID as query parameter.
/notes/update PUT Updates a specific note by ID for the authenticated user. JSON containing updated note details.
notes/delete DELETE Deletes a specific note by ID for the authenticated user. N/A - Note ID as query parameter.

Building and Running the App

βš™οΈ Manually running the containers

Running the database container:

  • Ensure Docker is installed and running.
  • Build a Docker image of the MySQL container based on the DockerFile in backend-db-docker/.
  • While running the image ensure that port 3306 is forwarded using the flag -p 3306:3306 and also set the environment variable MYSQL_ALLOW_EMPTY_PASSWORD to true using the following flag -e MYSQL_ALLOW_EMPTY_PASSWORD=true while running a container based on the image. the container

Running the Node.js / backend container

  • Ensure that the database container is already running.
  • Build and run a Docker container based on the DockerFile at the root of the project ensuring that the port 3001 is forwarded using the flag -p 3301:3301.
  • The server will be running on http://localhost:3001.

πŸ¦Έβ€β™‚οΈ Running the containers using docker-compose

  • Go to the root directory of the project where the docker-compose.yaml file is located.
  • Run the following command docker-compose up from the terminal.
  • The server will be running on http://localhost:3001 and the database will be running on http://localhost:3306.

noteworthy-backend's People

Contributors

technophilist 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.