Skip to content

Blogify API - a TypeScript-powered Node.js backend using Express and MongoDB for a flexible and secure blogging platform. Dockerized, documented with Swagger, and deployed with Candy on Digital Ocean.

Notifications You must be signed in to change notification settings

IkboljonMe/blogify-api

Repository files navigation

Blogify API

Welcome to Blogify API, a TypeScript-powered Node.js and Express backend server for your secure and robust blogging platform.

Table of Contents

Technologies Used

Installation

  1. Clone the repository:

    git clone git@github.com:IkboljonMe/blogify-api.git
    cd blogify-api
  2. Create a .env file based on .env.example:

    cp .env.example .env

    Edit the .env file and provide the necessary configuration values.

  3. Install dependencies and run the development server:

    yarn install
    yarn run dev

    This will start the development server at http://localhost:1337.

    Open http://localhost:1337/docs to access Swagger documentation. For additional details, refer to ROUTES.md.

Swagger Documentation

Explore and interact with the API using Swagger documentation. Visit http://localhost:1337/docs to view detailed information about available routes, request payloads, and responses. For additional details of every API endpoint, go to ROUTES.md file

Postman for Better Testing

For a comprehensive testing experience, import the provided Postman collection (postman_collection.json)(link) into your Postman workspace. The collection includes pre-configured requests for various API endpoints, making testing and development more efficient.

Deployment

The application is configured for deployment using Candy Server and Digital Ocean.

Running with Docker

  1. Ensure Docker are installed.

  2. Build and run the Docker containers:

    docker-compose up

    To run in the background, use:

    docker-compose up -d

    To build and run:

    docker-compose up --build

Deploy with Candy Server and Digital Ocean

  1. Deploy to Candy Server:

    • I have already predefined Candyfile in project. For more, click here
  2. Deploy to Digital Ocean:

    • Create a Digital Ocean Droplet.

    • Connect to your Droplet and clone the repository. For more, read official tutorial. Personally, I did not push project Docker Hub, instead simply I connected repo to Droplet via terminal. Follow attached tutorial for better understanding.

    • Install dependencies and start the server. To deploy a project, simply use my deploy.sh script to pull and push repo to Digital Ocean droplet.

    ./deploy.sh

TODO

  • Implement Google auth
  • Add cookies to save token
  • Connect to client(React/Next)

About

Blogify API - a TypeScript-powered Node.js backend using Express and MongoDB for a flexible and secure blogging platform. Dockerized, documented with Swagger, and deployed with Candy on Digital Ocean.

Topics

Resources

Stars

Watchers

Forks

Languages