Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Answer #435

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
node_modules
.env
91 changes: 69 additions & 22 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,22 +1,69 @@
#100Devs Simple Express App Submission

### Goal: Make Your Own CRUD APP and Push To Heroku

### How to submit your code for review:

- Fork and clone this repo
- Create a new branch called answer
- Checkout answer branch
- Push to your fork
- Issue a pull request
- Your pull request description should contain the following:
- (1 to 5 no 3) I completed the challenge
- (1 to 5 no 3) I feel good about my code
- Anything specific on which you want feedback!

Example:
```
I completed the challenge: 5
I feel good about my code: 4
I'm not sure if my constructors are setup cleanly...
```
# BookMarks: Reading Notes

This project allows the user to create, edit, save, and delete their notes for upcoming book reports and tests.

**Link to project:** https://simple-bookmarks-api.herokuapp.com/

## How It's Made

**Tech used:** Embedded JavaScript (EJS), CSS, Node, Express, MongoDB, and deployed with Render.

# Required Dependencies

- `npm install`
- Create a `.env` file and add the following as `key = value`:
- PORT = 8000 (can be any port example: 3000)
- DB_CONNECTION = `your database URI`
- Add a .gitignore file with `.env` and `node_modules`

---

# Run

`npm start`

---

BookMarks was a project I made to further practice CRUD functions, such as creating a new note, reading or refreshing the currently stored data whenever a change is made, editing notes, and deleting a note from the database.

I utilized server-side JavaScript to connect the MongoDB database with the different CRUD functions and Embedded JavaScript Templating (EJS) on the client-side to render the HTML and CSS that the user sees.

## Optimizations

I would add user accounts with authentication, improved styling and responsiveness so the application can run across devices, and additional features for increased student engagement and learning, such as story maps or graphic organizers that they can interact with and customize.

## Lessons Learned

I learned how to utilize CRUD functions to interact with a database based on the user's request. I also implemented an auto refresh with a get request that redirects back the homepage or root route after a post or delete request has been made. The post and delete requests update the database and return updates to the terminal to demonstrate that the request was successful.

## Credits

Photo of Student from colorlib.com

## Other Projects

<table bordercolor="#66b2b2">
<tr>
<td width="33.3%" style="align:center;" valign="top">
<a target="_blank" href="https://github.com/jaclynbrothers/squawk-space">Squawk Space</a>
<br>
<a target="_blank" href="https://github.com/jaclynbrothers/squawk-space">
<img src="https://media.giphy.com/media/7dsiIBgG8OuU95SUvF/giphy.gif" width="100%" alt="Squawk Space">
</a>
</td>
<td width="33.3%" valign="top">
<a target="_blank" href="https://github.com/jaclynbrothers/artist-portfolio">Artist Portfolio</a>
<br>
<a target="_blank" href="https://github.com/jaclynbrothers/artist-portfolio">
<img src="https://media.giphy.com/media/OtZnHQvpwaGOxKxoi1/giphy.gif" width="100%" alt="Artist Portfolio Website">
</a>
</td>
<td width="33.3%" valign="top">
<a target="_blank" href="https://github.com/jaclynbrothers/movie-recommendations-api">Movie Recommendations API</a>
<br>
<a target="_blank" href="https://github.com/jaclynbrothers/movie-recommendations-api">
<img src="https://media.giphy.com/media/MkNt7t4yHfgI8bnwF9/giphy.gif" width="100%" alt="Movie Recommendations">
</a>
</td>
</tr>
</table>
16 changes: 16 additions & 0 deletions models/todotask.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
const mongoose = require('mongoose');
const todoTaskSchema = new mongoose.Schema({
title: {
type: String,
required: true
},
content: {
type: String,
required: true
},
date: {
type: Date,
default: Date.now
}
})
module.exports = mongoose.model('TodoTask',todoTaskSchema,'tasks');
Loading