
Tech used:
This is an express based node server that connects with mongodb for an easy way to begin building and prototyping a server side application quickly. The repository can simply be cloned and provided a .env matching .env-example
This boilerplate comes in the form of a todo application to provide some basic test routes for CRUD operations. After ensuring that the application is connecting to MongoDB properly using these routes, the default routes and controllers can be changed as needed to suite the needs of the app or removed entirely if starting from scratch would be better.
/GET: Return index/root route
/todosGET: Return list of all todos
/todos/createTodoPOST: Submit a new todo item to the database
todos/markCompletePUT: Update a a todo item to mark as complete in the database
todos/markIncompletePUT: Update a a todo item to mark as incomplete in the database
todos/deleteTodoDELETE: Remove a todo item from the database
router.delete('/deleteTodo', todosController.deleteTodo)
- Create MongoDB account/database
- Use connect button to get connection string and make note
- Create .env file to store connection string and port to use on dev environment
- See
.env-exampleand follow instructions to replacedemowith the db specific username and password
- See
- Install server npm dependencies
-
$npm install
-
- To run server in dev environment with nodemon:
-
$npm run dev
-
Optimizations will be added as new projects are built and preferences/tools are discovered/developed
- Creating Node server applications utilizing MVC architecture
- Interacting with MongoDB via CRUD actions
- Utilizing a schema with mongoose to create a relational MongoDB instance
- Using developer tools such as Nodemon, morgan, and cross-env
- Dynamically rendering data server side with ejs files
- REST Client API testing: https://fullstackopen.com/en/part3/node_js_and_express#the-visual-studio-code-rest-client
- MongoDB w/ Express: https://zellwk.com/blog/crud-express-mongodb/ & https://www.youtube.com/watch?v=ayNI9Q84v8g
- Relational MongoDB: https://vegibit.com/mongoose-relationships-tutorial/
Take a look at other examples from my portfolio
Blog Site W/ Categories and Authentication: https://github.com/jnhthomp/alpha-blog2
Stock Based Social Network: https://github.com/jnhthomp/finance-tracker
Restaurant Web-Based Ordering System: https://github.com/jnhthomp/practice-food-order-app