Giter VIP home page Giter VIP logo

compsci279r-hw1's Introduction

compsci279r-hw1

To-Do App implemented using NodeJS and MongoDB based on the tutorial at https://medium.com/@diogo.fg.pinheiro/simple-to-do-list-app-with-node-js-and-mongodb-chapter-1-c645c7a27583.

How to open hosted version

Navigate to https://peaceful-dusk-53180.herokuapp.com/ in a web browser.

How to run locally

Environment setup

  1. Clone the repository.
  2. Install dependencies from NPM:
npm install
  1. Create and configure the database by following the instructions in the tutorial:

    1. Create a MongoDB Atlas account.
    2. Create a cluster named todo on the free tier.
    3. Add the IP address 0.0.0.0/0 to the allowlist.
    4. Create a new username/password for the cluster.
    5. Get the connection string.
    6. Set the connection string in ./.env, replacing the <username> and <password> parts:
    DB_CONNECT=mongodb+srv://<username>:<password>@todo.qhddaeu.mongodb.net/?retryWrites=true&w=majority
    

Start the server

Start the web server and connect to the database by running the following in a terminal:

npm start

How to deploy to heroku

  1. Create Heroku account
  2. Install Heroku CLI:
brew tap heroku/brew && brew install heroku
  1. Login to the CLI:
heroku login
  1. Run app locally:
heroku local web
  1. Deploy the app:
heroku create
git push heroku main
  1. Add DB_CONNECT config variable in the Heroku dashboard for the project.

  2. Check the logs:

heroku logs --tail

Resources used

compsci279r-hw1's People

Contributors

keller-mark avatar

Watchers

 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.