A full-stack Node.js application built with Next.js, and Firebase made as a clone to Medium.
Table of Contents:
🔎 This repo was created with Nx.
This application was built to mimic the functionalities of the Medium blogging website but with Firebase as the api. Deployed with authentication/authorization, logging, crud features and database persistence out of the box.
-
Please make sure to have Node.js (16+) locally by downloading the Javascript runtime via
brew
,choco
, orapt-get
. -
Please make sure to have Firebase configured either locally or onboarded on GCP cloud by following this guide.
- Please make sure to have Docker Desktop operational to quickly compose the required dependencies. Then follow the docker procedure outlined below.
-
Clone the repo via
git clone https://github.com/msanvarov/bloggo
. -
Download dependencies via
npm i
oryarn
. -
Reconfigure Firebase with the Firebase CLI via
firebase init
. -
Create a .env file via the
cp apps/bloggo/.env.example apps/bloggo/.env
command and replace the existing environment variable placeholders with valid responses. -
Start the api in development mode by using
npm run start
(the ui will be exposed on http://localhost:4200).
- Execute the following command in-app directory:
# creates and loads the docker container in detached mode with the required configuration
$ docker-compose up -d
- The following command will download dependencies and execute the web application on http://localhost:80 (deployed behind a Nginx reverse proxy).
By default, the application comes with a config module that can read in every environment variable from the .env
file.
APP_ENV - the application environment to execute as, either in development or production. Determines the type of logging options to utilize. Options: development
or production
.
FIREBASE_* - the firebase config details that can be fetched when creating the SDK for the app.
# Start the docker container if it's not running
$ docker start bloggo
# unit tests
$ docker exec -it bloggo npm run test
# test api against postman collection
$ docker exec -it bloggo npm run test:postman
# execute test
$ npm run test
Branches | Status |
---|---|
main | ✅ |
feat/* | 🚧 |
PRs are appreciated, I fully rely on the passion ❤️ of the OS developers.
This starter API is MIT licensed.