https://github.com/diagne245/ideasharing-app
App To Share Ideas
https://github.com/diagne245/ideasharing-app
express mongodb mongoose node rest-api vanillajs webpack
Last synced: 3 months ago
JSON representation
App To Share Ideas
- Host: GitHub
- URL: https://github.com/diagne245/ideasharing-app
- Owner: Diagne245
- Created: 2024-12-20T04:07:41.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2024-12-20T04:36:44.000Z (over 1 year ago)
- Last Synced: 2025-02-11T16:43:26.384Z (over 1 year ago)
- Topics: express, mongodb, mongoose, node, rest-api, vanillajs, webpack
- Language: JavaScript
- Homepage: https://ideasharing.onrender.com/
- Size: 576 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: readme.md
Awesome Lists containing this project
README
# RandomIdeas App
Demo Link: **https://ideasharing.onrender.com**
This is a fullstack application for sharing random ideas. It is a project from the [**Modern JS From The Beginning 2.0**](https://www.udemy.com/course/modern-javascript-from-the-beginning/?kw=modern+javascript+from+the+beg&src=sac&couponCode=LETSLEARNNOW) Traversy Media Udemy course.
This app includes a `Node.js`/`Express` **`REST API`** that uses `MongoDB` for a database. The client-side is built with `Webpack`.

## Usage
### Install Dependencies
Install dependencies on the front-end and back-end (Be Sure to be in the root folder of the project)
### Front-End/Webpack
```bash
npm install
cd client
npm install
```
### Back-end/Express Server
```bash
npm run dev (Nodemon)
```
Visit `http://localhost:5000`
### Front-end/Webpack Dev Server
```bash
cd client
npm run dev
```
Visit `http://localhost:3000`
To build front-end production files
```bash
cd client
npm run build
```
The production build will be put into the `public` folder, which is the Express static folder.
### Environment Variables
Rename `.env-example` to `.env` and add your MongoDB URI to the `.env` file.
```
MONGO_URI=your_mongodb_uri
```
## REST Endpoints
### Ideas
| Endpoint | Description | Method | Body |
| -------------- | -------------- | ------ | ----------------------- |
| /api/ideas | Get all ideas | GET | None |
| /api/ideas/:id | Get idea by id | GET | None |
| /api/ideas | Add idea | POST | { text, tag, username } |
| /api/ideas/:id | Update idea | PUT | { text, tag, username } |
| /api/ideas/:id | Delete idea | DELETE | username |
When updating or deleting, the username must match the username of the idea creator.
### Features to Add
- #### implement authentication:
Add password field to schema and store it into database - encrypt it