Skip to content

Commit

Permalink
Adding my updated files and new file versions
Browse files Browse the repository at this point in the history
  • Loading branch information
temichelle13 authored Dec 18, 2023
1 parent 1589a3a commit 4174648
Show file tree
Hide file tree
Showing 43 changed files with 117,032 additions and 116,888 deletions.
42 changes: 21 additions & 21 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -1,21 +1,21 @@
MIT License

Copyright (c) [Year] [Your Name]

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
MIT License
Copyright (c) [Year] [Your Name]
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
50 changes: 25 additions & 25 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,25 +1,25 @@
# StudyPlanner

A brief description of your project, its purpose, and functionality.

## Features

- List of features
- Key functionalities of your application

## Getting Started

### Prerequisites

- Node.js
- MongoDB
- Any other dependencies

### Installation

Provide step-by-step instructions on setting up the project locally.

```bash
git clone https://github.com/yourusername/StudyPlanner.git
cd StudyPlanner
npm install
# StudyPlanner

A brief description of your project, its purpose, and functionality.

## Features

- List of features
- Key functionalities of your application

## Getting Started

### Prerequisites

- Node.js
- MongoDB
- Any other dependencies

### Installation

Provide step-by-step instructions on setting up the project locally.

```bash
git clone https://github.com/yourusername/StudyPlanner.git
cd StudyPlanner
npm install
42 changes: 21 additions & 21 deletions SECURITY.md
Original file line number Diff line number Diff line change
@@ -1,21 +1,21 @@
# Security Policy

## Supported Versions

Use this section to tell people about which versions of your project are
currently being supported with security updates.

| Version | Supported |
| ------- | ------------------ |
| 5.1.x | :white_check_mark: |
| 5.0.x | :x: |
| 4.0.x | :white_check_mark: |
| < 4.0 | :x: |

## Reporting a Vulnerability

Use this section to tell people how to report a vulnerability.

Tell them where to go, how often they can expect to get an update on a
reported vulnerability, what to expect if the vulnerability is accepted or
declined, etc.
# Security Policy

## Supported Versions

Use this section to tell people about which versions of your project are
currently being supported with security updates.

| Version | Supported |
| ------- | ------------------ |
| 5.1.x | :white_check_mark: |
| 5.0.x | :x: |
| 4.0.x | :white_check_mark: |
| < 4.0 | :x: |

## Reporting a Vulnerability

Use this section to tell people how to report a vulnerability.

Tell them where to go, how often they can expect to get an update on a
reported vulnerability, what to expect if the vulnerability is accepted or
declined, etc.
96 changes: 37 additions & 59 deletions app.js
Original file line number Diff line number Diff line change
@@ -1,59 +1,37 @@
{
"// FILEPATH": "/c:/Users/teami/StudyPlanner/app.js",
"// BEGIN: ed8c6549bwf9": "",
"dependencies": {
"cors": "^2.8.5"
},
"// END: ed8c6549bwf9": ""
}
const morgan = require('morgan');


const express = require('express');
const cors = require('cors');
const morgan = require('morgan'); // Add this line

const app = express();

const port = process.env.PORT || 3000;

// Middleware to parse JSON and urlencoded data
app.use(express.json());
app.use(express.urlencoded({ extended: true
}));

// Enable CORS
app.use(cors());

// Morgan for logging HTTP requests
app.use(morgan('dev'));

// Load environment variables
require('dotenv').config();

// Sample root route for basic testing
app.get('/', (req, res) => {
res.send('Hello, StudyPlanner!');
});

// Task routes
const taskRoutes = [
// Define your task routes here
];

app.use('/api/tasks', taskRoutes);

// Global error handling middleware
app.use((err, req, res, next) => {
console.error(err.stack); // Log the error stack for debugging
res.status(500).send('Something broke!');
});

// Start the server
app.listen(port, () => {
console.log(`StudyPlanner app listening at http: //localhost:${process.env.PORT || 3000}`);
});





require('dotenv').config();
const express = require('express');
const cors = require('cors');
const morgan = require('morgan');
const helmet = require('helmet');

const app = express();
const port = process.env.PORT || 3000;

// Middleware for parsing JSON and urlencoded data
app.use(express.json());
app.use(express.urlencoded({ extended: true }));

// Enable CORS for all routes
app.use(cors());

// Helmet for security by setting various HTTP headers
app.use(helmet());

// Morgan for logging HTTP requests
app.use(morgan('tiny'));

// Global error handler for uncaught exceptions and unhandled promise rejections
process.on('uncaughtException', (error) => {
console.error(`Uncaught Exception: ${error.message}`);
process.exit(1);
});

process.on('unhandledRejection', (error) => {
console.error(`Unhandled Rejection: ${error.message}`);
});

// Starting the server
app.listen(port, () => {
console.log(`Server is running on port ${port}`);
});
18 changes: 9 additions & 9 deletions cspell.json
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
{
"version": "0.2",
"ignorePaths": [],
"dictionaryDefinitions": [],
"dictionaries": [],
"words": [],
"ignoreWords": [],
"import": []
}
{
"version": "0.2",
"ignorePaths": [],
"dictionaryDefinitions": [],
"dictionaries": [],
"words": [],
"ignoreWords": [],
"import": []
}
3 changes: 3 additions & 0 deletions custom_user_data.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"enabled": true
}
20 changes: 10 additions & 10 deletions data_sources/mongodb-atlas/config.json
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
{
"name": "mongodb-atlas",
"type": "mongodb-atlas",
"config": {
"clusterName": "StudyPlannerCluster",
"readPreference": "primary",
"wireProtocolEnabled": false
},
"version": 1
}
{
"name": "mongodb-atlas",
"type": "mongodb-atlas",
"config": {
"clusterName": "StudyPlannerCluster",
"readPreference": "primary",
"wireProtocolEnabled": false
},
"version": 1
}
36 changes: 18 additions & 18 deletions data_sources/mongodb-atlas/default_rule.json
Original file line number Diff line number Diff line change
@@ -1,18 +1,18 @@
{
"id": "655dac9fccee7c038194a679",
"roles": [
{
"name": "read-not-write",
"apply_when": {},
"document_filters": {
"write": false,
"read": true
},
"read": true,
"write": false,
"insert": true,
"delete": true,
"search": true
}
]
}
{
"id": "655dac9fccee7c038194a679",
"roles": [
{
"name": "read-not-write",
"apply_when": {},
"document_filters": {
"write": false,
"read": true
},
"read": true,
"write": false,
"insert": true,
"delete": true,
"search": true
}
]
}
2 changes: 1 addition & 1 deletion data_sources/mongodb-atlas/todo/Item/relationships.json
Original file line number Diff line number Diff line change
@@ -1 +1 @@
{}
{}
42 changes: 21 additions & 21 deletions data_sources/mongodb-atlas/todo/Item/rules.json
Original file line number Diff line number Diff line change
@@ -1,21 +1,21 @@
{
"collection": "Item",
"database": "todo",
"roles": [
{
"name": "write-own-items",
"apply_when": {},
"document_filters": {
"write": {
"owner_id": "%%user.id"
},
"read": true
},
"read": true,
"write": true,
"insert": true,
"delete": true,
"search": true
}
]
}
{
"collection": "Item",
"database": "todo",
"roles": [
{
"name": "write-own-items",
"apply_when": {},
"document_filters": {
"write": {
"owner_id": "%%user.id"
},
"read": true
},
"read": true,
"write": true,
"insert": true,
"delete": true,
"search": true
}
]
}
Loading

0 comments on commit 4174648

Please sign in to comment.