🌐 Create a test version for a private 🔐 social media website (client: Groupomania)
🔓 Authentificate a user and maintain their connection untill logout ✅
📑 🔑 Implement a secure data storing system using a database ✅
📱 Developp the website interface using a front-end framework ✅
👥 Create a user account with minimum info ✅
🔓 Login with an email and a password ✅
🔒 Possibility to logout ✅
🔑 Connection data must be secure ✅
📄 List of the posts created by users ✅
⬇️ Reverse chronological order listing ✅
✏️ Create a post with text and/or image ✅
📝 Modify a post (by creator or admin) ✅
❌ Delete a post (by creator or admin) ✅
👍 Like a post (only once) ✅
🛂 Admin must be able to modify/delete all posts ✅
Install Node js [if it's already installed make sure the version you have is compatible with React Js v18.0]
Clone this repo [ https://github.com/nadaissa/IssaNada_7_25062022.git ]
-
Back-end: bcrypt, cors, dotenv, email-validator, express, express-rate-limit, fs, helmet, jsonwebtoken, multer, mysql, mysql2, nodemon, password-validator, sequelize, sequelize-cli.
-
Front-end: axios, js-cookie, moment, node-sass, prop-types, react, react-dom, react-lazy-load-image-component, react-router, react-router-dom, react-scripts
Install and setup your database - this project was conceived with MySQL (see the official MySQL documentation for installation and you can use MySQL Workbench for an easier management of your DB)
-
A dump with the DB structure or both DB structure and content will be provided by email
-
The database schema contains 3 principle tables: :pushpin: users: id, email, password, firstName, lastName, bio, picture, admin, createdAt, updatedAt
📌 posts: id, userId, postContent, postMedia, createdAt, updatedAt
📌 likes: id, postId, userId, createdAt, updatesAt
- the ORM used to manage the API connection with the DB is Sequelize [ see below to transfer the models of the DB]
1- Inside the main folder create an "images" folder
2- Inside the main folder create an ".env" file and define these environnement variables:
- DB_USERNAME: "your database username"
- DB_PASSWORD:"your database password"
- DB_NAME_DEV: "your database name in dev mode"
- DB_NAME_TEST: "your database name in test mode" (if necessary)
- DB_NAME_PROD: "your database name in prod mode" (if necessary)
- SECRET_TOKEN: "your database password generated secret token"
3- Run yarn install
5- Run yarn sequelize-cli db:migrate
4- Run node server
or nodemon server
**Note: the server port depends on the sequelize db configurantion file, the alternative back-end server port is '3001'
1- Run yarn install
3- Follow these front-end readme file instructions:
This project was bootstrapped with Create React App.
In the project directory, you can run:
Runs the app in the development mode.
Open http://localhost:3000 to view it in your browser.
The page will reload when you make changes.
You may also see any lint errors in the console.
Launches the test runner in the interactive watch mode.
See the section about running tests for more information.
Builds the app for production to the build
folder.
It correctly bundles React in production mode and optimizes the build for the best performance.
The build is minified and the filenames include the hashes.
Your app is ready to be deployed!
See the section about deployment for more information.
Note: this is a one-way operation. Once you eject
, you can't go back!
If you aren't satisfied with the build tool and configuration choices, you can eject
at any time. This command will remove the single build dependency from your project.
Instead, it will copy all the configuration files and the transitive dependencies (webpack, Babel, ESLint, etc) right into your project so you have full control over them. All of the commands except eject
will still work, but they will point to the copied scripts so you can tweak them. At this point you're on your own.
You don't have to ever use eject
. The curated feature set is suitable for small and middle deployments, and you shouldn't feel obligated to use this feature. However we understand that this tool wouldn't be useful if you couldn't customize it when you are ready for it.
You can learn more in the Create React App documentation.
To learn React, check out the React documentation.
This section has moved here: https://facebook.github.io/create-react-app/docs/code-splitting
This section has moved here: https://facebook.github.io/create-react-app/docs/analyzing-the-bundle-size
This section has moved here: https://facebook.github.io/create-react-app/docs/making-a-progressive-web-app
This section has moved here: https://facebook.github.io/create-react-app/docs/advanced-configuration
This section has moved here: https://facebook.github.io/create-react-app/docs/deployment
This section has moved here: https://facebook.github.io/create-react-app/docs/troubleshooting#npm-run-build-fails-to-minify