Note: This project is for demo purpose, which means it's not yet ready for production.
Pretty SSR blogging website using Next.js and Express.js.
-
Guest users can read all the posts but cannot comment until they login.
-
Authenticated users can create/update/delete their own posts, as well as comment on all other posts using their credentials.
-
Everyone can login using his/her GitHub or Twitter (coming soon) account.
-
Everyone can search/filter posts using keywords that match the post title and body.
-
Post list can be paginated.
See the public demo of the GOLB community!
These instructions will get you a copy of the project up and running on your local machine for development and testing purposes
-
Node.js 12.0+
-
MongoDB 4.2.7+
-
GitHub OAuth app. Create here.
Clone the repository:
git clone https://github.com/duongdev/golb.git
Enter the project directory:
cd golb
Install NPM dependencies:
yarn
Add .env
files:
# packages/server/.env
GH_CLIENT_ID= # GitHub app client ID
GH_CLIENT_SECRET= # GitHub app client secret
JWT_SECRET= # JsonWebToken secret key
MONGO_URI= # MongoDB server URI
# packages/web/.env
NEXT_PUBLIC_GH_CLIENT_ID= # GitHub app client ID
NEXT_PUBLIC_SERVER_URI= # Address of the server
Run the development servers:
# Web
yarn workspace web dev
# Server
yarn workspace server watch:dev
Go to http://localhost:3000 to access the website and http://localhost:4000 to access express server.
Build the web and server:
# Web
yarn workspace web build
# Server
yarn workspace server build
Start the production servers:
# Web
yarn workspace web start
# Server
yarn workspace server start