Git Product home page Git Product logo

the-coworking-space-app's Introduction

Space Management API

This Node.js application provides CRUD operations for managing spaces, along with Swagger documentation, logging, and commit message enforcement.

Table of Contents

Features

  • CRUD operations for managing spaces (Create, Read, Update, Delete)
  • Swagger documentation for exploring and testing the APIs
  • Logging using Winston to log incoming requests, successful operations, and errors
  • Seed script to populate the database with initial data
  • Husky and Commitizen integration for enforcing conventional commit messages (npm run commit)
  • Metrics for monitoring the application's performance (https://coworking-space-apis.azmy.blog/metrics)
  • No Secrets in the code, all managed through .env file
  • Helm chart for packaging the application for deployment to Kubernetes
    • Includes hooks for running database migrations and seeding the database
    • Includes Test suite for testing the application after deployment

Setup

Clone the Repository

git clone https://github.com/Aazme/coworking-space-api
cd coworking-space-api

Install Dependencies

npm install

Set Up Environment Variables

Create a .env file in the project root and define the following variables:

PORT=3000
MONGODB_CONNECTION=<your-mongodb-uri>

Replace <your-mongodb-uri> with your MongoDB connection string.

Seed the database

npm run seed

Start the Server

npm run dev

Twelve-Factor Apps

  • The application follows the Twelve-Factor Apps methodology for better scalability, maintainability, and portability.
  • Environment variables are used for configuration, ensuring the application is easily deployable across different environments.
  • Metrics are exposed as an endpoint, allowing the application to be monitored and managed easily.
  • The application is stateless, allowing it to be easily scaled horizontally.
  • The application is self-contained, with all dependencies and configuration managed through the package.json and .env files.

Packaging the Helm Chart

To package the Helm chart for deployment, follow these steps:

  1. Navigate to the Charts Folder: Open your terminal and navigate to charts folder.

  2. Package the Helm Chart: Use the Helm CLI to package the Helm chart. Run the following command:

    helm package .
  3. Verify Packaged Chart: Once the packaging process is complete, you should see a .tgz file created in the current directory. You can verify the packaged chart by listing the files in the directory:

  4. Use the Packaged Chart: You can now use the packaged chart to deploy the application to a Kubernetes cluster. Run the following command to deploy the application using the packaged chart:

    helm install coworking-space-api-release coworking-space-api-0.1.0.tgz

    Replace coworking-space-api-release with the name you want to give to the release and coworking-space-api-0.1.0.tgz with the name of the packaged chart file.

    The application will be deployed to the Kubernetes cluster using the packaged chart.

  5. Verify the Deployment: You can verify the deployment by listing the releases in the cluster:

    helm list

    You should see the release you created listed in the output.

  6. Test the helm chart: You can test the helm chart by running the following command:

    helm test coworking-space-api-release

    Replace coworking-space-api-release with the name of the release you created.

  7. Access the Application: You can access the application by navigating to the URL of the Kubernetes cluster. The application will be running in the cluster, and you can access it using the URL provided by your cloud provider.

TODOs

  • Add unit tests
  • Automate the deployment process to Kubernetes using CI/CD
  • Add authentication and authorization
  • Implement rate limiting and request validation

the-coworking-space-app's People

Contributors

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