Here is a live demo MorNooNights News App
MorNooNights App displays News from the world or local to you with filtering options. Users must sign up in order to view news articles and recently viewed articles. The API used for this project is TheNewsAPI
- NodeJS v20.2+
- ExpressJS v4.18+
- PostgreSQL v15+
- PG v8.11+
- ReactJS v18.2+
- React Router v6.14.1+
First navigate to the backend directory and run the following
npm i
Navigate to frontend directory and run the following
npm i
since we are using webpack 5 we need to modify our webpack.config.js file navigate to node_modules -> react-scripts -> config -> webpack.config.js.
enter the following
// line 305
resolve: {
fallback: {
"crypto": require.resolve("crypto-browserify"),
...
}
}
// line 606
plugins: [
new webpack.DefinePlugin({
process: JSON.stringify(process.env.NODE_ENV),
}),
...
]
...
Now we can start our app. Enter the following on your terminal. Make sure you are in the right folder (backend or frontend).
npm start
Make sure to have PostgreSQL installed on your machine before starting. Cd to the backend folder and run the following command on your terminal to seed the database.
psql < mornoonights.sql;
Make sure to install jest
npm i jest
// or globally
npm install jest --global
and run the following command
jest
// or run individual file
jest <filename>.test.js
to run test for the frontend run the following command
npm run test
The database schema is very simple. Users and recent, that's it. We will be using TheNewsAPI for fetching our news data.
Displays the top news of the day
Filter news by categories or by keywords