Giter VIP home page Giter VIP logo

awesome-node-app's Introduction

enter image description here

Latte Journal Node App

A simple and versatile blog style app for backend development study and experimentation.

Demo

Live demo

Features

  • EJS rendering.
  • JWT authentication.
  • Fully structured MVC architecture.
  • Markdown editor for better formatted articles.
  • Fully coded with typescript.
  • DigitalOcean App Platform compatible.

Installation

Clone the repo to a local directory.

git clone https://github.com/cyanoblu/awesome-node-app.git

Install the dependencies.

npm install

Setup environment variables, create a .env file in the root directory, the same directory where app.ts is located. You should not, under any circumstances, push any of the info below to a public repository.

APP_PORT=3000    #Choose the port the app will listen to

URI_DB_ACCESS_KEY=db-access-key    #mongodb+srv://<username>:<password>@<db-main>.<db-access-key>.mongodb.net/?retryWrites=true&w=majority

DB_LOGIN=user    #mongodb user login

DB_PASSWORD=password     #user password

DB_COLLECTION=db-collection-name

DB_MAIN=db-name

SECRET_TOKEN=secret-hash    #required for hashing jwt tokens

EXPIRATION_TOKEN=86400    #time it takes for jwt token to expire. set to 24 hours

Make sure you have users and articles as collections on your db, and remember to allow network access to your machine ip on mongodb network panel (Assuming you're using Atlas).

All set, now spin up the server

npm run start

The typescript compiler will do it's job and you have a new great blog running!

For development, i recomend using nodemon

npm run dev

Nodemon will detect any changes on the project files and restart the server automatically, saving a lot of time during development. Remember to change the path serving the public directory for nodemon to be able to detect static files

app.use(express.static(__dirname  +  '../../src/public'))  >  app.use(express.static(__dirname  +  '/src/public'))

That's it, very simple and easy, feel free to experiment play with it as much as you want. Check out the live demo if you want to see it working live.

Credits

Big thanks to the developers of the software below that allow this to function

License

MIT

awesome-node-app's People

Contributors

cyanoblu avatar

Watchers

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