To setup a local development environment, follow the steps given below.
- Ensure you have NodeJS, npm and redis installed in your system.
- Fork and then clone the repository
$ git clone https://github.com/<your-username>/COCWebsite.git
- Install dependencies in
new_client
folder.
$ cd new_client
$ npm i
- Install dependencies in
server
folder.
$ cd ../server # If you are in ./server
$ npm i
- Generate environment variables and fill in the values.
$ cp .env.example .env
Your
.env
is ignored bygit
, which you can see in.gitignore
, and so, it's safe!
- Start the development servers
$ npm run dev
At the end of this, you should have
- server running at
http://localhost:8000
- new_client running at
http://localhost:3000
- redis running at PORT
6379
Our folder structure
.
├── new_client
│ ├── public # Stores public files like index.html
│ └── src
│ ├── actions # Redux actions and types
│ ├── reducers # Redux reducers
│ ├── store # Redux store
│ └── components
│ └── auth # A component directory
└── server
├── src
│ ├── config
│ │ ├── dbconnect.js # Database connections.
│ │ ├── index.js # Config object
│ │ └── redis.js # Redis connection
│ ├── controllers
│ │ └── AuthController.js # Sample controller
│ ├── middleware
│ │ └── auth.js # Express middleware
│ ├── models
│ │ └── User.js # Mongoose model
│ ├── utility # Standard utilities
│ ├── views # .ejs files for mails
│ ├── app.js # Main server file
│ └── routes.js # Express routes
└── test
├── api
│ └── users_test.js # Sample test file using mocha, chai
└── test_helper.js # Test config initializers
Now that the development environment is all set up, head over to Contributing to learn how to contribute to COCWebsite.