Skip to content

Meal logger API built to demonstrate the implementation of MVC architecture in backend systems.

Notifications You must be signed in to change notification settings

ruth-cohen89/mvc-meal-logger-api

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

35 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

MVC Meal Logger API

The purpose of the application is to demonstrate a basic, clean backend API using the MVC architecture.

This minimalist backend application is built with Node.js and Express, featuring a clean architecture with the MVC (Model-View-Controller) pattern, including models, controllers, and routes. It provides a lightweight foundational structure for handling simple data operations.

The application is a meal logger, enabling users to log their meals into the app and edit them, it has 2 objects: users and meals.

Key Components:

  • Routes: Establishes the API endpoints and connects them to the corresponding controllers.
  • Controllers: Handles the business logic and orchestrates data flow.
  • Models: Defines the data structure and interacts with the database.
  • Middlewares: Implement additional functionalities in the request-response cycle.
  • Server: server.js - The entry point for starting the server.
  • Application Configuration: app.js - Initializes and configures the Express application.
  • Package Configuration: package.json - Describes your Node.js project, including dependencies and scripts.

Usage:

  • Easily extendable for small to medium-sized projects.

  • Provides a structured approach to handling data with separation of concerns.

  • Ideal for quick prototyping and building lightweight APIs.

Getting Started:

  1. Clone the repository.

  2. Install dependencies using npm install.

  3. Configure your database connection.

  4. Start the server with npm start.

Project Structure:

├── models/

├── controllers/

├── routes/

├── app.js

├── server.js

├── package.json

API Endpoints:

'/api/meals'

'/api/users'

(GET, POST, PUT, DELETE): Perform basic CRUD operations.

Contributing:

Feel free to contribute and enhance the simplicity and functionality of this project. Fork the repository, make your changes, and submit a pull request.

License:

This project is licensed under the MIT License.

About

Meal logger API built to demonstrate the implementation of MVC architecture in backend systems.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published