Basic Instagram clone using React, Node, Mysql.
Profile | Post |
---|---|
Performing any CRUD operations from client app has not been implemented yet.
Data has to inserted through api calls separately. Use curl
or postman
. See API
section or go to api documentation.
- node (>=12.18.3 recommended)
- mysql
- yarn (recommended)
- Clone or download the project.
Client application (./client
) is fully separated from the backend application (./api
).
Both applications must be running at the same time for the client app to get access to the server through API calls.
-
Configs are in
./api/.env
. Change according to your development environment.DB_HOST=localhost DB_USER=root DB_PASSWORD='' DB_NAME=instagram_clone DB_DIALECT=mysql JWT_SECRET_KEY=changeThisAndUseUltraLongStringOfAtLeaseThirtyTwoCharactersOrSomeSecureHash PORT=9000
-
Create specified database (e.g.
instagram_clone
) in mysql. -
From root folder import
instagram_clone.sql
in your database to get demo data. Two users are included already for demo.username: batman password: batman username: joker password: batman
-
Go to
./api
directory -
Install dependencies
npm install
-
Start the server
npm start
-
It will run on
localhost
port9000
or the host and port specified.env
.
-
Go to
./client
directory -
Install dependencies
npm install or yarn
-
Set API URL in
./client/.env
(or .env.local) depending on your backend configurationREACT_APP_API_URL='http://localhost:9000'
-
Run
npm start or yarn start
-
Go to http://localhost:3000 in browser.
Very basic APIs for an Instagram clone. It has all the basic CRUD operations to view the frontend application.
Returns token
on login response but currently, no authorization happening at the backend. Can be used to only detect if a user is logged in or not.
Will return generic error responses with error and message fields.
The documentation is published from postman. Go here to view it in the browser.
- Proper error messages on api response.
- Global error handling on react app.
- Infinite scrolling on comments and posts, limiting the number of entries api returns.
- Home Page with Posts
- User registration, like, follow, comment and other expected functionalities on frontend app.
- Unit testing
- Database migration
- Compress image before saving it in storage
- And many more...
reacstrap
uses an older version ofreact-transition-group
in their modals. It will show errors in console but it can be safely used inreact ^16.x
. This will be fixed in the next major update ofreacstrap
.