udilia / create-social-network
- вторник, 8 октября 2019 г. в 00:23:07
JavaScript
Create Social Network by running one command. Demo: https://worldexplorer.netlify.com/
Create Social Network is a educational project. The main idea is to demonstrate how one can build a large scalable project with React, Node, GraphQL, MongoDB and other related technologies. However you get the core functionality of social network by running one command and then you can build more on top of that.
npx create-social-network my-network
cd my-network
npm start(npx comes with npm 5.2+ and higher, see instructions for older npm versions)
After installation open http://localhost:3000/ to see your app.
| Home | Profile | Explore |
|---|---|---|
![]() |
![]() |
![]() |
https://worldexplorer.netlify.com/
You’ll need to have Node 8.16.0 or Node 10.16.0 or later version on your local development machine
By default, the app uses MongoDB hosted on mLab and Cloudinary CDN for hosting images. We have created a demo user for mLab and Cloudinary so you can run the app locally without adding Mongo URL and Cloudinary API Key, however when you start developing your application it is recommended to replace that information with your own, so that everyone has their own Database and CDN.
Note demo database is being deleted and populated with demo data daily
Replace MONGO_URL value in api/.env file with your mLab database url or with local one.
Grab Cloud name API Key and API Secret from Cloudinary dashboard and replace corresponding values inside api/.env file.
For password reset functionality you will need to replace Email Provider values also in api/.env file.
To create a new app, you may choose one of the following methods:
npx create-social-network my-network(npx comes with npm 5.2+ and higher, see instructions for older npm versions)
npm init social-network my-networknpm init <initializer> is available in npm 6+
yarn create social-network my-networkyarn create is available in Yarn 0.25+
It will create a directory called my-network inside the current folder.
Inside that directory, it will generate the initial project structure and install dependencies.
my-network
├── api
├── frontend
├── node_modules
├── .gitignore
├── netlify.toml
├── package.json
├── README.md
The app is organized as Monorepo using Yarn Workspaces
Once the installation is done, you can open your project folder:
cd my-networkAnd start the application with npm start or yarn start that will run the app in development mode.
Open http://localhost:3000/ to view it in the browser.
The page will automatically reload if you make changes to the code.
In development mode we are starting api and frontend servers with one command, but we need to deploy them separately.
Please read our CONTRIBUTING.md before submitting a Pull Request to the project.
Many ideas for CLI tool and Readme file are taken from Create React App project.
MIT License Copyright (c) 2019 udilia