Skip to content

Commit

Permalink
Set up website folder structure and updated server.js
Browse files Browse the repository at this point in the history
This commit establishes the basic folder structure for the website, including folders for static assets, views, and routes. Additionally, the server.js file has been updated to include the necessary dependencies and routing logic for these folders.
  • Loading branch information
royalpinto007 committed Mar 16, 2023
1 parent 9fc452b commit a54eeee
Show file tree
Hide file tree
Showing 15 changed files with 1,736 additions and 0 deletions.
Empty file added client/public/index.html
Empty file.
Empty file added client/src/components/App.js
Empty file.
Empty file added client/src/index.js
Empty file.
Empty file added client/src/pages/Home.js
Empty file.
1,675 changes: 1,675 additions & 0 deletions package-lock.json

Large diffs are not rendered by default.

32 changes: 32 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
{
"name": "stoccoin-website",
"version": "1.0.0",
"description": "Welcome to Stoccoin's GitHub repository! Here, you'll find all the code and resources needed to build and deploy our user-friendly news, trading platform for stocks and cryptocurrencies.",
"main": "server.js",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
},
"repository": {
"type": "git",
"url": "git+https://github.com/Stoccoin-Official/Stoccoin-Website.git"
},
"author": "",
"license": "ISC",
"bugs": {
"url": "https://github.com/Stoccoin-Official/Stoccoin-Website/issues"
},
"homepage": "https://github.com/Stoccoin-Official/Stoccoin-Website#readme",
"dependencies": {
"axios": "^1.3.4",
"bcrypt": "^5.1.0",
"bootstrap": "^5.2.3",
"cors": "^2.8.5",
"dotenv": "^16.0.3",
"express": "^4.18.2",
"jsonwebtoken": "^9.0.0",
"mongoose": "^7.0.2",
"react": "^18.2.0",
"react-dom": "^18.2.0",
"react-router-dom": "^6.9.0"
}
}
Empty file added server/config.js
Empty file.
Empty file.
Empty file.
Empty file added server/middleware/auth.js
Empty file.
Empty file added server/models/Crypto.js
Empty file.
Empty file added server/models/Stock.js
Empty file.
Empty file added server/routes/cryptoRoutes.js
Empty file.
Empty file added server/routes/stockRoutes.js
Empty file.
29 changes: 29 additions & 0 deletions server/server.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
// server.js

const express = require('express');
const mongoose = require('mongoose');
const cors = require('cors');
const dotenv = require('dotenv');

dotenv.config();

const app = express();

mongoose.connect(process.env.MONGODB_URI, {
useNewUrlParser: true,
useUnifiedTopology: true,
})
.then(() => {
console.log('Connected to MongoDB');
})
.catch((error) => {
console.error('Error connecting to MongoDB:', error);
});

app.use(cors());
app.use(express.json());
app.use(express.urlencoded({ extended: true }));

app.listen(process.env.PORT || 5000, () => {
console.log(`Server started on port ${process.env.PORT || 5000}`);
});

0 comments on commit a54eeee

Please sign in to comment.