Welcome to Blogify API, a TypeScript-powered Node.js and Express backend server for your secure and robust blogging platform.
- Typescript: Provides strong typing for enhanced developer experience.
- Node.js & Express: Power the backend server.
- Mongoose & MongoDB: Used for database connectivity and management.
- JWT: Implements token-based authentication for enhanced security.
- Swagger: Generates interactive API documentation.
- Postman: Offers a comprehensive environment for API testing.
- Docker: Enables containerization for consistent deployment.
- Candy for Server: Facilitates server management and deployment.
- Digital Ocean's Droplets: Utilized for scalable and reliable deployment.
-
Clone the repository:
git clone git@github.com:IkboljonMe/blogify-api.git cd blogify-api
-
Create a
.env
file based on.env.example
:cp .env.example .env
Edit the
.env
file and provide the necessary configuration values. -
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
.
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
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.
The application is configured for deployment using Candy Server and Digital Ocean.
-
Ensure Docker are installed.
-
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 to Candy Server:
- I have already predefined Candyfile in project. For more, click here
-
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
-
- Implement Google auth
- Add cookies to save token
- Connect to client(React/Next)